diff --git a/coinmanager/coinc/templates/coinc/navigation.html b/coinmanager/coinc/templates/coinc/filter_country.html
similarity index 100%
rename from coinmanager/coinc/templates/coinc/navigation.html
rename to coinmanager/coinc/templates/coinc/filter_country.html
diff --git a/coinmanager/coinc/templates/coinc/index.html b/coinmanager/coinc/templates/coinc/index.html
index 7f23ffd..062d27f 100644
--- a/coinmanager/coinc/templates/coinc/index.html
+++ b/coinmanager/coinc/templates/coinc/index.html
@@ -1,19 +1,10 @@
-{% if not showed_header %}
- {% include "header.html" with title="Münzsammlung" %}
- {% url 'bar.html' as showed_header %}
-{% endif %}
-{% if not showed_usernames %}
- {% include 'coinc/username.html' with users=users %}
- {% url 'foo.html' as showed_usernames %}
-{% endif %}
+{% include 'header.html' with title='Münzsammlung' %}
+{% include 'coinc/username.html' with users=users %}
{% if countrys %}
- {% show_navigation countrys %}
+ {% include 'coinc/filter_country.html' with countrys=countrys %}
{% for country in countrys %}
{% show_country country %}
{% endfor %}
{% else %}
Trage zuerst Länder im Adminbereich ein.
{% endif %}
-{% if not showed_footer %}
- {% include "footer.html" with title="Münzsammlung" %}
- {% url 'baz.html' as showed_footer %}
-{% endif %}
+{% include 'footer.html' with title='Münzsammlung' %}
diff --git a/coinmanager/coinc/templates/coinc/username.html b/coinmanager/coinc/templates/coinc/username.html
index 9493a24..1b2d48d 100644
--- a/coinmanager/coinc/templates/coinc/username.html
+++ b/coinmanager/coinc/templates/coinc/username.html
@@ -2,7 +2,7 @@
diff --git a/coinmanager/coinc/urls.py b/coinmanager/coinc/urls.py
index 7b72f86..63c7c22 100644
--- a/coinmanager/coinc/urls.py
+++ b/coinmanager/coinc/urls.py
@@ -25,7 +25,7 @@ from . import views
app_name = 'coinc'
urlpatterns = [
- path('', views.IndexView.as_view(), name='index'),
+ path('', views.index, name='index'),
path('statistik', views.statistic, name='statistic'),
path('', views.detail_country, name='country'),
path('add/user//color/', views.add_user, name='add_user')
diff --git a/coinmanager/coinc/views.py b/coinmanager/coinc/views.py
index 5272f2b..e481b6c 100644
--- a/coinmanager/coinc/views.py
+++ b/coinmanager/coinc/views.py
@@ -17,28 +17,28 @@
# along with this program. If not, see .
-
from json import dumps
from datetime import datetime
from django.http import HttpResponse
from django.template import loader
from django.template.defaultfilters import register
-from django.views import generic
-from django.shortcuts import redirect
from .models import Country, Stamp, Coin, User
+def index(request):
+ ''' index view '''
-class IndexView(generic.ListView):
- template_name = 'coinc/index.html'
- context_object_name = 'countrys'
-
- def get_queryset(self):
- ''' return all countries ordered by name '''
- return Country.objects.order_by('name_iso')
+ template = loader.get_template('coinc/index.html')
+ countrys = Country.objects.order_by('name_iso')
+ users = User.objects.order_by('id')
+ context = {
+ 'countrys': countrys,
+ 'users': users
+ }
+ return HttpResponse(template.render(context, request))
def detail_country(request, country):
@@ -47,13 +47,6 @@ def detail_country(request, country):
return HttpResponse(template.render(show_country(c, single_country=True), request))
-
-@register.inclusion_tag('coinc/navigation.html')
-def show_navigation(countrys):
- return {'countrys': countrys}
-
-
-
@register.inclusion_tag('coinc/country.html')
def show_country(country, single_country=False):
c = {
diff --git a/coinmanager/db.sqlite3 b/coinmanager/db.sqlite3
index d6dbabc..56c6dc6 100644
Binary files a/coinmanager/db.sqlite3 and b/coinmanager/db.sqlite3 differ