From 978f1a4999937a56bd3861a219bb2d9082ba5de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Thu, 11 Apr 2013 21:47:56 +0200 Subject: 404 page in jinja --- templates/404.jinja | 9 +++++++++ templates/404.mako | 11 ----------- templates/page.jinja | 27 +++++++++++++++++++++++++++ templates/page.mako | 36 ------------------------------------ templates/root.jinja | 3 ++- 5 files changed, 38 insertions(+), 48 deletions(-) create mode 100644 templates/404.jinja delete mode 100644 templates/404.mako create mode 100644 templates/page.jinja delete mode 100644 templates/page.mako (limited to 'templates') diff --git a/templates/404.jinja b/templates/404.jinja new file mode 100644 index 0000000..c802610 --- /dev/null +++ b/templates/404.jinja @@ -0,0 +1,9 @@ +{% extends "page.jinja" %} +{% set title = "404 -- Seite konnte nicht gefunden werden!" %} +{% set heading = "404 -- Seite nicht gefunden" %} + +{% block content %} +

+ Sorry - die Seite {{page}} konnte nicht gefunden werden. +

+{% endblock %} diff --git a/templates/404.mako b/templates/404.mako deleted file mode 100644 index c8f5cd2..0000000 --- a/templates/404.mako +++ /dev/null @@ -1,11 +0,0 @@ -<%! - title = "404 -- Seite konnte nicht gefunden werden!" -%> -<%inherit file="/page.mako" /> -

- Sorry - die Seite ${page} konnte nicht gefunden werden. -

- -<%def name="heading()"> - 404 -- Seite nicht gefunden - diff --git a/templates/page.jinja b/templates/page.jinja new file mode 100644 index 0000000..e1f8af7 --- /dev/null +++ b/templates/page.jinja @@ -0,0 +1,27 @@ +{% extends "root.jinja" %} + +{# functions #} +{% macro left_arrow(target,label) -%} + + + {{label}} + +{%- endmacro %} + +{% macro right_arrow(target,label) -%} + + + {{label}} + +{%- endmacro %} + +{% macro colorize(fgcolor=None, bgcolor=None, tag='span') -%} + {% if not fgcolor and not bgcolor %} + {{ caller() }} + {% else %} + {% set style = "" %} + {% if fgcolor: %}{% set style = style + " color: " + fgcolor %}{% endif %} + {% if bgcolor: %}{% set style = style + " background: " + bgcolor %}{% endif %} + <{{tag}} style="{{style}}">{{caller()}} + {% endif %} +{% endmacro %} diff --git a/templates/page.mako b/templates/page.mako deleted file mode 100644 index 77d24a2..0000000 --- a/templates/page.mako +++ /dev/null @@ -1,36 +0,0 @@ -<%inherit file="/root.mako" /> - -## content - -

- <%block name="heading"> -

-${next.body()} - -## functions -<%def name="left_arrow(target,label)"> - - - ${label} - - - -<%def name="right_arrow(target,label)"> - - - ${label} - - - -<%def name="colorize(fgcolor=None, bgcolor=None, tag='span')"> - % if fgcolor is None and bgcolor is None: - ${caller.body()} - % else: - <% - style = "" - if fgcolor is not None: style += " color: " + fgcolor - if bgcolor is not None: style += " background: "+ bgcolor - %> - <${tag} style="${style}">${caller.body()} - % endif - diff --git a/templates/root.jinja b/templates/root.jinja index 7debb6a..b17ac92 100644 --- a/templates/root.jinja +++ b/templates/root.jinja @@ -9,7 +9,7 @@ {% endblock %} {% endif %} - {% block title -%}Kostenverwaltung{%- endblock %} + {{ title or "Kostenverwaltung" }} {% block style %} {% endblock %} @@ -39,6 +39,7 @@
+

{{ heading }}

{% block content %}{% endblock %}
-- cgit v1.2.3