{% extends "core/base.jinja" %} {% block additional_js %} {% endblock %} {% block title %} {% trans name=object %}Edit {{ name }}{% endtrans %} {% endblock %} {% macro link_form(form) %}
{{ form.non_field_errors() }}
{{ form.url.label_tag() }} {{ form.url.errors }} {# we change the icon when the user change it and leave the input, or when it is pasted from the clipboard #} {{ form.url|add_attr("x-model.change=url,@paste.prevent=url = $event.clipboardData.getData('text')") }}
{{ form.name.as_field_group() }}
{%- if form.DELETE -%}
{{ form.DELETE.as_field_group() }}
{%- else -%}
{%- endif -%} {{ form.link_type|add_attr(":value=linkType.id") }} {%- for field in form.hidden_fields() -%} {%- if field != form.link_type -%} {{ field }} {%- endif -%} {%- endfor -%}
{% endmacro %} {% 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 those 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[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() }} #} {% do form.fields.pop(field_name) %} {% endfor %}
{% endif %}

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

{% if form.admin_fields %}

{% 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() }}

{% trans %}Club links{% endtrans %}

{{ form.link_formset.management_form }}
{%- for f in form.link_formset.forms -%} {{ link_form(f) }} {%- endfor -%}

{% trans trimmed %} Note: if the icon of one of your links doesn't exist yet, you can ask the info team to add it. {% endtrans %}



{% endblock content %} {% block script %} {% endblock %}