improve ux for admin configuration crud interface

This commit is contained in:
Mathieu Jaumotte 2021-02-05 22:30:23 +01:00
parent 22efcf0c1d
commit 3278d07137
13 changed files with 99 additions and 94 deletions

View File

@ -45,7 +45,7 @@ class ActivityReasonController extends AbstractController
$em->persist($entity); $em->persist($entity);
$em->flush(); $em->flush();
return $this->redirect($this->generateUrl('chill_activity_activityreason_show', array('id' => $entity->getId()))); return $this->redirect($this->generateUrl('chill_activity_activityreason', array('id' => $entity->getId())));
} }
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array( return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array(
@ -167,7 +167,7 @@ class ActivityReasonController extends AbstractController
if ($editForm->isValid()) { if ($editForm->isValid()) {
$em->flush(); $em->flush();
return $this->redirect($this->generateUrl('chill_activity_activityreason_edit', array('id' => $id))); return $this->redirect($this->generateUrl('chill_activity_activityreason', array('id' => $id)));
} }
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array( return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array(

View File

@ -23,14 +23,15 @@
{{ form_row(edit_form.name) }} {{ form_row(edit_form.name) }}
{{ form_row(edit_form.active) }} {{ form_row(edit_form.active) }}
{{ form_row(edit_form.category) }} {{ form_row(edit_form.category) }}
{{ form_row(edit_form.submit, { 'attr': { 'class' : 'sc-button orange' } } ) }}
{{ form_end(edit_form) }}
<ul class="record_actions"> <ul class="record_actions">
<li> <li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}"> <a href="{{ path('chill_activity_activityreason') }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
{{ 'Back to the list'|trans }} </li>
</a> <li>
</li> {{ form_row(edit_form.submit, { 'attr': { 'class' : 'sc-button orange' } } ) }}
</ul> </li>
</ul>
{{ form_end(edit_form) }}
{% endblock %} {% endblock %}

View File

@ -31,12 +31,12 @@
<tr class="{% if entity.active %}active{% else %}inactive{% endif %}"> <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><a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
<td> <td>
<ul> <ul class="record_actions">
<li> <li>
<a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}">{{ 'show'|trans }}</a> <a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}" class="sc-button bt-show" title="{{ 'show'|trans }}"></a>
</li> </li>
<li> <li>
<a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}">{{ 'edit'|trans }}</a> <a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}" class="sc-button bt-edit" title="{{ 'edit'|trans }}"></a>
</li> </li>
</ul> </ul>
</td> </td>
@ -45,9 +45,9 @@
</tbody> </tbody>
</table> </table>
<ul> <ul class="record_actions">
<li> <li>
<a href="{{ path('chill_activity_activityreason_new') }}"> <a href="{{ path('chill_activity_activityreason_new') }}" class="sc-button bt-new">
{{ 'Create a new activity reason'|trans }} {{ 'Create a new activity reason'|trans }}
</a> </a>
</li> </li>

View File

@ -23,14 +23,15 @@
{{ form_row(form.name) }} {{ form_row(form.name) }}
{{ form_row(form.active) }} {{ form_row(form.active) }}
{{ form_row(form.category) }} {{ form_row(form.category) }}
{{ form_row(form.submit, { 'attr': { 'class' : 'sc-button green' } } ) }}
{{ form_end(form) }}
<ul class="record_actions"> <ul class="record_actions">
<li> <li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}"> <a href="{{ path('chill_activity_activityreason') }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
{{ 'Back to the list'|trans }} </li>
</a> <li>
</li> {{ form_row(form.submit, { 'attr': { 'class' : 'sc-button bt-new' } } ) }}
</ul> </li>
</ul>
{{ form_end(form) }}
{% endblock %} {% endblock %}

View File

@ -38,16 +38,16 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions">
<li> <li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}"> <a href="{{ path('chill_activity_activityreason') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}"> <a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">
{{ 'Edit'|trans }} {{ 'Edit'|trans }}
</a> </a>
</li> </li>
</ul> </ul>
{% endblock %} {% endblock %}

View File

@ -22,14 +22,17 @@
{{ form_start(edit_form) }} {{ form_start(edit_form) }}
{{ form_row(edit_form.name) }} {{ form_row(edit_form.name) }}
{{ form_row(edit_form.active) }} {{ form_row(edit_form.active) }}
{{ form_row(edit_form.submit, { 'attr': { 'class': 'sc-button orange' } } ) }}
{{ form_end(edit_form) }}
<ul class="record_actions"> <ul class="record_actions">
<li> <li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}"> <a href="{{ path('chill_activity_activityreasoncategory') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}
</a> </a>
</li> </li>
</ul> <li>
{{ form_row(edit_form.submit, { 'attr': { 'class': 'sc-button bt-edit' } } ) }}
</li>
</ul>
{{ form_end(edit_form) }}
{% endblock %} {% endblock %}

View File

@ -29,14 +29,15 @@
<tbody> <tbody>
{% for entity in entities %} {% for entity in entities %}
<tr> <tr>
<td><a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
<td> <td>
<ul> <a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
<td>
<ul class="record_actions">
<li> <li>
<a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}">{{ 'show'|trans }}</a> <a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}" class="sc-button bt-show" title="{{ 'show'|trans }}"></a>
</li> </li>
<li> <li>
<a href="{{ path('chill_activity_activityreasoncategory_edit', { 'id': entity.id }) }}">{{ 'edit'|trans }}</a> <a href="{{ path('chill_activity_activityreasoncategory_edit', { 'id': entity.id }) }}" class="sc-button bt-edit" title="{{ 'edit'|trans }}"></a>
</li> </li>
</ul> </ul>
</td> </td>
@ -45,9 +46,9 @@
</tbody> </tbody>
</table> </table>
<ul> <ul class="record_actions">
<li> <li>
<a href="{{ path('chill_activity_activityreasoncategory_new') }}"> <a href="{{ path('chill_activity_activityreasoncategory_new') }}" class="sc-button bt-new">
{{ 'Create a new activity category reason'|trans }} {{ 'Create a new activity category reason'|trans }}
</a> </a>
</li> </li>

View File

@ -22,14 +22,15 @@
{{ form_start(form) }} {{ form_start(form) }}
{{ form_row(form.name) }} {{ form_row(form.name) }}
{{ form_row(form.active) }} {{ form_row(form.active) }}
{{ form_widget(form.submit, { 'attr': { 'class' : 'sc-button blue' } } ) }}
<p>{{ form_end(form) }}</p>
<ul class="record_actions"> <ul class="record_actions">
<li> <li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}"> <a href="{{ path('chill_activity_activityreasoncategory') }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
{{ 'Back to the list'|trans }} </li>
</a> <li>
</li> {{ form_widget(form.submit, { 'attr': { 'class' : 'sc-button bt-new' } } ) }}
</ul> </li>
</ul>
{{ form_end(form) }}
{% endblock %} {% endblock %}

View File

@ -37,17 +37,16 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<ul class="record_actions">
<ul class="record_actions"> <li class="cancel">
<li> <a href="{{ path('chill_activity_activityreasoncategory') }}" class="sc-button bt-cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}"> {{ 'Back to the list'|trans }}
{{ 'Back to the list'|trans }} </a>
</a> </li>
</li> <li>
<li> <a href="{{ path('chill_activity_activityreasoncategory_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">
<a href="{{ path('chill_activity_activityreasoncategory_edit', { 'id': entity.id }) }}"> {{ 'Edit'|trans }}
{{ 'Edit'|trans }} </a>
</a> </li>
</li> </ul>
</ul>
{% endblock %} {% endblock %}

View File

@ -26,8 +26,8 @@
<ul class="record_actions"> <ul class="record_actions">
<li> <li class="cancel">
<a href="{{ path('chill_activity_activitytype') }}"> <a href="{{ path('chill_activity_activitytype') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}
</a> </a>
</li> </li>

View File

@ -41,10 +41,10 @@
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
<li> <li>
<a href="{{ path('chill_activity_activitytype_show', { 'id': entity.id }) }}" class="sc-button bt-reset">{{ 'show'|trans|capitalize }}</a> <a href="{{ path('chill_activity_activitytype_show', { 'id': entity.id }) }}" class="sc-button bt-show" title="{{ 'show'|trans }}"></a>
</li> </li>
<li> <li>
<a href="{{ path('chill_activity_activitytype_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">{{ 'edit'|trans|capitalize }}</a> <a href="{{ path('chill_activity_activitytype_edit', { 'id': entity.id }) }}" class="sc-button bt-edit" title="{{ 'edit'|trans }}"></a>
</li> </li>
</ul> </ul>
</td> </td>

View File

@ -24,13 +24,13 @@
{{ form_row(form.name) }} {{ form_row(form.name) }}
<ul class="record_actions"> <ul class="record_actions">
<li> <li class="cancel">
<a href="{{ path('chill_activity_activitytype') }}"> <a href="{{ path('chill_activity_activitytype') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}
</a> </a>
</li> </li>
<li> <li>
{{ form_widget(form.submit, { 'attr' : { 'class' : 'sc-button blue' } } ) }} {{ form_widget(form.submit, { 'attr' : { 'class' : 'sc-button bt-new' } } ) }}
</li> </li>
</ul> </ul>
{{ form_end(form) }} {{ form_end(form) }}

View File

@ -27,17 +27,16 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<ul class="record_actions">
<ul class="record_actions"> <li class="cancel">
<li> <a href="{{ path('chill_activity_activitytype') }}" class="sc-button bt-cancel">
<a href="{{ path('chill_activity_activitytype') }}"> {{ 'Back to the list'|trans }}
{{ 'Back to the list'|trans }} </a>
</a> </li>
</li> <li>
<li> <a href="{{ path('chill_activity_activitytype_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">
<a href="{{ path('chill_activity_activitytype_edit', { 'id': entity.id }) }}"> {{ 'Edit'|trans }}
{{ 'Edit'|trans }} </a>
</a> </li>
</li> </ul>
</ul>
{% endblock %} {% endblock %}