From a623647d714495439523c124e7efe517d6c15314 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Tue, 10 Jan 2012 22:54:23 +0100 Subject: Switch to mako blocks --- templates/page.mako | 7 +++-- templates/pages/add.mako | 12 ++++----- templates/pages/cats.mako | 8 +++--- templates/pages/const.mako | 4 +-- templates/pages/constadd.mako | 4 +-- templates/pages/constedit.mako | 4 +-- templates/pages/constlist.mako | 4 +-- templates/pages/edit.mako | 4 +-- templates/pages/show.mako | 8 +++--- templates/root.mako | 60 ++++++++++++++++-------------------------- 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 -

${self.heading()}

+

+ <%block name="heading"> +

${next.body()} ## functions -<%def name="heading()"> - - <%def name="left_arrow(target,label)"> 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 @@ -<%def name="heading()"> +<%block name="heading"> Neue Ausgabe hinzufügen - + -<%def name="js()"> +<%block name="js"> ${parent.js()} - + -<%def name="style()"> +<%block name="style"> ${parent.style()} - + 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 @@ -<%def name="heading()"> +<%block name="heading"> Kategorien - + -<%def name="js()"> +<%block name="js"> ${parent.js()} - + 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 - + 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 @@ -<%def name="heading()"> +<%block name="heading"> Füge neue konstante Ausgabe hinzu - + 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 - + 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 -<%def name="heading()"> +<%block name="heading"> Konstante Kosten - + 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 - + 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 name="get_d(e)"> ${e.date.year}/${e.date.month} -<%def name="js()"> +<%block name="js"> ${parent.js()} - + <%def name="detail(name, sum, set, color=None)">
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 @@ - ${self.js()} + <%block name="js"> + + + - ${self.title()} - ${self.style()} + <%block name="title">Kostenverwaltung</%block> + <%block name="style"> + + @@ -18,7 +23,14 @@
@@ -30,39 +42,13 @@
- -## functions - -<%def name="title()"> - Kostenverwaltung - - -<%def name="style()"> - - - -<%def name="js()"> - - - - -<%def name="footer()"> - powered by mako & web.py | - © 2010-2011. All Rights Reserved. René Neumann | - with the help of Free CSS Templates. - - -<%def name="menu()"> - <%namespace file="menu.mako" name="m" /> - - -- cgit v1.2.3-70-g09d2