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"> | ||||
|       {% for galerie in podgalerie %} | ||||
|         <a href="../{{galerie.pk}}" class="podgalerie_nahled"> | ||||
|         <!--<div class="podgalerie_nahled">--> | ||||
|           {% if galerie.zobrazit < 1 or user.is_staff %} | ||||
|             {% if galerie.titulni_obrazek %} | ||||
|               {% with galerie.titulni_obrazek.obrazek_maly as obrazek %} | ||||
|               <img src="{{ obrazek.url }}" | ||||
|                  width={% widthratio obrazek.width 200 167 %} | ||||
|                  height={% widthratio obrazek.height 200 167 %} /> | ||||
|               {% endwith %} | ||||
|             {% with galerie.titulni_obrazek.obrazek_maly as obrazek %} | ||||
|             <img src="{{ obrazek.url }}" | ||||
|                 width={% widthratio obrazek.width 200 167 %} | ||||
|                 height={% widthratio obrazek.height 200 167 %} /> | ||||
|             {% endwith %} | ||||
|             {% endif %} | ||||
|            <div> | ||||
|            {{ 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> | ||||
|             {{ galerie }} | ||||
|             </div> | ||||
|             {% endif %} | ||||
|           {% endif %} | ||||
|         </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> | ||||
|         {% endif %} | ||||
|       {% endfor %} | ||||
|       </div> | ||||
|     {% endif %} | ||||
|  |  | |||
|  | @ -33,13 +33,19 @@ def cesta_od_korene(g): | |||
| def nahled(request, pk, soustredeni): | ||||
|     """Zobrazeni nahledu vsech fotek ve skupine.""" | ||||
|     galerie = get_object_or_404(Galerie, pk=pk) | ||||
| 
 | ||||
|     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') | ||||
|     preview = zobrazit(galerie, request) | ||||
| 
 | ||||
|     sourozenci = [] | ||||
|     if galerie.galerie_up: | ||||
|         sourozenci = galerie.galerie_up.galerie_set.all().order_by('poradi') | ||||
|         if not request.user.is_staff: | ||||
|             sourozenci = sourozenci.filter(zobrazit__lt=1) | ||||
| 
 | ||||
|     predchozi = None | ||||
|     nasledujici = None | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Matěj Kocián
						Matěj Kocián