diff shared_view/layout/default.tt @ 4:699dd88f0ef2

sync
author sergey
date Thu, 08 May 2014 15:55:40 +0400
parents 84ed27230825
children 2d1a0a75fc49
line wrap: on
line diff
--- a/shared_view/layout/default.tt	Thu May 08 03:54:38 2014 +0400
+++ b/shared_view/layout/default.tt	Thu May 08 15:55:40 2014 +0400
@@ -1,1 +1,31 @@
-$content
\ No newline at end of file
+[%
+	document.css = [];
+	document.scripts = [];
+	document.meta = [];
+	document.class = [];
+%]
+[% BLOCK PAGE_LAYOUT %]
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>[% site.name ? "$site.name - $document.title" : document.title %]</title>
+		[%- FOREACH item IN document.css +%]
+		<link rel="stylesheet" href="$index" type="text/css">
+		[% END %]
+		[% FOREACH item IN document.scripts +%]
+		<script type="[% item.type || 'text/javascript' %]"[% ' href="' _ item.href _ '"' IF item.href %]>
+			[% item.text %]
+		</script>
+		[% END %]
+		[% FOREACH item IN document.meta +%]
+		<meta [% FOREACH pair IN item %]$pair.key = "[% pair.value | html_entity %]" [% END %]>
+		[% END +%]
+	</head>
+	<body[% ' class="' _ document.class.join(' ') _ '"' IF document.class.size %]>
+		$content
+	</body>
+</html>
+[% END %]
+[% WRAPPER PAGE_LAYOUT;
+	render(document.layout ? "default/$document.layout"  : 'default/base', content = content, model = model);
+END %]
\ No newline at end of file