diff --git a/personalni/static/personalni/jak_se_dozvedeli.css b/personalni/static/personalni/jak_se_dozvedeli.css new file mode 100644 index 00000000..15a47b80 --- /dev/null +++ b/personalni/static/personalni/jak_se_dozvedeli.css @@ -0,0 +1,34 @@ +.seznam { + display: flex; + flex-direction: column; + gap: 0.3em; +} + +.hint { + border: 1px solid #ccc; + padding: 0.3em 1em; + border-radius: 5px; + margin-bottom: 1em; +} + +.osoba { + display: flex; + justify-content: space-between; + gap: 0.5em; + + .uno { + flex: 2; + } + + .dos { + flex: 2; + } + + .tres { + flex: 1; + } + + .grey { + opacity: 0.5; + } +} diff --git a/personalni/templates/personalni/jak_se_dozvedeli.html b/personalni/templates/personalni/jak_se_dozvedeli.html new file mode 100644 index 00000000..6695f94c --- /dev/null +++ b/personalni/templates/personalni/jak_se_dozvedeli.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} + +{% block custom_css %} +{% load static %} + +{% endblock %} + + + +{% block content %} +
+
+
Jméno
+
Jak se dozvěděli
+
Datum registrace
+
+ + {% for osoba in object_list %} +
+
{{ osoba.jmeno }} {{ osoba.prijmeni }}
+
{% if osoba.jak_se_dozvedeli %} {{osoba.jak_se_dozvedeli}} {% else %} NEZADÁNO {% endif %}
+
{{ osoba.datum_registrace }}
+
+ {% endfor %} +
+{% endblock%} + + diff --git a/personalni/urls.py b/personalni/urls.py index c4820b90..1805bbfe 100644 --- a/personalni/urls.py +++ b/personalni/urls.py @@ -33,4 +33,11 @@ urlpatterns = [ name='stari_organizatori' ), + # Zpřístupnění dat z "jak jste se o nás dozvěděli" pro orgy propagace + path( + 'org/propagace/jak-se-dozvedeli/', + org_required(views.JakSeDozvedeliView.as_view()), + name='jak_se_dozvedeli' + ) + ] diff --git a/personalni/views.py b/personalni/views.py index c71ce418..49442c2d 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -34,7 +34,7 @@ from various.autentizace.utils import posli_reset_hesla from django.forms.models import model_to_dict -from .models import Organizator +from .models import Organizator, Osoba def aktivniOrganizatori(datum=timezone.now()): @@ -62,6 +62,11 @@ class CojemamOrganizatoriStariView(generic.ListView): id__in=aktivniOrganizatori() ).order_by('-organizuje_do') +class JakSeDozvedeliView(generic.ListView): + model = Osoba + template_name = 'personalni/jak_se_dozvedeli.html' + queryset = Osoba.objects.order_by('-datum_registrace') + def obalkyView(request, resitele): if len(resitele) == 0: