Galerie: drobné úpravy
This commit is contained in:
		
							parent
							
								
									b8d1ef420a
								
							
						
					
					
						commit
						fea69385fd
					
				
					 5 changed files with 69 additions and 37 deletions
				
			
		|  | @ -104,7 +104,7 @@ class Obrazek(models.Model): | ||||||
|                               datum_int[3], datum_int[4], datum_int[5]) |                               datum_int[3], datum_int[4], datum_int[5]) | ||||||
|     jmeno = os.path.basename(self.obrazek_velky.file.name) |     jmeno = os.path.basename(self.obrazek_velky.file.name) | ||||||
|     if not self.obrazek_stredni: |     if not self.obrazek_stredni: | ||||||
|       Obrazek._vyrobMiniaturu(original, jmeno, 600, self.obrazek_stredni) |       Obrazek._vyrobMiniaturu(original, jmeno, 1024, self.obrazek_stredni) | ||||||
|     if not self.obrazek_maly: |     if not self.obrazek_maly: | ||||||
|       Obrazek._vyrobMiniaturu(original, jmeno, 200, self.obrazek_maly) |       Obrazek._vyrobMiniaturu(original, jmeno, 200, self.obrazek_maly) | ||||||
|     super(Obrazek, self).save() |     super(Obrazek, self).save() | ||||||
|  |  | ||||||
|  | @ -1,12 +1,13 @@ | ||||||
| {% extends "galerie/Base.html" %} | {% extends "galerie/Base.html" %} | ||||||
| 
 | 
 | ||||||
| {% block title %}{% block nadpis1a %} | {% block nadpis1a %} | ||||||
| {{galerie.nazev}} | Galerie | {{galerie.nazev}}: {{ obrazek.popis | default:"Fotka" }} | ||||||
| {% endblock %}{% endblock %} | {% endblock %} | ||||||
| 
 | 
 | ||||||
