finish styling html code, make country fully work

This commit is contained in:
koksnuss 2020-04-29 10:34:57 +02:00
parent 683f926ed6
commit 83b59f4f04
7 changed files with 20 additions and 32 deletions

View File

@ -1,20 +1,14 @@
{% include "base.html" %} {% include "header.html" with title=country.name %} <table>
{% block content %}
<table>
<thead> <thead>
<tr> <tr>
<th colspan="10"> <th colspan="12">
<a name="{{ country.name_iso }}"></a> <a name="{{ country.name_iso }}"></a>
<img class="country" src="/static/coinc/images/{{ country.name_iso}}.png" /> <img class="country" src="/static/coinc/images/{{ country.name_iso}}.png" />
<a href="{% url 'coinc:country' country.name_iso %}">{{ country.name }}</a>{% if country.comment %} - {{ country.comment }}{% endif %} <a href="{% url 'coinc:country' country.name_iso %}">{{ country.name }}</a>{% if country.comment %} - {{ country.comment }}{% endif %}
</th> </th>
<th colspan="2"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for year in country.years %} {% for year in country.years %}{% show_year country year %}{% endfor %} </tbody>
{% show_year country year %}
{% endfor %}
</tbody>
</table> </table>
{% endblock %} {% include "footer.html" %}

View File

@ -1,5 +1,4 @@
{% extends "base.html" %} {% include "header.html" with title="Münzsammlung" %}
{% block content %}
{% if countrys %} {% if countrys %}
{% show_navigation countrys %} {% show_navigation countrys %}
{% for country in countrys %} {% for country in countrys %}
@ -7,4 +6,4 @@
{% endfor %} {% endfor %}
{% else %} {% else %}
<p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %} <p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %}
{% endblock %} {% include "footer.html" %}

View File

@ -1,13 +1,6 @@
{% for stamp in year %} {% for stamp in year %} <tr>
<tr>
<td class="year"><div class="">{{ stamp }}{{ year_int }}</div></td> <td class="year"><div class="">{{ stamp }}{{ year_int }}</div></td>
{% for value in values %} {% for value in values %}{% show_coin country year_int stamp value %}{% endfor %} </tr>{% endfor %}{% ifnotequal year|length 1 %}
{% show_coin country year_int stamp value %}
{% endfor %}
</tr>
{% endfor %}
{% ifnotequal year|length 1 %}
<tr> <tr>
<td class="spacer" colspan="12"></td> <td class="spacer" colspan="12"></td>
</tr> </tr>{% endifnotequal %}
{% endifnotequal %}

View File

@ -0,0 +1,2 @@
</body>
</html>

View File

@ -22,11 +22,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Münzsammlung</title> {% load static %} <title>{{ title }}</title> {% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'coinc/bootstrap.min.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'coinc/bootstrap.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'coinc/styles.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'coinc/styles.css' %}">
</head> </head>
<body> <body>
{% block content %}{% endblock %}
</body>
</html>

View File

@ -43,7 +43,7 @@ def detail_country(request, country):
template = loader.get_template('coinc/country.html') template = loader.get_template('coinc/country.html')
c = Country.objects.get(name_iso=country) c = Country.objects.get(name_iso=country)
return HttpResponse(template.render(show_country(c), request)) return HttpResponse(template.render(show_country(c), request))
# return HttpResponse(template.render("foo", request))
@register.inclusion_tag('coinc/navigation.html') @register.inclusion_tag('coinc/navigation.html')
@ -51,6 +51,7 @@ def show_navigation(countrys):
return {'countrys': countrys} return {'countrys': countrys}
@register.inclusion_tag('coinc/country.html') @register.inclusion_tag('coinc/country.html')
def show_country(country): def show_country(country):
c = { c = {
@ -112,6 +113,7 @@ def show_year(country, year):
} }
@register.inclusion_tag('coinc/coin.html') @register.inclusion_tag('coinc/coin.html')
def show_coin(country, year, stamp, value): def show_coin(country, year, stamp, value):
''' @param country: Country.name_iso ''' @param country: Country.name_iso
@ -130,6 +132,7 @@ def show_coin(country, year, stamp, value):
return { 'coin': coin } return { 'coin': coin }
# TODO # TODO
def statistic(request): def statistic(request):
return HttpResponse('Statistik') return HttpResponse('Statistik')