Browse Source

Simplified template variable naming

Alois Mahdal 11 years ago
parent
commit
52194e1319
4 changed files with 22 additions and 16 deletions
  1. 8
    6
      lib/SugarTrail.pm
  2. 2
    2
      views/html.tt
  3. 8
    4
      views/layouts/html.tt
  4. 4
    4
      views/plain.tt

+ 8
- 6
lib/SugarTrail.pm View File

39
     &helper::dmup(w=>$w);
39
     &helper::dmup(w=>$w);
40
 
40
 
41
     template $format, {
41
     template $format, {
42
-        s_head =>           $s->head(),
43
-        s_body =>           $s->body(),
44
-        s_warnings =>       $s->warnings(),
45
-        m_Name =>           $m->{meta}->{Name},
46
-        s_Master =>         $s->{meta}->{Master},
47
-        s_MasterRevision => $s->{meta}->{'Master Revision'}
42
+        head            => $s->head(),
43
+        body            => $s->body(),
44
+        warnings        => $s->warnings(),
45
+        Name            => $m->{meta}->{Name},
46
+        Owner           => $m->{meta}->{Owner},
47
+        Master          => $s->{meta}->{Master},
48
+        MasterRevision  => $s->{meta}->{'Master Revision'},
49
+        Params          => $s->{meta}->{Params}
48
     }, { layout => $format };
50
     }, { layout => $format };
49
 };
51
 };
50
 
52
 

+ 2
- 2
views/html.tt View File

1
-[% IF s_warnings.0 %]
1
+[% IF warnings.0 %]
2
         <aside id="errbox">
2
         <aside id="errbox">
3
 
3
 
4
             <h1>SUGAR-TRAIL WARNINGS</h1>
4
             <h1>SUGAR-TRAIL WARNINGS</h1>
5
 
5
 
6
             <blockquote id="warnings">
6
             <blockquote id="warnings">
7
-[% FOREACH w in s_warnings %]
7
+[% FOREACH w in warnings %]
8
                 <p>[% w %]</p>
8
                 <p>[% w %]</p>
9
 [% END %]
9
 [% END %]
10
             </blockquote>
10
             </blockquote>

+ 8
- 4
views/layouts/html.tt View File

2
 <html lang="en">
2
 <html lang="en">
3
 
3
 
4
     <head>
4
     <head>
5
-        <title>[% m_Name %]</title>
5
+        <title>[% Name %]</title>
6
+
6
         <meta charset="utf-8" />
7
         <meta charset="utf-8" />
7
-        <meta x-st-slave="Params: a=b" />
8
-        <meta x-st-slave="[% s_Master %]" />
9
-        <meta x-st-slave="[% s_MasterRevision %]" />
8
+
9
+        <meta name="Params" content="[% Params %]" />
10
+        <meta name="Owner"  content="[% Owner %]" />
11
+        <meta name="Master" content="[% Master %]" />
12
+        <meta name="Master Revision" content="[% MasterRevision %]" />
13
+
10
         <link rel="stylesheet" href="/main.css" />
14
         <link rel="stylesheet" href="/main.css" />
11
         <link rel="alternate" href="/st/release/rc.stm?a=b" />
15
         <link rel="alternate" href="/st/release/rc.stm?a=b" />
12
     </head>
16
     </head>

+ 4
- 4
views/plain.tt View File

1
-[% s_head %]
2
-[% IF s_warnings.0 %]---
1
+[% head %]
2
+[% IF warnings.0 %]---
3
 SUGAR-TRAIL WARNINGS:
3
 SUGAR-TRAIL WARNINGS:
4
-=====================[% FOREACH warning IN s_warnings %]
4
+=====================[% FOREACH warning IN warnings %]
5
 [% warning %][% END %]
5
 [% warning %][% END %]
6
 ---
6
 ---
7
-[% END %][% s_body %]
7
+[% END %][% body %]