{% extends "core/base.jinja" %} {% block title %} {% trans name=object %}Edit {{ name }}{% endtrans %} {% endblock %} {% block content %}

{% trans name=object %}Edit {{ name }}{% endtrans %}

{% csrf_token %} {{ form.non_field_errors() }} {% if form.admin_fields %} {# If the user is admin, display the admin fields, and explicitly separate them from the non-admin ones, with some help text. Non-admin users will only see the regular form fields, so they don't need thoses explanations #}

{% trans %}Club properties{% endtrans %}

{% trans trimmed %} The following form fields are linked to the core properties of a club. Only admin users can see and edit them. {% endtrans %}

{% for field_name in form.admin_fields %} {% set field = form.pop(field_name) %}
{{ field.errors }} {{ field.label_tag() }} {{ field }}
{# Remove the the admin fields from the form. The remaining non-admin fields will be rendered at once with a simple {{ form.as_p() }} #} {% set _ = form.fields.pop(field_name) %} {% endfor %}

{% trans %}Club informations{% endtrans %}

{% trans trimmed %} The following form fields are linked to the basic description of a club. All board members of this club can see and edit them. {% endtrans %}

{% endif %} {{ form.as_p() }}

{% endblock content %}