diff --git a/design/mockup/gulasch_bulma.sass b/design/mockup/gulasch_bulma.sass index 1cf811c..89cd563 100644 --- a/design/mockup/gulasch_bulma.sass +++ b/design/mockup/gulasch_bulma.sass @@ -13,3 +13,9 @@ $primary: #e60000 background-position: center .categorie margin: 0.5vw + +.less-margin + margin-top: -2.5rem + +.tab-body + padding-left: 1vw diff --git a/roms/templates/roms/details.html b/roms/templates/roms/details.html new file mode 100644 index 0000000..b8f7ee4 --- /dev/null +++ b/roms/templates/roms/details.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} + +{% load static %} + + +{% block title %}{{rom.name}}{% endblock %} +{% block nav_rom_class %}is-active{% endblock %} + + +{% block content %} +
+
+
+
+

{{rom.name}}

+ +
+
+ {% for tag in rom.tags.all %} + {{tag.name}} + {% endfor %} +

+ {{rom.description|linebreaks}} +

+ +
+ Hier könnte eine Anleitung stehen. +
+ +
+
+ +
+
+
+
+
+
+{% endblock %} diff --git a/roms/templates/roms/list.html b/roms/templates/roms/list.html index f832ffe..97a0f85 100644 --- a/roms/templates/roms/list.html +++ b/roms/templates/roms/list.html @@ -24,7 +24,7 @@
{% for rom in roms %}
- +

{{ rom.name }}

diff --git a/roms/urls.py b/roms/urls.py index 9703cd8..acb6b31 100644 --- a/roms/urls.py +++ b/roms/urls.py @@ -1,12 +1,13 @@ from django.conf.urls import include, url -from roms.views import RomListJson, RomDetailViewJson, RomList +from roms.views import RomListJson, RomDetailViewJson, RomList, RomDetailView urlpatterns = [ url(r'^json/list/$', RomListJson.as_view()), url(r'^json/list/(?P[a-zA-Z0-9-]+)/$', RomListJson.as_view()), url(r'^json/details/(?P[0-9]+)/$', RomDetailViewJson.as_view()), - url(r'^list/$', RomList.as_view(), name='romlist'), - url(r'^list/(?P[a-zA-Z0-9-]+)/$', RomList.as_view(), name='romlist') + url(r'^list/$', RomList.as_view(), name = 'romlist'), + url(r'^list/(?P[a-zA-Z0-9-]+)/$', RomList.as_view(), name = 'romlist'), + url(r'^details/(?P[0-9]+)/$', RomDetailView.as_view(), name = 'romdetails') ] diff --git a/roms/views.py b/roms/views.py index 47497fa..17ff793 100644 --- a/roms/views.py +++ b/roms/views.py @@ -31,6 +31,16 @@ class RomList(ListView): return context +class RomDetailView(DetailView): + pk_url_kwarg = 'id' + template_name = 'roms/details.html' + context_object_name = 'rom' + + def get_queryset(self): + queryset = Rom.objects.all().filter(approved = True) + return queryset + + class RomListJson(ListView): def get_queryset(self): @@ -63,9 +73,12 @@ class RomListJson(ListView): class RomDetailViewJson(DetailView): - model = Rom pk_url_kwarg = 'id' + def get_queryset(self): + queryset = Rom.objects.all().filter(approved = True) + return queryset + def render_to_response(self, context, **response_kwargs): rom = self.get_object() return JsonResponse(rom.to_json(), **response_kwargs, safe=False) diff --git a/static/css/gulasch_bulma.css b/static/css/gulasch_bulma.css index 919cb12..688629d 100644 --- a/static/css/gulasch_bulma.css +++ b/static/css/gulasch_bulma.css @@ -4282,3 +4282,9 @@ label.panel-block { background-repeat-background-position: center; } .rom-overview .categorie { margin: 0.5vw; } +.less-margin { + margin-top: -2.5rem; +} +.tab-body { + padding-left: 1vw; +}