Skip to content
Snippets Groups Projects
Commit f28266e2 authored by Martin Mareš's avatar Martin Mareš
Browse files

Diplomy: Možnost stažení standardního pozadí

parent ae315d27
Branches
No related tags found
No related merge requests found
...@@ -269,6 +269,16 @@ def org_cert_file(ct_id: int, cert_type: str, filename: str, user_id: Optional[i ...@@ -269,6 +269,16 @@ def org_cert_file(ct_id: int, cert_type: str, filename: str, user_id: Optional[i
return send_certificate(ct_id, cert_type, filename, user_id) return send_certificate(ct_id, cert_type, filename, user_id)
@app.route('/org/contest/c/<int:ct_id>/certificates/standard-bg.pdf')
def org_certificates_standard_bg(ct_id: int):
ctx = get_context(ct_id=ct_id)
bg = BackgroundType.standard.find_default_background(ctx.round)
if bg is not None:
return send_file(bg, mimetype='application/pdf')
else:
raise werkzeug.exceptions.NotFound()
@app.route('/org/contest/school-results/<int:school_id>/c/<int:ct_id>/certificates/<cert_type>/<filename>') @app.route('/org/contest/school-results/<int:school_id>/c/<int:ct_id>/certificates/<cert_type>/<filename>')
def org_school_results_certs(school_id: int, ct_id: int, cert_type: str, filename: str): def org_school_results_certs(school_id: int, ct_id: int, cert_type: str, filename: str):
sess = db.get_session() sess = db.get_session()
......
...@@ -177,7 +177,8 @@ Pokud je schválíte, po uzavření kola budou dostupné soutěžícím a jejich ...@@ -177,7 +177,8 @@ Pokud je schválíte, po uzavření kola budou dostupné soutěžícím a jejich
{% else %} {% else %}
<p class="help-block"> <p class="help-block">
Zde můžete nahrát obrázek velikosti A4 ve formátu PDF, který se použije jako pozadí diplomu. Zde můžete nahrát obrázek velikosti A4 ve formátu PDF, který se použije jako pozadí diplomu.
K výrobě pozadí se Vám může hodit <a href='https://www.matematickaolympiada.cz/dokumenty-mo'>logo MO nebo JČMF</a>. K výrobě pozadí se Vám může hodit <a href='https://www.matematickaolympiada.cz/dokumenty-mo'>logo MO nebo JČMF</a> a grafika
<a href='{{ ctx.url_for("org_certificates_standard_bg") }}'>standardního pozadí</a>.
</p> </p>
{% endif %} {% endif %}
{% if cset.background_file %} {% if cset.background_file %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment