diff --git a/coinmanager/coinc/templates/coinc/coin.html b/coinmanager/coinc/templates/coinc/coin.html index 3a5113c..25c6b16 100644 --- a/coinmanager/coinc/templates/coinc/coin.html +++ b/coinmanager/coinc/templates/coinc/coin.html @@ -1 +1 @@ -
{% if coin.found_by %}x{% endif %}
+
{% if coin.found_by %}x{% endif %}
diff --git a/coinmanager/coinc/templates/coinc/country.html b/coinmanager/coinc/templates/coinc/country.html index a1c72b3..2d39c1f 100644 --- a/coinmanager/coinc/templates/coinc/country.html +++ b/coinmanager/coinc/templates/coinc/country.html @@ -1,20 +1,14 @@ - {% include "base.html" %} - {% block content %} - +{% include "header.html" with title=country.name %}
- - - {% for year in country.years %} - {% show_year country year %} - {% endfor %} - +{% for year in country.years %}{% show_year country year %}{% endfor %}
+ {{ country.name }}{% if country.comment %} - {{ country.comment }}{% endif %}
- {% endblock %} +{% include "footer.html" %} diff --git a/coinmanager/coinc/templates/coinc/index.html b/coinmanager/coinc/templates/coinc/index.html index 04d2704..f72a885 100644 --- a/coinmanager/coinc/templates/coinc/index.html +++ b/coinmanager/coinc/templates/coinc/index.html @@ -1,5 +1,4 @@ - {% extends "base.html" %} - {% block content %} +{% include "header.html" with title="Münzsammlung" %} {% if countrys %} {% show_navigation countrys %} {% for country in countrys %} @@ -7,4 +6,4 @@ {% endfor %} {% else %}

Trage zuerst Länder im Adminbereich ein.

{% endif %} - {% endblock %} + {% include "footer.html" %} diff --git a/coinmanager/coinc/templates/coinc/year.html b/coinmanager/coinc/templates/coinc/year.html index f6bde03..68b16cf 100644 --- a/coinmanager/coinc/templates/coinc/year.html +++ b/coinmanager/coinc/templates/coinc/year.html @@ -1,13 +1,6 @@ - {% for stamp in year %} - -
{{ stamp }}{{ year_int }}
- {% for value in values %} - {% show_coin country year_int stamp value %} - {% endfor %} - - {% endfor %} - {% ifnotequal year|length 1 %} - - - - {% endifnotequal %} +{% for stamp in year %} +
{{ stamp }}{{ year_int }}
+{% for value in values %}{% show_coin country year_int stamp value %}{% endfor %} {% endfor %}{% ifnotequal year|length 1 %} + + + {% endifnotequal %} diff --git a/coinmanager/coinc/templates/footer.html b/coinmanager/coinc/templates/footer.html new file mode 100644 index 0000000..b605728 --- /dev/null +++ b/coinmanager/coinc/templates/footer.html @@ -0,0 +1,2 @@ + + diff --git a/coinmanager/coinc/templates/base.html b/coinmanager/coinc/templates/header.html similarity index 90% rename from coinmanager/coinc/templates/base.html rename to coinmanager/coinc/templates/header.html index ec98645..3ce3f21 100644 --- a/coinmanager/coinc/templates/base.html +++ b/coinmanager/coinc/templates/header.html @@ -22,11 +22,8 @@ - Münzsammlung {% load static %} + {{ title }} {% load static %} - {% block content %}{% endblock %} - - diff --git a/coinmanager/coinc/views.py b/coinmanager/coinc/views.py index def3459..f914b17 100644 --- a/coinmanager/coinc/views.py +++ b/coinmanager/coinc/views.py @@ -43,7 +43,7 @@ def detail_country(request, country): template = loader.get_template('coinc/country.html') c = Country.objects.get(name_iso=country) return HttpResponse(template.render(show_country(c), request)) -# return HttpResponse(template.render("foo", request)) + @register.inclusion_tag('coinc/navigation.html') @@ -51,6 +51,7 @@ def show_navigation(countrys): return {'countrys': countrys} + @register.inclusion_tag('coinc/country.html') def show_country(country): c = { @@ -112,6 +113,7 @@ def show_year(country, year): } + @register.inclusion_tag('coinc/coin.html') def show_coin(country, year, stamp, value): ''' @param country: Country.name_iso @@ -130,6 +132,7 @@ def show_coin(country, year, stamp, value): return { 'coin': coin } + # TODO def statistic(request): return HttpResponse('Statistik')