Galerie: úpravy vzhledu a mam-org-only bloků
This commit is contained in:
		
							parent
							
								
									d289d165ef
								
							
						
					
					
						commit
						1f0ba770b3
					
				
					 3 changed files with 66 additions and 43 deletions
				
			
		|  | @ -6,6 +6,10 @@ Galerie {{galerie.nazev}} | |||
| 
 | ||||
| {% block content %} | ||||
| 
 | ||||
|   {% if galerie.zobrazit > 0 %} | ||||
|     <div class="mam-org-only"> | ||||
|   {% endif %} | ||||
| 
 | ||||
|   <h2> | ||||
|     {% for g in cesta %} | ||||
|       {% if not forloop.last %} | ||||
|  | @ -19,7 +23,7 @@ Galerie {{galerie.nazev}} | |||
|   {% if not obrazky %} | ||||
|    <div class="galerie_hlavicka"> | ||||
|     {% if galerie.titulni_obrazek %} | ||||
|       <img src="{{ galerie.titulni_obrazek.obrazek_stredni.url }}" style="border: 1px solid black;"> | ||||
|       <img src="{{ galerie.titulni_obrazek.obrazek_stredni.url }}" class="titulni_obrazek"> | ||||
|     {% endif %} | ||||
|    </div> | ||||
|   {% endif %} | ||||
|  | @ -45,8 +49,8 @@ Galerie {{galerie.nazev}} | |||
|             {% if galerie.titulni_obrazek %} | ||||
|             {% with galerie.titulni_obrazek.obrazek_maly as obrazek %} | ||||
|             <img src="{{ obrazek.url }}" | ||||
|                 width="{{ obrazek.width }}" | ||||
|                 height="{{ obrazek.height }}" /> | ||||
|                 width="{% widthratio obrazek.width 167 obrazek.width %}" | ||||
|                 height="{% widthratio obrazek.width 167 obrazek.height %}" /> | ||||
|             {% endwith %} | ||||
|             {% endif %} | ||||
|             <div> | ||||
|  | @ -103,4 +107,9 @@ Galerie {{galerie.nazev}} | |||
|       </div> | ||||
|     {% endif %} | ||||
|   {% endif %} | ||||
| 
 | ||||
