Feature: [admin][ActivityReason] improve administration for activity reason

* list alphabetically;
* show "active" in index
This commit is contained in:
2023-01-13 15:35:09 +01:00
parent e99fb75ebd
commit 25dd65fbd8
11 changed files with 91 additions and 30 deletions

View File

@@ -7,22 +7,34 @@
<thead>
<tr>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr class="{% if entity.active %}active{% else %}inactive{% endif %}">
<td><a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
<td>
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a>
</li>
<li>
<a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
</li>
</ul>
{% if entity.category is not null -%}
{{ entity.category.name|localize_translatable_string }} >
{% endif -%}
{{ entity.name|localize_translatable_string }}
</td>
<td>
<i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i>
{% if entity.active and not entity.isActiveAndParentActive %}
<span class="badge text-bg-danger text-white">{{ 'Associated activity reason category is inactive'|trans }}</span>
{% endif %}
</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a>
</li>
<li>
<a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}

View File

@@ -7,6 +7,7 @@
<thead>
<tr>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>{{ 'Actions'|trans }}</th>
</tr>
</thead>
@@ -14,7 +15,11 @@
{% for entity in entities %}
<tr>
<td>
<a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
{{ entity.name|localize_translatable_string }}
</td>
<td>
<i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i>
</td>
<td>
<ul class="record_actions">
<li>