0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Extend generic base template for groups edit template

This allows us to reuse the breadcrumbs.
This commit is contained in:
Sage Abdullah 2023-09-12 10:45:56 +01:00
parent 0709c31933
commit 52721613b7
No known key found for this signature in database
GPG Key ID: EB1A33CC51CC0217

View File

@ -1,53 +1,49 @@
{% extends "wagtailadmin/base.html" %}
{% extends "wagtailadmin/generic/base.html" %}
{% load wagtailusers_tags wagtailadmin_tags i18n %}
{% block titletag %}{% trans "Editing" %} {{ group.name }}{% endblock %}
{% block extra_css %}
{{ block.super }}
{{ form_media.css }}
{% endblock %}
{% block content %}
{% trans "Editing" as editing_str %}
{% block main_header %}
{% trans "View users in this group" as users_str %}
{% url 'wagtailusers_groups:users' group.id as group_users_url %}
{% include "wagtailadmin/shared/header.html" with title=editing_str action_icon="user" action_url=group_users_url action_text=users_str subtitle=group.name icon="group" %}
{% include "wagtailadmin/shared/header.html" with title=page_title action_icon="user" action_url=group_users_url action_text=users_str subtitle=page_subtitle icon="group" %}
{% endblock %}
<div class="nice-padding">
<form action="{% url 'wagtailusers_groups:edit' group.id %}" method="POST" novalidate>
{% csrf_token %}
{% block main_content %}
<form action="{% url 'wagtailusers_groups:edit' group.id %}" method="POST" novalidate>
{% csrf_token %}
<div class="fields">
{% block fields %}
{% panel id="name" heading=form.name.label id_for_label=form.name.id_for_label is_required=True %}
{% include "wagtailadmin/shared/field.html" with field=form.name show_label=False %}
{% endpanel %}
{% block extra_fields %}{% endblock extra_fields %}
{% endblock fields %}
<div class="fields">
{% block fields %}
{% panel id="name" heading=form.name.label id_for_label=form.name.id_for_label is_required=True %}
{% include "wagtailadmin/shared/field.html" with field=form.name show_label=False %}
{% endpanel %}
{% block extra_fields %}{% endblock extra_fields %}
{% endblock fields %}
<div>
{% format_permissions permission_bound_field=form.permissions %}
</div>
{% for panel in permission_panels %}
<div>
{{ panel.as_admin_panel }}
</div>
{% endfor %}
<div>
<input type="submit" value="{% trans 'Save' %}" class="button" />
{% if perms.auth.delete_group %}
<a href="{% url 'wagtailusers_groups:delete' group.id %}" class="button no">{% trans "Delete group" %}</a>
{% endif %}
</div>
<div>
{% format_permissions permission_bound_field=form.permissions %}
</div>
</form>
</div>
{% for panel in permission_panels %}
<div>
{{ panel.as_admin_panel }}
</div>
{% endfor %}
<div>
<input type="submit" value="{% trans 'Save' %}" class="button" />
{% if perms.auth.delete_group %}
<a href="{% url 'wagtailusers_groups:delete' group.id %}" class="button no">{% trans "Delete group" %}</a>
{% endif %}
</div>
</div>
</form>
{% endblock %}
{% block extra_js %}