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" %}
{% block content %}
<table>
{% include "header.html" with title=country.name %} <table>
<thead>
<tr>
<th colspan="10">
<th colspan="12">
<a name="{{ country.name_iso }}"></a>
<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 %}
</th>
<th colspan="2"></th>
</tr>
</thead>
<tbody>
{% for year in country.years %}
{% show_year country year %}
{% endfor %}
</tbody>
{% for year in country.years %}{% show_year country year %}{% endfor %} </tbody>
</table>
{% endblock %}
{% include "footer.html" %}

View File

@ -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 %}
<p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %}
{% endblock %}
{% include "footer.html" %}

View File

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

View File

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

View File

@ -22,11 +22,8 @@
<head>
<meta charset="utf-8">
<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/styles.css' %}">
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

View File

@ -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')