mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
sf4 resolve errors and depreciations
This commit is contained in:
95
templates/PermissionsGroup/edit.html.twig
Normal file
95
templates/PermissionsGroup/edit.html.twig
Normal file
@@ -0,0 +1,95 @@
|
||||
{% extends 'ChillMainBundle::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 %}
|
41
templates/PermissionsGroup/index.html.twig
Normal file
41
templates/PermissionsGroup/index.html.twig
Normal file
@@ -0,0 +1,41 @@
|
||||
{% extends 'ChillMainBundle::Admin/layout_permissions.html.twig' %}
|
||||
|
||||
{% block title %}{{ 'Permissions group list'|trans }}{% endblock %}
|
||||
|
||||
{% block admin_content -%}
|
||||
<h1>{{ 'Permissions group list'|trans }}</h1>
|
||||
|
||||
<table class="records_list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'Name'|trans }}</th>
|
||||
<th>{{ 'Actions'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td><a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}">{{ entity.name }}</a></td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('admin_permissionsgroup_show', { 'id': entity.id }) }}" class="sc-button bt-see">{{ 'See'|trans }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">{{ 'Edit'|trans }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('admin_permissionsgroup_new') }}" class="sc-button bt-create">
|
||||
{{ 'Create a new permissions group'| trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
23
templates/PermissionsGroup/new.html.twig
Normal file
23
templates/PermissionsGroup/new.html.twig
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends 'ChillMainBundle::Admin/layout_permissions.html.twig' %}
|
||||
|
||||
{% block title %}{{ 'New permission group'|trans }}{% endblock %}
|
||||
|
||||
{% block admin_content -%}
|
||||
<h1>{{ 'New permission group'|trans }}</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_row(form.name) }}
|
||||
{% if form.flags is defined %}
|
||||
{{ form_row(form.flags) }}
|
||||
{% endif %}
|
||||
{{ form_row(form.submit, { 'attr': { 'class': 'sc-button green' } } ) }}
|
||||
{{ form_end(form) }}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('admin_permissionsgroup') }}">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
72
templates/PermissionsGroup/show.html.twig
Normal file
72
templates/PermissionsGroup/show.html.twig
Normal file
@@ -0,0 +1,72 @@
|
||||
{% extends 'ChillMainBundle::Admin/layout_permissions.html.twig' %}
|
||||
|
||||
{% block title %}{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}{% endblock %}
|
||||
|
||||
{% block admin_content -%}
|
||||
<h1>{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}</h1>
|
||||
|
||||
<table class="record_properties">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{{ 'Name'|trans }}</th>
|
||||
<td>{{ entity.name }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% if role_scopes_sorted|length > 0 %}
|
||||
<h2>{{ 'Grant those permissions'|trans }} :</h2>
|
||||
|
||||
{% 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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for role_scope in role_scopes %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ role_scope.role|trans }}
|
||||
{% 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 -%}
|
||||
{{ role_scope.scope.name|localize_translatable_string }}
|
||||
{%- else -%}
|
||||
<em>N/A</em>
|
||||
{%- endif -%}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endfor %}
|
||||
|
||||
{% else %}
|
||||
|
||||
<p>{{ 'This group does not provide any permission'|trans }}.
|
||||
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}">
|
||||
{{ 'add permissions'|trans|capitalize }}</a></p>
|
||||
{% endif %}
|
||||
|
||||
<ul class="record_actions">
|
||||
|
||||
<li>
|
||||
<a href="{{ path('admin_permissionsgroup_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">
|
||||
{{ 'Edit'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('admin_permissionsgroup') }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user