Alois Mahdal 11 лет назад
Родитель
Сommit
dfbe03227a
5 измененных файлов: 28 добавлений и 15 удалений
  1. 12
    4
      lib/SugarTrail.pm
  2. 5
    5
      views/html.tt
  3. 3
    3
      views/layouts/html.tt
  4. 1
    1
      views/layouts/plain.tt
  5. 7
    2
      views/plain.tt

+ 12
- 4
lib/SugarTrail.pm Просмотреть файл

@@ -33,10 +33,18 @@ get qr|^/st/([^\?]*)(.*)$| => sub {
33 33
         or return template 'not_found';
34 34
     my $s = $m->generate_slave($params);
35 35
 
36
-    template 'st', {
37
-        st_headers =>   $s->head(),
38
-        content =>      $s->body(),
39
-        warnings =>     $s->warnings()
36
+    &helper::dmup(m=>$m);
37
+    &helper::dmup(s=>$s);
38
+    my $w = $s->warnings();
39
+    &helper::dmup(w=>$w);
40
+
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'}
40 48
     }, { layout => $format };
41 49
 };
42 50
 

+ 5
- 5
views/html.tt Просмотреть файл

@@ -1,16 +1,16 @@
1
+[% IF s_warnings.0 %]
1 2
         <aside id="errbox">
2 3
 
3 4
             <h1>SUGAR-TRAIL WARNINGS</h1>
4 5
 
5 6
             <blockquote id="warnings">
6
-                <p>warning: undecided condition: proto==imap; did you forget to specify proto?</p>
7
-                <p>warning: undecided condition: proto==pop3; did you forget to specify proto?</p>
8
-                <p>warning: undecided condition: os==wxx; did you forget to specify os?</p>
9
-                <p>warning: undecided condition: os=~w7*; did you forget to specify os?</p>
10
-                <p>warning: undecided condition: proto==pop3; did you forget to specify proto?</p>
7
+[% FOREACH w in s_warnings %]
8
+                <p>[% w %]</p>
9
+[% END %]
11 10
             </blockquote>
12 11
 
13 12
         </aside>
13
+[% END %]
14 14
 
15 15
         <form>
16 16
 

+ 3
- 3
views/layouts/html.tt Просмотреть файл

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

+ 1
- 1
views/layouts/plain.tt Просмотреть файл

@@ -1 +1 @@
1
-<% content %>
1
+[% content %]

+ 7
- 2
views/plain.tt Просмотреть файл

@@ -1,2 +1,7 @@
1
--<% st_headers %>
2
--<% warnings %><% content %>
1
+[% s_head %]
2
+[% IF s_warnings.0 %]---
3
+SUGAR-TRAIL WARNINGS:
4
+=====================[% FOREACH warning IN s_warnings %]
5
+[% warning %][% END %]
6
+---
7
+[% END %][% s_body %]