| {% block content %} | {% block content %} | ||||||
|   <div id="popis"> |   <h2>{{ obrazek.nazev }}</h2> | ||||||
|     <h2><a title="Zpět na náhled fotek" href="../#obsah">{{galerie.nazev}}</a></h2> |   <div id="nahoru"> | ||||||
|  |     <a title="Zpět do galerie" href="../#obsah">Zpět na: {{galerie.nazev}}</a> | ||||||
|   </div> |   </div> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -15,23 +16,27 @@ | ||||||
|     {% if obrazky_predchozi %} |     {% if obrazky_predchozi %} | ||||||
|       {% with obrazky_predchozi|last as predchozi_obrazek %} |       {% with obrazky_predchozi|last as predchozi_obrazek %} | ||||||
|         <div> |         <div> | ||||||
|           <a title="Předchozí" class="predchozi_obrazek" href="../{{predchozi_obrazek.pk}}#popis"></a> |           <a title="Předchozí" class="predchozi_obrazek" href="../{{predchozi_obrazek.pk}}#nahoru"></a> | ||||||
|         </div> |         </div> | ||||||
|       {% endwith %} |       {% endwith %} | ||||||
|     {% endif%} |     {% endif%} | ||||||
|     <img src={{obrazek.obrazek_stredni.url}} |     <img src="{{obrazek.obrazek_stredni.url}}" | ||||||
|          height="{{vyska}}" |          height="{{vyska}}" | ||||||
|          width="{{sirka}}" |          width="{{sirka}}" | ||||||
|          alt="{{obrazek.popis}}" |          alt="{{obrazek.popis}}" | ||||||
|          class="obrazek"> |          class="obrazek"> | ||||||
|  |           | ||||||
|     {% if obrazky_dalsi %} |     {% if obrazky_dalsi %} | ||||||
|       {% with obrazky_dalsi|first as dalsi_obrazek %} |       {% with obrazky_dalsi|first as dalsi_obrazek %} | ||||||
|         <div> |         <div> | ||||||
|           <a title="Další" class="dalsi_obrazek" href="../{{dalsi_obrazek.pk}}#popis"></a> |           <a title="Další" class="dalsi_obrazek" href="../{{dalsi_obrazek.pk}}#nahoru"></a> | ||||||
|         </div> |         </div> | ||||||
|       {% endwith %} |       {% endwith %} | ||||||
|     {% endif%} |     {% endif%} | ||||||
|   </div> |   </div> | ||||||
|  |   {# <div> #} | ||||||
|  |   {#  <a href="{{ obrazek.obrazek_velky.url }}">Obrázek v plné velikosti</a> #} | ||||||
|  |   {# </div> #} | ||||||
| 
 | 
 | ||||||
|   {# Popisek fotky #} |   {# Popisek fotky #} | ||||||
|   <div class="popis"> |   <div class="popis"> | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| {% extends "galerie/Base.html" %} | {% extends "galerie/Base.html" %} | ||||||
| 
 | 
 | ||||||
| {% block title %}{% block nadpis1a %} | {% block nadpis1a %} | ||||||
| {{galerie.nazev}} | Galerie TODO title | Galerie {{galerie.nazev}} | ||||||
| {% endblock %}{% endblock %} | {% endblock %} | ||||||
| 
 | 
 | ||||||
| {% block content %} | {% block content %} | ||||||
|   <h2>{{galerie.nazev}}</h2> |   <h2>{{galerie.nazev}}</h2> | ||||||
|  | @ -10,20 +10,33 @@ | ||||||
|   {# podgalerie #} |   {# podgalerie #} | ||||||
|   {% if podgalerie or galerie.galerie_up %} |   {% if podgalerie or galerie.galerie_up %} | ||||||
|     <h3> PODGALERIE </h3> |     <h3> PODGALERIE </h3> | ||||||
|     <ul> |  | ||||||
|     {% if galerie.galerie_up %} |     {% if galerie.galerie_up %} | ||||||
|       <li><a href="../{{galerie.galerie_up.pk}}">..</a> |       <a href="../{{galerie.galerie_up.pk}}">..</a> | ||||||
|  |     {% endif %} | ||||||
|  |      | ||||||
|  |     {% if podgalerie %} | ||||||
|  |       <div class="galerie_nahledy"> | ||||||
|  |       {% for galerie in podgalerie %} | ||||||
|  |         <div class="podgalerie_nahled"> | ||||||
|  |           {% if galerie.zobrazit < 1 or user.is_staff %} | ||||||
|  |             {% with galerie.titulni_obrazek.obrazek_maly as obrazek %} | ||||||
|  |             <a href="../{{galerie.pk}}"><img src="{{ obrazek.url }}" | ||||||
|  |               width={% widthratio obrazek.width 200 167 %} | ||||||
|  |               height={% widthratio obrazek.height 200 167 %} /></a> | ||||||
|  |             {% endwith %} | ||||||
|  |            <div> | ||||||
|  |               <a href="../{{ galerie.pk }}">{{ galerie }}</a> | ||||||
|  |            </div> | ||||||
|  |          {#  {% if user.is_staff and galerie.zobrazit > 0 %} #} | ||||||
|  |          {#    ({{galerie.poradi}}) #} | ||||||
|  |          {#    <span class="plus"><a href="plus/{{galerie.pk}}/">+</a></span> #} | ||||||
|  |          {#    <span class="minus"><a href="minus/{{galerie.pk}}/">-</a></span> #} | ||||||
|  |          {#  {% endif %} #} | ||||||
|  |           {% endif %} | ||||||
|  |         </div> | ||||||
|  |       {% endfor %} | ||||||
|  |       </div> | ||||||
|     {% endif %} |     {% endif %} | ||||||
|     {% for galerie in podgalerie %} |  | ||||||
|       {% if galerie.zobrazit < 1 or user.is_staff %} |  | ||||||
|       <li><a href="../{{galerie.pk}}">{{galerie}}</a> |  | ||||||
|         {% if user.is_staff and galerie.zobrazit > 0 %} |  | ||||||
|           ({{galerie.poradi}}) |  | ||||||
|           <span class="plus"><a href="plus/{{galerie.pk}}/">+</a></span> |  | ||||||
|           <span class="minus"><a href="minus/{{galerie.pk}}/">-</a></span> |  | ||||||
|         {% endif %} |  | ||||||
|       {% endif %} |  | ||||||
|     {% endfor %} |  | ||||||
|   </ul> |   </ul> | ||||||
|   {% endif %} |   {% endif %} | ||||||
|   {% if user.is_staff and galerie.zobrazit > 0 %} |   {% if user.is_staff and galerie.zobrazit > 0 %} | ||||||
|  | @ -38,7 +51,7 @@ | ||||||
|     {% for obrazek in obrazky %} |     {% for obrazek in obrazky %} | ||||||
|         <div class="galerie_nahled"> |         <div class="galerie_nahled"> | ||||||
|           <span class="vystredeno"></span> |           <span class="vystredeno"></span> | ||||||
|           <a title="Zobrazit tuto fotografii" href="./{{obrazek.pk}}#popis"> |           <a title="Zobrazit tuto fotografii" href="./{{obrazek.pk}}#nahoru"> | ||||||
|           <img |           <img | ||||||
|             src="{{obrazek.obrazek_maly.url}}" |             src="{{obrazek.obrazek_maly.url}}" | ||||||
|             width={% widthratio obrazek.obrazek_maly.width 200 167 %} |             width={% widthratio obrazek.obrazek_maly.width 200 167 %} | ||||||
|  |  | ||||||
|  | @ -35,8 +35,8 @@ def nahled(request, pk, soustredeni): | ||||||
| 
 | 
 | ||||||
| def detail(request, pk, fotka, soustredeni): | def detail(request, pk, fotka, soustredeni): | ||||||
|   """Zobrazeni nahledu fotky s id 'fotka'.""" |   """Zobrazeni nahledu fotky s id 'fotka'.""" | ||||||
|   MAX_VYSKA = 600 |   MAX_VYSKA = 900 | ||||||
|   MAX_SIRKA = 600 |   MAX_SIRKA = 900 | ||||||
|   MAX_VYSKA_MALA = 100 |   MAX_VYSKA_MALA = 100 | ||||||
|   MAX_SIRKA_MALA = 200 |   MAX_SIRKA_MALA = 200 | ||||||
|   NAHLEDU = 1 |   NAHLEDU = 1 | ||||||
|  |  | ||||||
|  | @ -467,26 +467,30 @@ div.zadani_azad_termin { | ||||||
|   background-repeat: no-repeat; |   background-repeat: no-repeat; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .galerie{ | .galerie { | ||||||
|   position: relative; |   position: relative; | ||||||
|   text-align: center; |   text-align: center; | ||||||
|   width: 630px; |   /*width: 100%;*/ | ||||||
|   margin: 0 auto 0 auto; |   margin: 0 auto 0 auto; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .galerie h2{ | .galerie h2 { | ||||||
|   text-align: center; |   text-align: center; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .popis{ | .popis { | ||||||
|   text-align: center; |  | ||||||
|   margin: 10px 10px 30px 10px; |   margin: 10px 10px 30px 10px; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | #nahoru { | ||||||
|  |   text-align: center; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| .galerie_nahledy{ | .galerie_nahledy{ | ||||||
|   /*margin: 1em 0;*/ |   /*margin: 1em 0;*/ | ||||||
|   margin: 0 auto 0 auto; |   margin: 0 auto 0 auto; | ||||||
|   text-align: center; |   text-align: center; | ||||||
|  |   overflow: auto; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .galerie_nahledy img{ | .galerie_nahledy img{ | ||||||
|  | @ -499,15 +503,18 @@ div.zadani_azad_termin { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .galerie_nahled{ /* frame */ | .galerie_nahled{ /* frame */ | ||||||
|  |   position: relative; | ||||||
|   float: left; |   float: left; | ||||||
|   width: 190px; |   width: 200px; | ||||||
|   height: 190px; |   height: 200px; | ||||||
|   text-align: center; |   text-align: center; | ||||||
|   border: solid; |   border: solid; | ||||||
|   border-width: 2px; |   border-width: 2px; | ||||||
|   border-radius: 5px; |   border-radius: 5px; | ||||||
|   border-color: #ffa500; |   /*border-color: #ffa500;*/ | ||||||
|   background-color: #ffb52d; |   border-color: #ffd546; | ||||||
|  |   /*background-color: #ffb52d;*/ | ||||||
|  |   background-color: white; | ||||||
|   white-space: nowrap; |   white-space: nowrap; | ||||||
|   margin: 10px; |   margin: 10px; | ||||||
| } | } | ||||||
|  | @ -518,13 +525,20 @@ div.zadani_azad_termin { | ||||||
|   vertical-align: middle; |   vertical-align: middle; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .galerie_nahled img{ | .galerie_nahled img { | ||||||
|   border-radius: 2px; |   border-radius: 2px; | ||||||
|   vertical-align: middle; |   vertical-align: middle; | ||||||
|   max-height: 180px; |   max-height: 180px; | ||||||
|   max-width: 180px; |   max-width: 180px; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | .galerie_nahled div { | ||||||
|  |     position: absolute; | ||||||
|  |     bottom: 0px; | ||||||
|  |     width: 100%; | ||||||
|  |     text-align: center; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| /* titulni stranka */ | /* titulni stranka */ | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Matěj Kocián
						Matěj Kocián