summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2014-12-15 00:44:30 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2014-12-15 00:44:30 +0100
commiteb1886ce939e4268bf0aa43c0de85515cf2a6604 (patch)
tree3e76f504669bd7279e71e877a3714f32fba605b0 /templates
parent887be010bf1aa13580a36e6829b5690e03abfe9a (diff)
downloadkosten-eb1886ce939e4268bf0aa43c0de85515cf2a6604.tar.gz
kosten-eb1886ce939e4268bf0aa43c0de85515cf2a6604.tar.bz2
kosten-eb1886ce939e4268bf0aa43c0de85515cf2a6604.zip
Search function
Diffstat (limited to '')
-rw-r--r--templates/expenses/search.jinja25
-rw-r--r--templates/layout.jinja9
2 files changed, 34 insertions, 0 deletions
diff --git a/templates/expenses/search.jinja b/templates/expenses/search.jinja
new file mode 100644
index 0000000..5cd294b
--- /dev/null
+++ b/templates/expenses/search.jinja
@@ -0,0 +1,25 @@
+{% extends "layout.jinja" %}
+
+{% block heading %}
+ Suchergebnisse
+{% endblock %}
+
+{% block content %}
+
+ {% set year = None %}
+
+ {% for exp in exps %}
+ {% if exp.year != year %}
+ {% if year != None %}</ul>{% endif %}
+ {% set year = exp.year %}
+ <h2>{{ year }}</h2>
+ <ul>
+ {% endif %}
+
+ <li>
+ <a href="{{ url_for(".edit", id = exp.id) }}">{{exp.day}}.{{exp.month}}. -- {{exp.description}}: {{exp.expense | eur }}</a>
+ </li>
+
+ {% endfor %}
+
+{% endblock %}
diff --git a/templates/layout.jinja b/templates/layout.jinja
index b71b6ec..5cb03b8 100644
--- a/templates/layout.jinja
+++ b/templates/layout.jinja
@@ -27,6 +27,15 @@
{% for uri, page in menu %}
<li class="menu-item"><a href="{{ url_for(uri) }}">{{page}}</a></li>
{% endfor %}
+ {% if current_user.is_authenticated() %}
+ <li class="search">
+ <img class="search" src="{{ "images/lupe.png" | static_url }}" alt="Search">
+ <form class="search" method="post" action="{{ url_for("expenses.search") }}">
+ <input type="search" value="" name="search" class="search">
+ <input type="submit" value="" class="search-submit">
+ </form>
+ </li>
+ {% endif %}
</ul>
{% endblock %}
</div>