Tag pro odkazy na poslání mailu #22
					 2 changed files with 8 additions and 1 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| {% extends "base.html" %} | ||||
| {% load static %} | ||||
| {% load deadliny %} | ||||
| {% load mail %} | ||||
| 
 | ||||
| {% block content %} | ||||
| 
 | ||||
|  | @ -14,7 +15,10 @@ | |||
| 
 | ||||
| {% if edit %} | ||||
|   <p>Řešitelé: | ||||
|     {% for r in object.resitele.all %}{{ r }} (<a href="mailto:{{ r.osoba.email }}?subject={{ "Oprava řešení M&M " | urlencode }}{{ object.problem.all.0.hlavni_problem | urlencode }}">{{ r.osoba.email }}</a>){% if forloop.revcounter0 != 0 %}, {% endif %}{% endfor %} | ||||
|   {% for r in object.resitele.all %} | ||||
|     {{ r }} | ||||
|     ({% maillink r.osoba.email to=r.osoba.email subject=mailsubject %}){% if forloop.revcounter0 != 0 %}, {% endif %} | ||||
|   {% endfor %} | ||||
|   </p> | ||||
| {% else %} | ||||
|   <p>Řešitelé: {{ object.resitele.all | join:", " }}</p> | ||||
|  |  | |||
|  | @ -237,6 +237,9 @@ class DetailReseniView(DetailView): | |||
| 		ctx = super().get_context_data(**kw) | ||||
| 		detaily_hodnoceni = self.aktualni_hodnoceni() | ||||
| 		ctx["hodnoceni"] = detaily_hodnoceni | ||||
| 
 | ||||
| 		# Subject případného mailu (template neumí použitelně spojovat řetězce: https://stackoverflow.com/q/4386168) | ||||
| 		ctx["mailsubject"] = "Oprava řešení M&M "+self.reseni.problem.first().hlavni_problem.nazev | ||||
| 		return ctx | ||||
| 
 | ||||
| 	def get(self, request, *args, **kwargs): | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue