nazev branche splnen

This commit is contained in:
ticvac 2025-01-21 20:39:31 +01:00
parent 833893f233
commit 0724030bef
4 changed files with 75 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -0,0 +1,28 @@
{% extends "base.html" %}
{% block custom_css %}
{% load static %}
<link href="{% static 'personalni/jak_se_dozvedeli.css' %}" rel="stylesheet">
{% endblock %}
{% block content %}
<div class="seznam">
<div class="osoba hint">
<div class="uno">Jméno</div>
<div class="dos">Jak se dozvěděli</div>
<div class="tres">Datum registrace</div>
</div>
{% for osoba in object_list %}
<div class="osoba">
<div class="uno">{{ osoba.jmeno }} {{ osoba.prijmeni }}</div>
<div class="dos {% if not osoba.jak_se_dozvedeli %}grey{% endif %}">{% if osoba.jak_se_dozvedeli %} {{osoba.jak_se_dozvedeli}} {% else %} NEZADÁNO {% endif %}</div>
<div class="tres">{{ osoba.datum_registrace }}</div>
</div>
{% endfor %}
</div>
{% endblock%}

View file

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

View file

@ -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: