summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2012-01-10 22:54:23 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2012-01-10 22:54:23 +0100
commita623647d714495439523c124e7efe517d6c15314 (patch)
treec2ed83240e12883944ba6c7f97736d9ef8db6c19 /templates
parent8de68a6a0d027a86205cab0c078230e9391496d5 (diff)
downloadkosten-a623647d714495439523c124e7efe517d6c15314.tar.gz
kosten-a623647d714495439523c124e7efe517d6c15314.tar.bz2
kosten-a623647d714495439523c124e7efe517d6c15314.zip
Switch to mako blocks
Diffstat (limited to 'templates')
-rw-r--r--templates/page.mako7
-rw-r--r--templates/pages/add.mako12
-rw-r--r--templates/pages/cats.mako8
-rw-r--r--templates/pages/const.mako4
-rw-r--r--templates/pages/constadd.mako4
-rw-r--r--templates/pages/constedit.mako4
-rw-r--r--templates/pages/constlist.mako4
-rw-r--r--templates/pages/edit.mako4
-rw-r--r--templates/pages/show.mako8
-rw-r--r--templates/root.mako60
10 files changed, 50 insertions, 65 deletions
diff --git a/templates/page.mako b/templates/page.mako
index bc52c7f..77d24a2 100644
--- a/templates/page.mako
+++ b/templates/page.mako
@@ -2,13 +2,12 @@
## content
-<h1 class="title">${self.heading()}</h1>
+<h1 class="title">
+ <%block name="heading"></%block>
+</h1>
${next.body()}
## functions
-<%def name="heading()">
-</%def>
-
<%def name="left_arrow(target,label)">
<a id="left" href=${"/%s" % target | url}>
<img src=${"/static/images/arrow_left.png" | url} />
diff --git a/templates/pages/add.mako b/templates/pages/add.mako
index 4c7116f..e104fc5 100644
--- a/templates/pages/add.mako
+++ b/templates/pages/add.mako
@@ -9,17 +9,17 @@
<input type="submit" />
</form>
-<%def name="heading()">
+<%block name="heading">
Neue Ausgabe hinzufügen
-</%def>
+</%block>
-<%def name="js()">
+<%block name="js">
${parent.js()}
<script type="text/javascript" src=${"/static/jqueryui/jquery-ui-1.8.2.js" | url}></script>
<script type="text/javascript" src=${"/static/js/add.js" | url}></script>
-</%def>
+</%block>
-<%def name="style()">
+<%block name="style">
${parent.style()}
<link href=${"/static/jqueryui/css/ui-darkness/jquery-ui-1.8.2.custom.css" | url} rel="stylesheet" type="text/css" />
-</%def>
+</%block>
diff --git a/templates/pages/cats.mako b/templates/pages/cats.mako
index 87fa3e9..0f71921 100644
--- a/templates/pages/cats.mako
+++ b/templates/pages/cats.mako
@@ -12,11 +12,11 @@
</form>
<input id="new" name="n-" style="display:none;" />
-<%def name="heading()">
+<%block name="heading">
Kategorien
-</%def>
+</%block>
-<%def name="js()">
+<%block name="js">
${parent.js()}
<script type="text/javascript" src=${"/static/js/cats.js" | url}></script>
-</%def>
+</%block>
diff --git a/templates/pages/const.mako b/templates/pages/const.mako
index f1ce192..acb672b 100644
--- a/templates/pages/const.mako
+++ b/templates/pages/const.mako
@@ -33,6 +33,6 @@
context.write(self.right_arrow(*create(p)))
%>
-<%def name="heading()">
+<%block name="heading">
Konstante Kosten
-</%def>
+</%block>
diff --git a/templates/pages/constadd.mako b/templates/pages/constadd.mako
index 6b6a98f..9b7df64 100644
--- a/templates/pages/constadd.mako
+++ b/templates/pages/constadd.mako
@@ -9,6 +9,6 @@
<input type="submit" />
</form>
-<%def name="heading()">
+<%block name="heading">
Füge neue konstante Ausgabe hinzu
-</%def>
+</%block>
diff --git a/templates/pages/constedit.mako b/templates/pages/constedit.mako
index 91aa1d8..618df2e 100644
--- a/templates/pages/constedit.mako
+++ b/templates/pages/constedit.mako
@@ -1,5 +1,5 @@
<%inherit file="constadd.mako" />
-<%def name="heading()">
+<%block name="heading">
Konstante Ausgabe bearbeiten
-</%def>
+</%block>
diff --git a/templates/pages/constlist.mako b/templates/pages/constlist.mako
index 02ff5aa..8446641 100644
--- a/templates/pages/constlist.mako
+++ b/templates/pages/constlist.mako
@@ -16,6 +16,6 @@
% endfor
</ul>
-<%def name="heading()">
+<%block name="heading">
Konstante Kosten
-</%def>
+</%block>
diff --git a/templates/pages/edit.mako b/templates/pages/edit.mako
index a6f5815..37c93dd 100644
--- a/templates/pages/edit.mako
+++ b/templates/pages/edit.mako
@@ -1,5 +1,5 @@
<%inherit file="add.mako" />
-<%def name="heading()">
+<%block name="heading">
Bearbeite Kosteneintrag
-</%def>
+</%block>
diff --git a/templates/pages/show.mako b/templates/pages/show.mako
index 565a518..a255fa9 100644
--- a/templates/pages/show.mako
+++ b/templates/pages/show.mako
@@ -38,22 +38,22 @@ ${self.left_arrow(date, date)}
${self.right_arrow(date, date)}
% endif
-<%def name="heading()">
+<%block name="heading">
% if len(exps) > 1:
Aktuelle Kosten
% else:
Kosten für ${get_d(exps[0])}
% endif
-</%def>
+</%block>
<%def name="get_d(e)">
${e.date.year}/${e.date.month}
</%def>
-<%def name="js()">
+<%block name="js">
${parent.js()}
<script type="text/javascript" src=${"/static/js/show.js" | url}></script>
-</%def>
+</%block>
<%def name="detail(name, sum, set, color=None)">
<div class="detail">
diff --git a/templates/root.mako b/templates/root.mako
index b05e7fd..19ac4ac 100644
--- a/templates/root.mako
+++ b/templates/root.mako
@@ -2,10 +2,15 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- ${self.js()}
+ <%block name="js">
+ <script type="text/javascript" src=${"/static/js/jquery-1.4.2.js" | url}></script>
+ <script type="text/javascript" src=${"/static/js/lib.js" | url}></script>
+ </%block>
<link rel="shortcut icon" href=${"/static/images/currency.png" | url} type="image/icon">
- <title>${self.title()}</title>
- ${self.style()}
+ <title><%block name="title">Kostenverwaltung</%block></title>
+ <%block name="style">
+ <link href=${"/static/css/style.css" | url} rel="stylesheet" type="text/css" />
+ </%block>
</head>
<body>
@@ -18,7 +23,14 @@
<div id="header">
<div id="menu">
- ${self.menu()}
+ <%block name="menu">
+ <%namespace file="menu.mako" name="m" />
+ <ul>
+ % for uri, page in m.attr.menu:
+ <li><a href=${uri | url}>${page}</a></li>
+ % endfor
+ </ul>
+ </%block>
</div>
</div>
</div>
@@ -30,39 +42,13 @@
<div style="clear: both;"></div>
</div>
<div id="footer">
- <p id="legal">
- ${self.footer()}
- </p>
+ <%block name="footer">
+ <p id="legal">
+ powered by <a href="http://www.makotemplates.org">mako</a> &amp; <a href="http://www.webpy.org">web.py</a> |
+ © 2010-2011. All Rights Reserved. René Neumann |
+ with the help of <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.
+ </p>
+ </%block>
</div>
</body>
</html>
-
-## functions
-
-<%def name="title()">
- Kostenverwaltung
-</%def>
-
-<%def name="style()">
- <link href=${"/static/css/style.css" | url} rel="stylesheet" type="text/css" />
-</%def>
-
-<%def name="js()">
- <script type="text/javascript" src=${"/static/js/jquery-1.4.2.js" | url}></script>
- <script type="text/javascript" src=${"/static/js/lib.js" | url}></script>
-</%def>
-
-<%def name="footer()">
- powered by <a href="http://www.makotemplates.org">mako</a> &amp; <a href="http://www.webpy.org">web.py</a> |
- © 2010-2011. All Rights Reserved. René Neumann |
- with the help of <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.
-</%def>
-
-<%def name="menu()">
- <%namespace file="menu.mako" name="m" />
- <ul>
- % for uri, page in m.attr.menu:
- <li><a href=${uri | url}>${page}</a></li>
- % endfor
- </ul>
-</%def>