summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2013-04-11 21:47:56 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2013-04-11 21:47:56 +0200
commit978f1a4999937a56bd3861a219bb2d9082ba5de6 (patch)
tree69a55977f09000e1c867a2c253c7018050951e72 /templates
parent0567318344330295512176569a84afc9748d79c5 (diff)
downloadkosten-978f1a4999937a56bd3861a219bb2d9082ba5de6.tar.gz
kosten-978f1a4999937a56bd3861a219bb2d9082ba5de6.tar.bz2
kosten-978f1a4999937a56bd3861a219bb2d9082ba5de6.zip
404 page in jinja
Diffstat (limited to '')
-rw-r--r--templates/404.jinja9
-rw-r--r--templates/404.mako11
-rw-r--r--templates/page.jinja27
-rw-r--r--templates/page.mako36
-rw-r--r--templates/root.jinja3
5 files changed, 38 insertions, 48 deletions
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 %}
+<p>
+ Sorry - die Seite <i>{{page}}</i> konnte nicht gefunden werden.
+</p>
+{% 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" />
-<p>
- Sorry - die Seite <i>${page}</i> konnte nicht gefunden werden.
-</p>
-
-<%def name="heading()">
- 404 -- Seite nicht gefunden
-</%def>
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) -%}
+ <a id="left" href="{{ url_for(target) }}">
+ <img src="{{ "images/arrow_left.png" | static_url }}">
+ <span class="navdate">{{label}}</span>
+ </a>
+{%- endmacro %}
+
+{% macro right_arrow(target,label) -%}
+ <a id="right" href="{{ url_for(target) }}">
+ <img src="{{ "images/arrow_right.png" | static_url }}">
+ <span class="navdate">{{label}}</span>
+ </a>
+{%- 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()}}</{{tag}}>
+ {% 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
-
-<h1 class="title">
- <%block name="heading"></%block>
-</h1>
-${next.body()}
-
-## functions
-<%def name="left_arrow(target,label)">
- <a id="left" href=${"/%s" % target | url}>
- <img src=${"/static/images/arrow_left.png" | url} />
- <span class="navdate">${label}</span>
- </a>
-</%def>
-
-<%def name="right_arrow(target,label)">
- <a id="right" href=${"/%s" % target | url}>
- <img src=${"/static/images/arrow_right.png" | url} />
- <span class="navdate">${label}</span>
- </a>
-</%def>
-
-<%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()}</${tag}>
- % endif
-</%def>
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 %}
<link rel="shortcut icon" href="{{ "images/currency.png" | static_url }}" type="image/icon">
- <title>{% block title -%}Kostenverwaltung{%- endblock %}</title>
+ <title>{{ title or "Kostenverwaltung" }}</title>
{% block style %}
<link href="{{ "css/style.css" | static_url }}" rel="stylesheet" type="text/css">
{% endblock %}
@@ -39,6 +39,7 @@
<div id="page">
<div class="content">
+ <h1 class="page_heading">{{ heading }}</h1>
{% block content %}{% endblock %}
</div>
<div style="clear: both;"></div>