summaryrefslogtreecommitdiff
path: root/templates/expenses
diff options
context:
space:
mode:
Diffstat (limited to 'templates/expenses')
-rw-r--r--templates/expenses/add.jinja24
-rw-r--r--templates/expenses/edit.jinja14
-rw-r--r--templates/expenses/show.jinja62
3 files changed, 100 insertions, 0 deletions
diff --git a/templates/expenses/add.jinja b/templates/expenses/add.jinja
new file mode 100644
index 0000000..de54de3
--- /dev/null
+++ b/templates/expenses/add.jinja
@@ -0,0 +1,24 @@
+{% extends "layout.jinja" %}
+{% from "macros.jinja" import render_form %}
+
+{% block heading %}
+ Neue Ausgabe hinzufügen
+{% endblock %}
+
+{% block js %}
+ {{ super() }}
+ <script type="text/javascript" src="{{ "jqueryui/jquery-ui-1.8.2.js" | static_url }}"></script>
+ <script type="text/javascript" src="{{ "js/add.js" | static_url }}"></script>
+{% endblock %}
+
+{% block style %}
+ {{ super() }}
+ <link href="{{ "jqueryui/css/ui-darkness/jquery-ui-1.8.2.custom.css" | static_url }}" rel="stylesheet" type="text/css">
+{% endblock %}
+
+{% block content %}
+ <form name="add_expense" method="post">
+ {{ render_form(form) }}
+ <input type="submit" name="changeB">
+ </form>
+{% endblock %}
diff --git a/templates/expenses/edit.jinja b/templates/expenses/edit.jinja
new file mode 100644
index 0000000..c871eb1
--- /dev/null
+++ b/templates/expenses/edit.jinja
@@ -0,0 +1,14 @@
+{% extends "expenses/add.jinja" %}
+{% from "macros.jinja" import render_form %}
+
+{% block heading %}
+ Bearbeite Kosteneintrag
+{% endblock %}
+
+{% block content %}
+ <form name="edit_expense" method="post">
+ {{ render_form(form) }}
+ <input type="submit" name="changeB">
+ <input type="submit" name="deleteB" value="Eintrag löschen" />
+ </form>
+{% endblock %}
diff --git a/templates/expenses/show.jinja b/templates/expenses/show.jinja
new file mode 100644
index 0000000..2643ac4
--- /dev/null
+++ b/templates/expenses/show.jinja
@@ -0,0 +1,62 @@
+{% extends "layout.jinja" %}
+{% from "macros.jinja" import left_arrow, right_arrow, colorize %}
+
+{% block heading %}
+ {% if exps | length > 1 %}
+ Aktuelle Kosten
+ {% else %}
+ Kosten für {{exps[0]|date}}
+ {% endif %}
+{% endblock %}
+
+{% block js %}
+ {{ super() }}
+ <script type="text/javascript" src="{{ "js/show.js" | static_url }}"></script>
+{% endblock %}
+
+{% block content %}
+ {% for e in exps %}
+ {% if exps | length > 1 %}<h2>{{e|date}}</h2>{% endif %}
+ {% for c in e.catexps | sort(attribute="cat.name") %}
+ {% call(exp) detail(name=c.cat.name, sum=c.expense, set=c.all) %}
+ <a href="{{ url_for(".edit", id = exp.id) }}">{{exp.day}}.{{exp.month}}. -- {{exp.description}}: {{exp.expense | eur }}</a>
+ {% endcall %}
+ {% endfor %}
+
+ {% call(exp) detail(name="Constant", sum=e.constsum, set=e.consts) %}
+ <a href="{{ url_for("consts.show", id = exp.id) }}">{{exp.monthly}} -- {{exp.description}}</a>
+ {% endcall %}
+
+ {% call(exp) detail(name="In Summa", sum=e.sum, set=e.all, color="#ff2d2d") %}
+ <a href="{{ url_for(".edit", id = exp.id) }}">{{exp.day}}.{{exp.month}}. -- {{exp.description}}: {{exp.expense | eur}}</a>
+ {% endcall %}
+ <br>
+ {% endfor %}
+
+ {# Note: exps are given _reversed_, i.e. "exps | last" is
+ the _first_ on the timeline #}
+ {% set d = exps | last | prev_date | date %}
+ {{ left_arrow(url_for(".show_date_str", p = d), d) }}
+
+ {% set first = exps | first %}
+ {% if not first is last_date %}
+ {% set d = first | next_date | date %}
+ {{ right_arrow(url_for(".show_date_str", p = d), d) }}
+ {% endif %}
+{% endblock content %}
+
+{% macro detail(name, sum, set, color=None) %}
+ <div class="detail">
+ <img class="mark" src="{{ "images/closed.png" | static_url }}">
+ {% call colorize(fgcolor=color) %}
+ <span class="heading">{{name}}:</span> <span class="sum">{{sum | eur}}</span><br>
+ {% endcall %}
+ <div class="details">
+ <ul>
+ {% for exp in set %}
+ <li class="expense">{{ caller(exp) }}</li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+{% endmacro %}
itle='2009-07-31 17:40:13 +0200'>2009-07-31ui-snapshot: use cgit_{open|close}_filter() to execute compressorsLars Hjemli1-28/+7 2009-07-31Add generic filter/plugin infrastructureLars Hjemli3-0/+62 2009-07-25Add support for mime type registration and lookupLars Hjemli4-5/+45 2009-07-25cgit.h: keep config flags sortedLars Hjemli1-2/+2 2009-07-25cgitrc.5.txt: document 'embedded' and 'noheader'Lars Hjemli1-0/+9 2009-07-25Add support for 'noheader' optionLars Hjemli3-7/+16 2009-07-25cgitrc.5.txt: document 'head-include'Lars Hjemli1-0/+4 2009-07-25ui-blob: return 'application/octet-stream' for binary blobsLars Hjemli1-1/+7 2009-07-25ui-plain: Return 'application/octet-stream' for binary files.Remko Tronçon1-1/+4 2009-06-11use cgit_httpscheme() for atom feedDiego Ongaro2-3/+6 2009-06-11add cgit_httpscheme() -> http:// or https://Diego Ongaro2-0/+12 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli3-0/+6 2009-06-07Add head-include configuration option.Mark Lodato3-1/+6 2009-03-15CGIT 0.8.2.1v0.8.2.1Lars Hjemli1-1/+1 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli2-1/+6 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli1-6/+17 2009-03-15fix segfault when displaying empty blobsEric Wong1-5/+8 2009-02-19Add support for HEAD requestsLars Hjemli2-0/+7 2009-02-19Add support for ETag in 'plain' viewLars Hjemli4-0/+5 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli1-4/+9 2009-02-12Makefile: add doc-related targetsLars Hjemli1-2/+17