etud_photo_orig_page: modernise code

This commit is contained in:
Emmanuel Viennet 2024-06-21 19:13:53 +02:00
parent 569c09d66d
commit d92924701b
2 changed files with 13 additions and 15 deletions

View File

@ -564,7 +564,7 @@ def fiche_etud(etudid=None):
%(etat_civil)s
<span>%(email_link)s</span>
</td><td class="photocell">
<a href="etud_photo_orig_page?etudid=%(etudid)s">%(etudfoto)s</a>
<a href="etud_photo_orig_page/%(etudid)s">%(etudfoto)s</a>
</td></tr></table>
"""
+ situation_template

View File

@ -1018,23 +1018,21 @@ sco_publish("/get_photo_image", sco_photos.get_photo_image, Permission.ScoView)
sco_publish("/etud_photo_html", sco_photos.etud_photo_html, Permission.ScoView)
@bp.route("/etud_photo_orig_page")
@bp.route("/etud_photo_orig_page/<int:etudid>")
@scodoc
@permission_required(Permission.ScoView)
@scodoc7func
def etud_photo_orig_page(etudid=None):
def etud_photo_orig_page(etudid):
"Page with photo in orig. size"
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
H = [
html_sco_header.sco_header(page_title=etud["nomprenom"]),
"<h2>%s</h2>" % etud["nomprenom"],
'<div><a href="%s">'
% url_for("scolar.fiche_etud", scodoc_dept=g.scodoc_dept, etudid=etudid),
sco_photos.etud_photo_orig_html(etud),
"</a></div>",
html_sco_header.sco_footer(),
]
return "\n".join(H)
etud = Identite.get_etud(etudid)
return f"""{
html_sco_header.sco_header(etudid=etud.id, page_title=etud.nomprenom)
}
<h2>{etud.nomprenom}</h2>
<div>
<a href="{etud.url_fiche()}">{etud.photo_html(size='orig')}</a>
</div>
{html_sco_header.sco_footer()}
"""
@bp.route("/form_change_photo", methods=["GET", "POST"])