diff --git a/coinmanager/coinc/templates/coinc/country.html b/coinmanager/coinc/templates/coinc/country.html index 15003c3..8ef0f36 100644 --- a/coinmanager/coinc/templates/coinc/country.html +++ b/coinmanager/coinc/templates/coinc/country.html @@ -1,7 +1,7 @@ - diff --git a/coinmanager/coinc/templates/coinc/index.html b/coinmanager/coinc/templates/coinc/index.html index 4e76dfa..73a53e0 100644 --- a/coinmanager/coinc/templates/coinc/index.html +++ b/coinmanager/coinc/templates/coinc/index.html @@ -22,10 +22,16 @@ Münzsammlung {% load static %} + - {% if countrys %} {% for country in countrys %} -{% show_country country %} {% endfor %} {% else %} + + {% if countrys %} + {% navigation countrys %} + {% for country in countrys %} + {% show_country country %} + {% endfor %} + {% else %}

Trage zuerst Länder im Adminbereich ein.

{% endif %} diff --git a/coinmanager/coinc/templates/coinc/navigation.html b/coinmanager/coinc/templates/coinc/navigation.html new file mode 100644 index 0000000..1c0f659 --- /dev/null +++ b/coinmanager/coinc/templates/coinc/navigation.html @@ -0,0 +1,7 @@ + diff --git a/coinmanager/coinc/views.py b/coinmanager/coinc/views.py index 912ee74..e21e94b 100644 --- a/coinmanager/coinc/views.py +++ b/coinmanager/coinc/views.py @@ -41,6 +41,11 @@ def country(request, country): return HttpResponse(f"Land: {country}") +@register.inclusion_tag('coinc/navigation.html') +def navigation(countrys): + return {'countrys': countrys} + + @register.inclusion_tag('coinc/country.html') def show_country(country): year_now = datetime.now().year
{{ country.name }} + {{ country.name }} x €