{% extends "core/base.jinja" %} {% from 'core/macros.jinja' import user_profile_link %} {% block title %} {% if object %} {% trans %}Edit news{% endtrans %} {% else %} {% trans %}Create news{% endtrans %} {% endif %} {% endblock %} {% block content %} {% if object %}

{% trans %}Edit news{% endtrans %}

{% else %}

{% trans %}Create news{% endtrans %}

{% endif %}
{% csrf_token %} {{ form.non_field_errors() }}
{{ form.title.errors }} {{ form.title.label_tag() }} {{ form.title }}
{{ form.club.errors }} {{ form.club.label_tag() }} {{ form.club.help_text }} {{ form.club }}
{{ form.date_form.non_field_errors() }}
{# startDate is used to dynamically ensure end_date >= start_date, whatever the value of start_date #}
{{ form.date_form.start_date.errors }} {{ form.date_form.start_date.label_tag() }} {{ form.date_form.start_date.help_text }} {{ form.date_form.start_date|add_attr("x-model=startDate") }}
{{ form.date_form.end_date.errors }} {{ form.date_form.end_date.label_tag() }} {{ form.date_form.end_date.help_text }} {{ form.date_form.end_date|add_attr(":min=startDate") }}
{# lower to convert True and False to true and false #}
{{ form.date_form.is_weekly|add_attr("x-model=isWeekly") }}
{{ form.date_form.is_weekly.label_tag() }} {{ form.date_form.is_weekly.help_text }}
{{ form.date_form.occurrences.label_tag() }} {{ form.date_form.occurrences.help_text }} {{ form.date_form.occurrences }}
{{ form.summary.errors }} {{ form.summary.label_tag() }} {{ form.summary.help_text }} {{ form.summary }}
{{ form.content.errors }} {{ form.content.label_tag() }} {{ form.content.help_text }} {{ form.content }}
{% if user.is_root or user.is_com_admin %}
{{ form.auto_publish.errors }} {{ form.auto_publish }} {{ form.auto_publish.label_tag() }}
{% endif %}

{% endblock %}