1
0
forked from ScoDoc/ScoDoc

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 %(etat_civil)s
<span>%(email_link)s</span> <span>%(email_link)s</span>
</td><td class="photocell"> </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> </td></tr></table>
""" """
+ situation_template + 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) 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 @scodoc
@permission_required(Permission.ScoView) @permission_required(Permission.ScoView)
@scodoc7func def etud_photo_orig_page(etudid):
def etud_photo_orig_page(etudid=None):
"Page with photo in orig. size" "Page with photo in orig. size"
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0] etud = Identite.get_etud(etudid)
H = [ return f"""{
html_sco_header.sco_header(page_title=etud["nomprenom"]), html_sco_header.sco_header(etudid=etud.id, page_title=etud.nomprenom)
"<h2>%s</h2>" % etud["nomprenom"], }
'<div><a href="%s">' <h2>{etud.nomprenom}</h2>
% url_for("scolar.fiche_etud", scodoc_dept=g.scodoc_dept, etudid=etudid), <div>
sco_photos.etud_photo_orig_html(etud), <a href="{etud.url_fiche()}">{etud.photo_html(size='orig')}</a>
"</a></div>", </div>
html_sco_header.sco_footer(), {html_sco_header.sco_footer()}
] """
return "\n".join(H)
@bp.route("/form_change_photo", methods=["GET", "POST"]) @bp.route("/form_change_photo", methods=["GET", "POST"])