4
|
1 [%
|
|
2 document.css = [];
|
|
3 document.scripts = [];
|
|
4 document.meta = [];
|
|
5 document.class = [];
|
8
|
6 document.postRender = [];
|
|
7 render('init',model = model);
|
4
|
8 %]
|
|
9 [% BLOCK PAGE_LAYOUT %]
|
|
10 <!DOCTYPE html>
|
|
11 <html>
|
|
12 <head>
|
|
13 <title>[% site.name ? "$site.name - $document.title" : document.title %]</title>
|
6
|
14 [% FOREACH item IN document.css %]
|
|
15 <link rel="stylesheet" href="$item" type="text/css">
|
4
|
16 [% END %]
|
|
17 [% FOREACH item IN document.scripts +%]
|
8
|
18 <script type="[% item.type || 'text/javascript' %]"[% ' src="' _ item.src _ '"' IF item.src %]>
|
4
|
19 [% item.text %]
|
|
20 </script>
|
|
21 [% END %]
|
|
22 [% FOREACH item IN document.meta +%]
|
|
23 <meta [% FOREACH pair IN item %]$pair.key = "[% pair.value | html_entity %]" [% END %]>
|
|
24 [% END +%]
|
|
25 </head>
|
|
26 <body[% ' class="' _ document.class.join(' ') _ '"' IF document.class.size %]>
|
|
27 $content
|
|
28 </body>
|
|
29 </html>
|
|
30 [% END %]
|
7
|
31 [% BLOCK CONTENT_LAYOUT;
|
4
|
32 render(document.layout ? "default/$document.layout" : 'default/base', content = content, model = model);
|
7
|
33 END %]
|
|
34 [% WRAPPER PAGE_LAYOUT;
|
|
35 WRAPPER CONTENT_LAYOUT;
|
|
36 content;
|
8
|
37 END;
|
|
38 FOREACH item IN document.postRender;
|
|
39 render(item, model = model);
|
|
40 END;
|
7
|
41 END %]
|