seminar | Pridan odkaz na zobrazovani odmen.
This commit is contained in:
		
							parent
							
								
									5be7209d58
								
							
						
					
					
						commit
						ccab1b1bf3
					
				
					 3 changed files with 8 additions and 5 deletions
				
			
		|  | @ -45,6 +45,7 @@ | |||
|           <li><a href="tituly.tex">Tituly (TeX)</a></li> | ||||
|           <li><a href="vysledkovka.tex">Výsledkovka (TeX)</a></li> | ||||
|           <li><a href="obalkovani">Obálkování</a></li> | ||||
| 	  <li><a href="odmeny/{{prevcislo.rocnik.rocnik}}.{{prevcislo.poradi}}/">Odměny</a></li> | ||||
|         </ul> | ||||
|       </div> | ||||
|   {% endif %} | ||||
|  |  | |||
|  | @ -15,7 +15,6 @@ urlpatterns = [ | |||
| 	# Archiv | ||||
| 	path('archiv/rocniky/', views.ArchivView.as_view(), name="seninar_archiv_rocniky"), | ||||
| 	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('cislo/<int:rocnik>.<str:cislo>/', views.CisloView.as_view(), name='seminar_cislo'), | ||||
|  | @ -115,6 +114,10 @@ urlpatterns = [ | |||
| 		org_required(views.ObalkovaniView.as_view()), | ||||
| 		name='seminar_cislo_resitel_obalkovani' | ||||
| 	), | ||||
| 	path( | ||||
| 		'cislo/<int:trocnik>.<str:tcislo>/odmeny/<int:frocnik>.<str:fcislo>/', | ||||
| 		org_required(views.OdmenyView.as_view()), | ||||
| 		name="seminar_archiv_odmeny"), | ||||
| 	path( | ||||
| 		'soustredeni/<int:soustredeni>/obalky.pdf', | ||||
| 		org_required(views.soustredeniObalkyView), | ||||
|  |  | |||
|  | @ -1107,6 +1107,7 @@ class CisloView(generic.DetailView): | |||
| 		context = super(CisloView, self).get_context_data(**kwargs) | ||||
| 
 | ||||
| 		cislo = context['cislo'] | ||||
| 		context['prevcislo'] = Cislo.objects.filter((Q(rocnik__lt=self.object.rocnik) | Q(poradi__lt=self.object.poradi))&Q(rocnik__lte=self.object.rocnik)).first() | ||||
| 		# vrátíme context (aktuálně obsahuje jen věci ohledně výsledkovky | ||||
| 		return vysledkovka_cisla(cislo, context) | ||||
| 
 | ||||
|  | @ -1128,10 +1129,8 @@ class OdmenyView(generic.TemplateView): | |||
| 
 | ||||
| 	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) | ||||
| 		fromcislo = Cislo.objects.get(rocnik=self.kwargs.get('frocnik'), poradi=self.kwargs.get('fcislo')) | ||||
| 		tocislo = Cislo.objects.get(rocnik=self.kwargs.get('trocnik'), poradi=self.kwargs.get('tcislo')) | ||||
| 		resitele = aktivniResitele(tocislo) | ||||
| 		frombody = body_resitelu(resitele, fromcislo) | ||||
| 		tobody = body_resitelu(resitele, tocislo) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue