seminar | Pridana stranka s odmenami
This commit is contained in:
		
							parent
							
								
									159901e19d
								
							
						
					
					
						commit
						5be7209d58
					
				
					 3 changed files with 42 additions and 0 deletions
				
			
		
							
								
								
									
										15
									
								
								seminar/templates/seminar/archiv/odmeny.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								seminar/templates/seminar/archiv/odmeny.html
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | ||||||
|  | {% extends "base.html" %} | ||||||
|  | 
 | ||||||
|  | {% block content %} | ||||||
|  |   <h1> | ||||||
|  |     {% block nadpis1a %}{% block nadpis1b %} | ||||||
|  |       Odměny {{ cislo }} | ||||||
|  |     {% endblock %}{% endblock %} | ||||||
|  |   </h1> | ||||||
|  |   <ul> | ||||||
|  | 	  {% for z in zmeny %} | ||||||
|  | 	  <li> {{z.jmeno}}: {{z.ftitul}} → {{z.ttitul}}</li> | ||||||
|  | 	  {% endfor %} | ||||||
|  |   </ul>  | ||||||
|  | 
 | ||||||
|  | {% endblock content %} | ||||||
|  | @ -15,6 +15,7 @@ urlpatterns = [ | ||||||
| 	# Archiv | 	# Archiv | ||||||
| 	path('archiv/rocniky/', views.ArchivView.as_view(), name="seninar_archiv_rocniky"), | 	path('archiv/rocniky/', views.ArchivView.as_view(), name="seninar_archiv_rocniky"), | ||||||
| 	path('archiv/temata/', views.ArchivTemataView.as_view(), name="seninar_archiv_temata"), | 	path('archiv/temata/', views.ArchivTemataView.as_view(), name="seninar_archiv_temata"), | ||||||
|  | 	path('archiv/odmeny/<int:fcislo>/<int:tcislo>/', views.OdmenyView.as_view(), name="seminar_archiv_odmeny"), | ||||||
| 
 | 
 | ||||||
| 	path('rocnik/<int:rocnik>/', views.RocnikView.as_view(), name='seminar_rocnik'), | 	path('rocnik/<int:rocnik>/', views.RocnikView.as_view(), name='seminar_rocnik'), | ||||||
| 	path('cislo/<int:rocnik>.<str:cislo>/', views.CisloView.as_view(), name='seminar_cislo'), | 	path('cislo/<int:rocnik>.<str:cislo>/', views.CisloView.as_view(), name='seminar_cislo'), | ||||||
|  |  | ||||||
|  | @ -1123,6 +1123,32 @@ class ArchivTemataView(generic.ListView): | ||||||
| 			ctx['rocniky'][rocnik] = list(temata) | 			ctx['rocniky'][rocnik] = list(temata) | ||||||
| 		return ctx | 		return ctx | ||||||
| 
 | 
 | ||||||
|  | class OdmenyView(generic.TemplateView): | ||||||
|  | 	template_name = 'seminar/archiv/odmeny.html' | ||||||
|  | 
 | ||||||
|  | 	def get_context_data(self, **kwargs): | ||||||
|  | 		context = super().get_context_data(**kwargs) | ||||||
|  | 		fromcislo_id = self.kwargs.get('fcislo') | ||||||
|  | 		tocislo_id = self.kwargs.get('tcislo') | ||||||
|  | 		fromcislo = Cislo.objects.get(pk=fromcislo_id) | ||||||
|  | 		tocislo = Cislo.objects.get(pk=tocislo_id) | ||||||
|  | 		resitele = aktivniResitele(tocislo) | ||||||
|  | 		frombody = body_resitelu(resitele, fromcislo) | ||||||
|  | 		tobody = body_resitelu(resitele, tocislo) | ||||||
|  | 		outlist = [] | ||||||
|  | 		for (aid, tbody) in tobody.items(): | ||||||
|  | 			fbody = frombody.get(aid,0) | ||||||
|  | 			resitel = Resitel.objects.get(pk=aid) | ||||||
|  | 			ftitul = resitel.get_titul(fbody) | ||||||
|  | 			ttitul = resitel.get_titul(tbody) | ||||||
|  | 			if ftitul != ttitul: | ||||||
|  | 				outlist.append({'jmeno': resitel.osoba.plne_jmeno(), 'ftitul': ftitul, 'ttitul': ttitul}) | ||||||
|  | 		context['zmeny'] = outlist | ||||||
|  | 		return context | ||||||
|  | 		 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| ### Generovani vysledkovky | ### Generovani vysledkovky | ||||||
| 
 | 
 | ||||||
| class CisloVysledkovkaView(CisloView): | class CisloVysledkovkaView(CisloView): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue