odmeny jsou pekny #90
					 2 changed files with 15 additions and 3 deletions
				
			
		|  | @ -16,4 +16,11 @@ | |||
| 	  {% endfor %} | ||||
|   </ul> | ||||
| 
 | ||||
|   <h2>Seznam účastníků – červená znamená že jim nechodí fyzické číslo</h2> | ||||
|  | ||||
|   <ul> | ||||
|     {% for resitel in resitele %} | ||||
|       <li {% if resitel.neposilame %}style="color: white; background-color: red;"{% endif %}>{{ resitel.jmeno }}: {% if resitel.bodydiff > 3 %}🧦{% endif %} {% if resitel.ttitul != resitel.ftitul %} {{resitel.ftitul}} → {{resitel.ttitul}} {% endif %}</li> | ||||
| 
				
					
						zelvuska
						commented  CSS? CSS? 
				
					
						ticvac
						commented  Ano, to je css Ano, to je css
 | ||||
|     {% endfor %} | ||||
|   </ul> | ||||
| 
 | ||||
| {% endblock content %} | ||||
|  |  | |||
|  | @ -375,7 +375,8 @@ class OdmenyView(generic.TemplateView): | |||
| 		tocislo = get_object_or_404(Cislo, rocnik=self.kwargs.get('trocnik'), poradi=self.kwargs.get('tcislo')) | ||||
| 		resitele = utils.aktivniResitele(tocislo) | ||||
| 
 | ||||
| 		def get_diff(from_deadline: Deadline, to_deadline: Deadline): | ||||
| 		def get_diff(from_deadline: Deadline, to_deadline: Deadline, probody=False): | ||||
| 
				
					
						zelvuska
						commented  Okomentovat  Okomentovat `probody`! | ||||
| 			"""Co je probody? pokud True, funkce vrací všechny rešitele a k nim potřebné informace, pokud False, vrací jen ty, kteří mají změnu v titulu.""" | ||||
| 			frombody = body_resitelu(resitele=resitele, jen_verejne=False, do=from_deadline) | ||||
| 			tobody = body_resitelu(resitele=resitele, jen_verejne=False, do=to_deadline) | ||||
| 			outlist = [] | ||||
|  | @ -384,8 +385,11 @@ class OdmenyView(generic.TemplateView): | |||
| 				tbody = tobody.get(resitel.id, 0) | ||||
| 				ftitul = resitel.get_titul(fbody) | ||||
| 				ttitul = resitel.get_titul(tbody) | ||||
| 				if ftitul != ttitul: | ||||
| 					outlist.append({'jmeno': resitel.osoba.plne_jmeno(), 'ftitul': ftitul, 'ttitul': ttitul}) | ||||
| 				if probody: | ||||
| 					outlist.append({'jmeno': resitel.osoba.plne_jmeno(), 'fbody': fbody, 'tbody': tbody, 'ftitul': ftitul, 'ttitul': ttitul, 'bodydiff': tbody - fbody, "neposilame": not(resitel.zasilat_cislo_papirove)}) | ||||
| 				else: | ||||
| 					if ftitul != ttitul: | ||||
| 						outlist.append({'jmeno': resitel.osoba.plne_jmeno(), 'ftitul': ftitul, 'ttitul': ttitul}) | ||||
| 			return outlist | ||||
| 
 | ||||
| 		def posledni_deadline_oprava(cislo: Cislo) -> Deadline: | ||||
|  | @ -401,6 +405,7 @@ class OdmenyView(generic.TemplateView): | |||
| 		context["from_deadline"] = from_deadline | ||||
| 		context["to_deadline"] = to_deadline | ||||
| 		context["zmeny"] = get_diff(from_deadline, to_deadline) | ||||
| 		context["resitele"] = get_diff(from_deadline, to_deadline, probody=resitele.order_by("osoba__prijmeni")) | ||||
| 
 | ||||
| 		return context | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	
Tam patří pomlčka (a vůbec, myslím si, že to nemusí být v nadpisu…)