{#- Admin form to add or edit an edition. typed holds what a refused save sent, when the view shows the form again with the reason flashed above it, so the fields keep what was typed instead of what is stored. The controls the form locks keep showing what is stored. Without typed the fields show the stored edition. -#} {% extends "base_template.html" %} {%- set typed = typed if typed is defined else none %} {%- macro shown(name, stored) -%} {{ typed.get(name, '') if typed is not none else stored }} {%- endmacro %} {% block title %}{{ 'Edit edition' if edition else 'Add edition' }}{% endblock %} {% block content %}

{{ 'Edit edition' if edition else 'Add edition' }}

← Back to editions
{#- A save sent back to the form, by this view or by a feature that checks the save before it, says why here. -#} {% with messages = get_flashed_messages(with_categories=true) %} {% for category, message in messages %}
{{ message }}
{% endfor %} {% endwith %}
Ordinal, 14 for the XIV.
{% if dates_decide_current is defined and dates_decide_current %}
{{ _("No published edition is flagged as current, so the site shows the published one that starts last, and of two that start on the same day the one with the higher number. Your account does not change which one that is.") }}
{% endif %}
Public address, /editions/<slug>.
Shown on the edition page above the programme. HTML allowed.
Poster or cover. Upload it in Media and paste its address.
Where visitors sign up. Empty hides the Register button.
{#- may_flag_current says whether the account may change which edition is current. When it may not, the flag is shown but not sent, and a hidden field sends it as it is, so the save keeps it. A view that does not say keeps the checkbox open. -#} {%- set may_flag = may_flag_current if may_flag_current is defined else true %} {%- set is_current = ('is_current' in typed) if (typed is not none and may_flag) else (edition and edition.is_current) %}
{% if may_flag %} {% else %} {% if is_current %}{% endif %} {% endif %}
Drives the homepage hero and the programme page. Only one at a time.{% if not may_flag %} {{ _("Your account does not change which edition is current.") }}{% endif %}
{#- lock_published says that publishing or unpublishing this edition would change which edition is current, for an account that may not change that. The box is then shown but not sent, and a hidden field sends it as it is, as for the flag. -#} {%- set locked = lock_published is defined and lock_published %} {%- set published = ('published' in typed) if (typed is not none and not locked) else (edition.published if edition else True) %}
{% if locked %} {% if published %}{% endif %} {% else %} {% endif %}
{% if locked %}
{{ _("Publishing or unpublishing this edition changes which edition is current, and your account does not change that.") }}
{% endif %}
{% endblock %}