|   {% if galerie.zobrazit > 0 %} | ||||
|     </div> {# mam-org-only #} | ||||
|   {% endif %} | ||||
| 
 | ||||
| {% endblock content %} | ||||
|  |  | |||
|  | @ -18,6 +18,15 @@ body { | |||
|   border: orange 2px dashed; | ||||
| } | ||||
| 
 | ||||
| .mam-org-only .mam-org-only { | ||||
|     border: 0px; | ||||
| } | ||||
| 
 | ||||
| li.mam-org-only { | ||||
|     padding: 3px 0px; | ||||
|     margin: -2px 0px; | ||||
| } | ||||
| 
 | ||||
| table .border-r { | ||||
|   border-right: solid 1px; | ||||
| } | ||||
|  | @ -446,7 +455,8 @@ div.zadani_azad_termin { | |||
| /* galerie */ | ||||
| 
 | ||||
| /* velká fotka */ | ||||
| .galerie .obrazek { | ||||
| /* zmenšování spolu s oknem prohlížeče */ | ||||
| .galerie .obrazek, .titulni_obrazek { | ||||
|     max-width: 100%; | ||||
|     height: auto; | ||||
|     width: auto\9; /* ie8 */ | ||||
|  | @ -482,7 +492,6 @@ div.zadani_azad_termin { | |||
| .galerie { | ||||
|   position: relative; | ||||
|   text-align: center; | ||||
|   /*width: 100%;*/ | ||||
|   margin: 20px auto 0 auto; | ||||
| } | ||||
| 
 | ||||
|  | @ -503,6 +512,11 @@ div.zadani_azad_termin { | |||
|   text-align: center; | ||||
| } | ||||
| 
 | ||||
| /* titulní obrázek hlavní galerie soustředění */ | ||||
| .titulni_obrazek { | ||||
|     border: 1px solid black; | ||||
| } | ||||
| 
 | ||||
| .galerie_nahledy{ | ||||
|   /*margin: 1em 0;*/ | ||||
|   margin: 0 auto 30px auto; | ||||
|  |  | |||
|  | @ -21,47 +21,44 @@ | |||
|   {# Projdi vsechna soustredeni #} | ||||
|   {% for soustredeni in object_list %} | ||||
|     {# Kdyz je verejne -> zobraz #} | ||||
|     {% if soustredeni.verejne_db or user.is_authenticated %} | ||||
|       {% if not soustredeni.verejne_db and user.is_authenticated %} | ||||
|         Groups of user: {{user.groups.all}} <br> | ||||
|         <!-- TODO pri prihlasovani ucastniku dodelat prava | ||||
|         jen na group org ve view --> | ||||
|         Toto soustředění není veřejné, vidíte ho jen proto, | ||||
|         že jste přihlášení. <br> | ||||
|     {% if soustredeni.verejne_db or user.is_staff %} | ||||
|       {% if not soustredeni.verejne_db and user.is_staff %} | ||||
|         <div class="mam-org-only"> | ||||
|         <!--Groups of user: {{user.groups.all}} <br>--> | ||||
|       {% endif %} | ||||
|       {# misto soustredeni TODO upravit#} | ||||
|         <h2> | ||||
| 	  {{soustredeni.get_typ_display}}  | ||||
| 	  {{soustredeni.misto}} | ||||
|         </h2> | ||||
| 	<ul> | ||||
| 	<li> | ||||
| 		{{soustredeni.datum_zacatku}} – {{soustredeni.datum_konce}} | ||||
| 	</li> | ||||
|   {# Zobrazeni odkazu na galerie #} | ||||
|   {% if soustredeni.galerie_set.all %} | ||||
|     {% for galerie in soustredeni.galerie_set.all %} | ||||
|       {% if galerie.zobrazit == 0 or user.is_staff %} | ||||
|       <h2> | ||||
| 	    {{soustredeni.get_typ_display}} | ||||
| 	    {{soustredeni.misto}} | ||||
|       </h2> | ||||
|       <ul> | ||||
|         <li> | ||||
|           <a href="../{{soustredeni.pk}}/fotogalerie/{{galerie.pk}}">Fotogalerie</a> | ||||
|           {# TODO kdyz je titulni obrazek, tak asi i titulni obrazek #} | ||||
|           {{soustredeni.datum_zacatku}} – {{soustredeni.datum_konce}} | ||||
|         </li> | ||||
|       {% endif %} | ||||
|     {% endfor %} | ||||
|   {% endif %} | ||||
| 	</ul> | ||||
|   {% if user.is_staff %} | ||||
|     <div class="mam-org-only"> | ||||
|       <a href="../{{soustredeni.pk}}/fotogalerie/0/new/">Vytvořit novou fotogalerii</a><br> | ||||
|       <a href="../{{soustredeni.pk}}/obalky.pdf">Vygenerovat obálky pro účastníky</a> | ||||
|     </div> | ||||
|   {% endif %} | ||||
| 
 | ||||
| 
 | ||||
|         {# popis soustredeni #} | ||||
|         {% if soustredeni.text %} | ||||
|           {% autoescape off %}{{soustredeni.text}}{% endautoescape %} | ||||
|         {# Zobrazeni odkazu na galerie #} | ||||
|         {% if soustredeni.galerie_set.all %} | ||||
|           {% for galerie in soustredeni.galerie_set.all %} | ||||
|             {% if galerie.zobrazit == 0 or user.is_staff %} | ||||
|               <li {% if galerie.zobrazit > 0 and user.is_staff %}class="mam-org-only"{% endif %}> | ||||
|                 <a href="../{{soustredeni.pk}}/fotogalerie/{{galerie.pk}}">Fotogalerie</a> | ||||
|                 {# TODO kdyz je titulni obrazek, tak asi i titulni obrazek #} | ||||
|               </li> | ||||
|             {% endif %} | ||||
|           {% endfor %} | ||||
|         {% endif %} | ||||
|       </ul> | ||||
|       {% if user.is_staff %} | ||||
|         <div class="mam-org-only"> | ||||
|           <a href="../{{soustredeni.pk}}/fotogalerie/0/new/">Vytvořit novou fotogalerii</a><br> | ||||
|           <a href="../{{soustredeni.pk}}/obalky.pdf">Vygenerovat obálky pro účastníky</a> | ||||
|         </div> | ||||
|       {% endif %} | ||||
| 
 | ||||
| 
 | ||||
|       {# popis soustredeni #} | ||||
|       {% if soustredeni.text %} | ||||
|         {% autoescape off %}{{soustredeni.text}}{% endautoescape %} | ||||
|       {% endif %} | ||||
|       {% if user.is_authenticated %} | ||||
|         {# Účastníci #} | ||||
|         <h3>Soustředění se zúčastnili tito účastníci:</h3> | ||||
|  | @ -73,9 +70,12 @@ | |||
|         {% endfor %} | ||||
|         </ul> | ||||
|       {% endif %} | ||||
|       {% if not soustredeni.verejne_db and user.is_staff %} | ||||
|         </div> {# class="mam-org-only" #} | ||||
|       {% endif %} | ||||
|     {% endif %} | ||||
|   {% empty %} | ||||
|     Žádná soustředění zatím neproběhla! | ||||
|     {% empty %} | ||||
|       Žádná soustředění zatím neproběhla! | ||||
|   {% endfor %} | ||||
| 
 | ||||
| {% endblock %} | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Matěj Kocián
						Matěj Kocián