mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
96 lines
3.2 KiB
Twig
96 lines
3.2 KiB
Twig
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
|
|
|
|
{% block title %}{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}{% endblock %}
|
|
|
|
{% block admin_content -%}
|
|
<h1>{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}</h1>
|
|
|
|
<h2>{{ 'Details'|trans }}</h2>
|
|
|
|
{{ form_start(edit_form) }}
|
|
{{ form_row(edit_form.name) }}
|
|
{% if edit_form.flags is defined %}
|
|
{{ form_row(edit_form.flags) }}
|
|
{% endif %}
|
|
{{ form_row(edit_form.submit, { 'attr': { 'class': 'sc-button green' } } ) }}
|
|
{{ form_end(edit_form) }}
|
|
|
|
<h2>{{ 'Grant those permissions'|trans }} :</h2>
|
|
|
|
{%- if entity.getRoleScopes|length > 0 -%}
|
|
{% for title, role_scopes in role_scopes_sorted %}
|
|
|
|
<h3>{{ title|default("Unclassified")|trans }}</h3>
|
|
|
|
<table class="striped rounded">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ 'Role'|trans }}</th>
|
|
<th>{{ 'Circle'|trans }}</th>
|
|
<th>{{ 'Actions'|trans }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
{% for role_scope in role_scopes %}
|
|
<tr>
|
|
<td>
|
|
<span class="role_scope role">{{ role_scope.role|trans }}</span>
|
|
{% if expanded_roles[role_scope.role]|length > 1 %}
|
|
<br/>
|
|
<small>{{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %}</small>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{%- if role_scope.scope is not null -%}
|
|
<span class="role_scope scope">
|
|
{{ role_scope.scope.name|localize_translatable_string }}
|
|
</span>
|
|
{%- else -%}
|
|
<em>N/A</em>
|
|
{%- endif -%}
|
|
</td>
|
|
<td>
|
|
{{ form_start(delete_role_scopes_form[role_scope.id]) }}
|
|
{{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'sc-button red' } } ) }}
|
|
{{ form_end(delete_role_scopes_form[role_scope.id]) }}
|
|
</td>
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endfor %}
|
|
|
|
{%- else -%}
|
|
<p>{{ 'This group does not provide any permission'|trans }}</p>
|
|
{%- endif -%}
|
|
|
|
<h2>{{ 'Grant new permissions'|trans }}</h2>
|
|
|
|
{{ form_start(add_role_scopes_form) }}
|
|
{{ form_errors(add_role_scopes_form) }}
|
|
{{ form_row(add_role_scopes_form.composed_role_scope.role) }}
|
|
{{ form_row(add_role_scopes_form.composed_role_scope.scope) }}
|
|
|
|
<ul class="record_actions">
|
|
<li>
|
|
{{ form_row(add_role_scopes_form.submit, { 'attr' : { 'class': 'sc-button bt-create' } } ) }}
|
|
</li>
|
|
<li>
|
|
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="sc-button bt-see">{{ 'Cancel'|trans }}</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ path('admin_permissionsgroup') }}" class="sc-button bt-cancel">
|
|
{{ 'Back to the list'|trans }}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
{{ form_end(add_role_scopes_form) }}
|
|
|
|
|
|
|
|
{% endblock %}
|