nazev branche splnen
This commit is contained in:
parent
833893f233
commit
0724030bef
4 changed files with 75 additions and 1 deletions
34
personalni/static/personalni/jak_se_dozvedeli.css
Normal file
34
personalni/static/personalni/jak_se_dozvedeli.css
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
28
personalni/templates/personalni/jak_se_dozvedeli.html
Normal file
28
personalni/templates/personalni/jak_se_dozvedeli.html
Normal 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%}
|
||||||
|
|
||||||
|
|
|
@ -33,4 +33,11 @@ urlpatterns = [
|
||||||
name='stari_organizatori'
|
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'
|
||||||
|
)
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -34,7 +34,7 @@ from various.autentizace.utils import posli_reset_hesla
|
||||||
|
|
||||||
from django.forms.models import model_to_dict
|
from django.forms.models import model_to_dict
|
||||||
|
|
||||||
from .models import Organizator
|
from .models import Organizator, Osoba
|
||||||
|
|
||||||
|
|
||||||
def aktivniOrganizatori(datum=timezone.now()):
|
def aktivniOrganizatori(datum=timezone.now()):
|
||||||
|
@ -62,6 +62,11 @@ class CojemamOrganizatoriStariView(generic.ListView):
|
||||||
id__in=aktivniOrganizatori()
|
id__in=aktivniOrganizatori()
|
||||||
).order_by('-organizuje_do')
|
).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):
|
def obalkyView(request, resitele):
|
||||||
if len(resitele) == 0:
|
if len(resitele) == 0:
|
||||||
|
|
Loading…
Reference in a new issue