Aktuální zadání: témata na konec
This commit is contained in:
		
							parent
							
								
									181e9b74e1
								
							
						
					
					
						commit
						b080636baa
					
				
					 2 changed files with 14 additions and 6 deletions
				
			
		|  | @ -10,16 +10,16 @@ | |||
|       {% endif %} | ||||
|       {#TODO a co speciální deadline pro účast na soustředění? #} | ||||
| 
 | ||||
|     {% for sada in problemy %} | ||||
|     {% for sada in jednorazove_problemy %} | ||||
|       {# podnadpisy, kdyz neni zakomentuje se nadpis #} | ||||
|       {% if not sada %}<!--{% endif %} | ||||
|       <h3>{% cycle 'Úlohy' 'Témata' 'Seriál' %}</h3> | ||||
|       <h3>{% cycle 'Úlohy' 'Seriál' %}</h3> | ||||
|       {% if not sada %}-->{% endif %} | ||||
|       {# publikace jednotlivych zadani #} | ||||
|       {% for problem in sada %} | ||||
|         {# TODO použít {{problem.kod_v_rocniku}} ? vrací 4.u1 místo 4.1 #} | ||||
|         <h4>{{problem.cislo_zadani.cislo}}.{{problem.kod}} {{problem.nazev}} | ||||
|           {# nezobrazuj body, pokud nejsou zadane (typicky u temat)#} | ||||
|           {# nezobrazuj body, pokud nejsou zadane #} | ||||
|           {% if problem.body %}({{problem.body}}b){% endif %}</h4> | ||||
|         {% autoescape off %}{{problem.text_zadani}}{% endautoescape %} | ||||
|         <hr> | ||||
|  | @ -28,6 +28,13 @@ | |||
|       Aktuálně nejsou zadané žádné úlohy k řešení. | ||||
|     {% endfor %} | ||||
| 
 | ||||
|     <h3>Témata</h3> | ||||
|     {% for tema in temata %} | ||||
|       <h4>Téma {{tema.kod}}: {{tema.nazev}}</h4> | ||||
|       <a href=""><span style="color:red">Stránka tématu</span></a> | ||||
|       {% autoescape off %}{{tema.text_zadani}}{% endautoescape %} | ||||
|     {% endfor %} | ||||
| 
 | ||||
|   {% endwith %} | ||||
| 
 | ||||
| </div> | ||||
|  |  | |||
|  | @ -16,12 +16,13 @@ def AktualniZadaniView(request): | |||
|     nastaveni = get_object_or_404(Nastaveni) | ||||
|     problemy = Problem.objects.filter(cislo_zadani=nastaveni.aktualni_cislo).filter(stav = 'zadany') | ||||
|     ulohy = problemy.filter(typ = 'uloha') | ||||
|     temata = problemy.filter(typ = 'tema') | ||||
|     serialy = problemy.filter(typ = 'serial') | ||||
|     problemy = [ulohy, temata, serialy] | ||||
|     temata = problemy.filter(typ = 'tema') | ||||
|     jednorazove_problemy = [ulohy, serialy] | ||||
|     return render(request, 'seminar/zadani/AktualniZadani.html', | ||||
|             {'nastaveni': nastaveni, | ||||
|              'problemy': problemy, | ||||
|              'jednorazove_problemy': jednorazove_problemy, | ||||
|              'temata': temata, | ||||
|                 }, | ||||
|             ) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Matěj Kocián
						Matěj Kocián