Nezverejnene novinky se zobrazuji prihlasenym.
This commit is contained in:
parent
606426bb1e
commit
fd03563ad6
2 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
||||||
{% for novinka in object_list %}
|
{% for novinka in object_list %}
|
||||||
{# pripravene div-y na stylovani#}
|
{# pripravene div-y na stylovani#}
|
||||||
<div>
|
<div>
|
||||||
|
{% if not novinka.zverejneno and user.is_authenticated %}
|
||||||
|
<div class="mam-org-only">
|
||||||
|
{% endif %}
|
||||||
|
{% if novinka.zverejneno or user.is_authenticated %}
|
||||||
{# datum #}
|
{# datum #}
|
||||||
<div><b>{{novinka.datum}}</b></div>
|
<div><b>{{novinka.datum}}</b></div>
|
||||||
{# text #}
|
{# text #}
|
||||||
|
@ -25,6 +29,10 @@
|
||||||
{{novinka.autor.last_name}}
|
{{novinka.autor.last_name}}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if not novinka.zverejneno and user.is_authenticated %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor%}
|
{% endfor%}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ def ZadaniAktualniVysledkovkaView(request):
|
||||||
class TitulniStranaView(generic.ListView):
|
class TitulniStranaView(generic.ListView):
|
||||||
model = Novinky
|
model = Novinky
|
||||||
template_name='seminar/titulnistrana.html'
|
template_name='seminar/titulnistrana.html'
|
||||||
queryset = Novinky.objects.filter(zverejneno=True).order_by('-datum')[:5]
|
queryset = Novinky.objects.order_by('-datum')[:5]
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(TitulniStranaView, self).get_context_data(**kwargs)
|
context = super(TitulniStranaView, self).get_context_data(**kwargs)
|
||||||
|
|
Loading…
Reference in a new issue