UX: improve admin templates

This commit is contained in:
Mathieu Jaumotte 2023-04-14 12:47:59 +02:00
parent 91ba0c983d
commit 0af13b028e
7 changed files with 22 additions and 23 deletions

View File

@ -27,9 +27,7 @@
</form> </form>
</td> </td>
<td> <td>
<a href="{{ chill_path_add_return_path('chill_crud_docgen_template_edit', { 'id': entity.id }) }}" class="btn btn-edit"> <a href="{{ chill_path_add_return_path('chill_crud_docgen_template_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
{{ 'Edit'|trans }}
</a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@ -5,14 +5,14 @@
{% block admin_content %} {% block admin_content %}
<h1>{{ 'Document category list' | trans }}</h1> <h1>{{ 'Document category list' | trans }}</h1>
<table class="table"> <table class="table table-bordered border-dark align-middle">
<thead> <thead>
<tr> <tr>
<th>{{ 'Creator bundle id' | trans }}</th> <th>{{ 'Creator bundle id' | trans }}</th>
<th>{{ 'Internal id inside creator bundle' | trans }}</th> <th>{{ 'Internal id inside creator bundle' | trans }}</th>
<th>{{ 'Document class' | trans }}</th> <th>{{ 'Document class' | trans }}</th>
<th>{{ 'Name' | trans }}</th> <th>{{ 'Name' | trans }}</th>
<th>{{ 'Actions' | trans }}</th> <th class="w-25">{{ 'Actions' | trans }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -23,7 +23,7 @@
<td>{{ document_category.documentClass }}</td> <td>{{ document_category.documentClass }}</td>
<td>{{ document_category.name | localize_translatable_string}}</td> <td>{{ document_category.name | localize_translatable_string}}</td>
<td> <td class="text-end">
<a href="{{ path('document_category_show', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}" <a href="{{ path('document_category_show', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}"
class="btn btn-show" title="{{ 'show' | trans }}"></a> class="btn btn-show" title="{{ 'show' | trans }}"></a>
<a href="{{ path('document_category_edit', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}" <a href="{{ path('document_category_edit', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}"

View File

@ -1,7 +1,7 @@
{% set formId = crudMainFormId|default('crud_main_form') %} {% set formId = crudMainFormId|default('crud_main_form') %}
{% block crud_content_header %} {% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_edit')|trans }}</h1> <h1 class="mb-5">{{ ('crud.'~crud_name~'.title_edit')|trans }}</h1>
{% endblock crud_content_header %} {% endblock crud_content_header %}
{% block crud_content_form %} {% block crud_content_form %}

View File

@ -14,7 +14,7 @@
{% endblock %} {% endblock %}
{% else %} {% else %}
{% block table_entities %} {% block table_entities %}
<table class="table table-bordered border-dark"> <table class="table table-bordered border-dark align-middle">
<thead> <thead>
<tr> <tr>
{% block table_entities_thead_tr %} {% block table_entities_thead_tr %}

View File

@ -4,7 +4,7 @@
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block crud_content_after_form %} {% block crud_content_after_form %}
{% if access_permissions_group_list %} {% if access_permissions_group_list %}
<h2>{{ 'Permissions granted'|trans }}</h2> <h2 class="mt-5">{{ 'Permissions granted'|trans }}</h2>
{% if entity.groupcenters|length > 0 %} {% if entity.groupcenters|length > 0 %}
<table class="table table-bordered border-dark align-middle mb-5"> <table class="table table-bordered border-dark align-middle mb-5">
@ -28,9 +28,9 @@
{{ groupcenter.center.name }} {{ groupcenter.center.name }}
</span> </span>
</td> </td>
<td> <td class="w-25 text-end">
{{ form_start(delete_groupcenter_form[groupcenter.id]) }} {{ form_start(delete_groupcenter_form[groupcenter.id]) }}
{{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} {{ form_widget(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }}
{{ form_rest(delete_groupcenter_form[groupcenter.id]) }} {{ form_rest(delete_groupcenter_form[groupcenter.id]) }}
{{ form_end(delete_groupcenter_form[groupcenter.id]) }} {{ form_end(delete_groupcenter_form[groupcenter.id]) }}
</td> </td>

View File

@ -69,19 +69,20 @@
</td> </td>
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %}
<li>
<a class="btn btn-chill-blue" href="{{ path('chill_main_homepage', {'_switch_user': entity.username }) }}" title="{{ "Impersonate"|trans|e('html_attr') }}"><i class="fa fa-user-secret"></i></a>
</li>
{% endif %}
<li> <li>
<a class="btn btn-edit" title="{{ 'Edit'|trans }}" href="{{ path('chill_crud_admin_user_edit', { 'id': entity.id }) }}"></a> <a class="btn btn-edit" title="{{ 'Edit'|trans }}" href="{{ path('chill_crud_admin_user_edit', { 'id': entity.id }) }}"></a>
</li> </li>
{% if allow_change_password is same as(true) %} {% if allow_change_password is same as(true) %}
<li> <li>
<a class="btn btn-chill-red" href="{{ path('admin_user_edit_password', { 'id' : entity.id }) }}" title="{{ 'Edit password'|trans|e('html_attr') }}"><i class="fa fa-ellipsis-h"></i></a> <a class="btn btn-reset" href="{{ path('admin_user_edit_password', { 'id' : entity.id }) }}" title="{{ 'Edit password'|trans|e('html_attr') }}"><i class="fa fa-key-modern"></i></a>
</li>
{% endif %}
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %}
<li>
<a class="btn btn-chill-blue" href="{{ path('chill_main_homepage', {'_switch_user': entity.username }) }}" title="{{ "Impersonate"|trans|e('html_attr') }}"><i class="fa fa-user-secret"></i></a>
</li> </li>
{% endif %} {% endif %}
</ul> </ul>

View File

@ -2,14 +2,14 @@
{% block admin_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %} {% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %} {% block table_entities_thead_tr %}
<th>id</th> <th>id</th>
<th>{{ 'Label'|trans }}</th> <th>{{ 'Label'|trans }}</th>
<th>{{ 'Active'|trans }}</th> <th>{{ 'Active'|trans }}</th>
<th>{{ 'Actions'|trans }}</th> <th>{{ 'Actions'|trans }}</th>
{% endblock %} {% endblock %}
{% block table_entities_tbody %} {% block table_entities_tbody %}
{% for entity in entities %} {% for entity in entities %}
<tr> <tr>
@ -25,19 +25,19 @@
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
<li> <li>
<a href="{{ chill_path_add_return_path('chill_crud_admin_user_job_edit', { 'id': entity.id}) }}" class="btn btn-sm btn-edit btn-mini"></a> <a href="{{ chill_path_add_return_path('chill_crud_admin_user_job_edit', { 'id': entity.id}) }}" class="btn btn-edit"></a>
</li> </li>
</ul> </ul>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
{% block actions_before %} {% block actions_before %}
<li class='cancel'> <li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a> <a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li> </li>
{% endblock %} {% endblock %}
{% endembed %} {% endembed %}
{% endblock %} {% endblock %}