ActivityType replace Admin Conroller with Crud system

This commit is contained in:
Jean-Francois Monfort
2021-04-01 16:22:33 +02:00
parent 24a7d7b34b
commit 580dc71218
12 changed files with 88 additions and 361 deletions

View File

@@ -1,40 +1,12 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>{{ 'ActivityType edit'|trans }}</h1>
{{ form_start(edit_form) }}
{{ form_row(edit_form.active) }}
{{ form_row(edit_form.name) }}
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('chill_activity_activitytype') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
{{ form_widget(edit_form.submit, { 'attr' : { 'class' : 'sc-button bt-update' } } ) }}
</li>
</ul>
{{ form_end(edit_form) }}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -30,7 +30,7 @@
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('chill_activity_activitytype_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td style="text-align:center;">
{%- if entity.active -%}
<i class="fa fa-check-square-o"></i>
@@ -41,10 +41,7 @@
<td>
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activitytype_show', { 'id': entity.id }) }}" class="sc-button bt-show" title="{{ 'show'|trans }}"></a>
</li>
<li>
<a href="{{ path('chill_activity_activitytype_edit', { 'id': entity.id }) }}" class="sc-button bt-edit" title="{{ 'edit'|trans }}"></a>
<a href="{{ path('chill_crud_activity_type_edit', { 'id': entity.id }) }}" class="sc-button bt-edit" title="{{ 'edit'|trans }}"></a>
</li>
</ul>
</td>
@@ -55,7 +52,7 @@
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activitytype_new') }}" class="sc-button bt-create">
<a href="{{ path('chill_crud_activity_type_new') }}" class="sc-button bt-create">
{{ 'Create a new activity type'|trans }}
</a>
</li>

View File

@@ -1,38 +1,11 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>{{ 'ActivityType creation'|trans }}</h1>
{{ form_start(form) }}
{{ form_row(form.active) }}
{{ form_row(form.name) }}
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('chill_activity_activitytype') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
{{ form_widget(form.submit, { 'attr' : { 'class' : 'sc-button bt-new' } } ) }}
</li>
</ul>
{{ form_end(form) }}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -1,42 +0,0 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>{{ 'ActivityType'|trans }}</h1>
<table class="record_properties">
<tbody>
<tr>
<th>{{ 'Name'|trans }}</th>
<td>{{ entity.name|localize_translatable_string }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('chill_activity_activitytype') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
<a href="{{ path('chill_activity_activitytype_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
{% endblock %}