Galerie: nezobrazuj neveřejné podgalerie neorgům
This commit is contained in:
parent
8b3073a4f6
commit
6dbd80c2a5
2 changed files with 21 additions and 19 deletions
|
@ -42,28 +42,24 @@ Galerie {{galerie.nazev}}
|
||||||
<div class="galerie_nahledy">
|
<div class="galerie_nahledy">
|
||||||
{% for galerie in podgalerie %}
|
{% for galerie in podgalerie %}
|
||||||
<a href="../{{galerie.pk}}" class="podgalerie_nahled">
|
<a href="../{{galerie.pk}}" class="podgalerie_nahled">
|
||||||
<!--<div class="podgalerie_nahled">-->
|
|
||||||
{% if galerie.zobrazit < 1 or user.is_staff %}
|
|
||||||
{% if galerie.titulni_obrazek %}
|
{% if galerie.titulni_obrazek %}
|
||||||
{% with galerie.titulni_obrazek.obrazek_maly as obrazek %}
|
{% with galerie.titulni_obrazek.obrazek_maly as obrazek %}
|
||||||
<img src="{{ obrazek.url }}"
|
<img src="{{ obrazek.url }}"
|
||||||
width={% widthratio obrazek.width 200 167 %}
|
width={% widthratio obrazek.width 200 167 %}
|
||||||
height={% widthratio obrazek.height 200 167 %} />
|
height={% widthratio obrazek.height 200 167 %} />
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div>
|
<div>
|
||||||
{{ galerie }}
|
{{ galerie }}
|
||||||
</div>
|
|
||||||
<!--</div>-->
|
|
||||||
</a>
|
|
||||||
{% if user.is_staff and galerie.zobrazit > 0 %}
|
|
||||||
<div class="mam-org-only-galerie">
|
|
||||||
({{galerie.poradi}})
|
|
||||||
<span class="plus"><a href="plus/{{galerie.pk}}/">+</a></span>
|
|
||||||
<span class="minus"><a href="minus/{{galerie.pk}}/">-</a></span>
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</a>
|
||||||
{% endif %}
|
{% if user.is_staff and galerie.zobrazit > 0 %}
|
||||||
|
<div class="mam-org-only-galerie">
|
||||||
|
({{galerie.poradi}})
|
||||||
|
<span class="plus"><a href="plus/{{galerie.pk}}/">+</a></span>
|
||||||
|
<span class="minus"><a href="minus/{{galerie.pk}}/">-</a></span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -33,13 +33,19 @@ def cesta_od_korene(g):
|
||||||
def nahled(request, pk, soustredeni):
|
def nahled(request, pk, soustredeni):
|
||||||
"""Zobrazeni nahledu vsech fotek ve skupine."""
|
"""Zobrazeni nahledu vsech fotek ve skupine."""
|
||||||
galerie = get_object_or_404(Galerie, pk=pk)
|
galerie = get_object_or_404(Galerie, pk=pk)
|
||||||
|
|
||||||
podgalerie = Galerie.objects.filter(galerie_up = galerie).order_by('poradi')
|
podgalerie = Galerie.objects.filter(galerie_up = galerie).order_by('poradi')
|
||||||
|
if not request.user.is_staff:
|
||||||
|
podgalerie = podgalerie.filter(zobrazit__lt=1)
|
||||||
|
|
||||||
obrazky = Obrazek.objects.filter(galerie = galerie).order_by('datum')
|
obrazky = Obrazek.objects.filter(galerie = galerie).order_by('datum')
|
||||||
preview = zobrazit(galerie, request)
|
preview = zobrazit(galerie, request)
|
||||||
|
|
||||||
sourozenci = []
|
sourozenci = []
|
||||||
if galerie.galerie_up:
|
if galerie.galerie_up:
|
||||||
sourozenci = galerie.galerie_up.galerie_set.all().order_by('poradi')
|
sourozenci = galerie.galerie_up.galerie_set.all().order_by('poradi')
|
||||||
|
if not request.user.is_staff:
|
||||||
|
sourozenci = sourozenci.filter(zobrazit__lt=1)
|
||||||
|
|
||||||
predchozi = None
|
predchozi = None
|
||||||
nasledujici = None
|
nasledujici = None
|
||||||
|
|
Loading…
Reference in a new issue