fix layout and menu for activity configuration

close #614 1h00
This commit is contained in:
Julien Fastré 2015-09-29 17:18:29 +02:00
parent 3dcbec4b87
commit 0ecfcae98b
21 changed files with 180 additions and 58 deletions

View File

@ -0,0 +1,38 @@
<?php
/*
* Chill is a software for social workers
* Copyright (C) 2015 Champs Libres <info@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/>.
*/
namespace Chill\ActivityBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
/**
* Controller for activity configuration
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
* @author Champs Libres <info@champs-libres.coop>
*/
class AdminController extends Controller
{
public function indexActivityAction()
{
return $this->render('ChillActivityBundle:Admin:layout_activity.html.twig');
}
}

View File

@ -13,3 +13,24 @@ chill_activity_activityreasoncategory:
chill_activity_activitytype:
resource: "@ChillActivityBundle/Resources/config/routing/activitytype.yml"
prefix: /
chill_admin_activity_index:
path: /{_locale}/admin/activity
defaults: { _controller: ChillActivityBundle:Admin:indexActivity }
options:
menus:
admin:
label: Activity configuration
order: 2000
chill_admin_activity_back_to_admin:
path: /{_locale}/admin/activity_back_to_main
defaults:
_controller: FrameworkBundle:Redirect:urlRedirect
path: /{_locale}/admin
permanent: true
options:
menus:
admin_activity:
order: 0
label: Main admin menu

View File

@ -3,7 +3,7 @@ chill_activity_activityreason:
defaults: { _controller: "ChillActivityBundle:ActivityReason:index" }
options:
menus:
admin:
admin_activity:
order: 2000
label: "Activity Reasons"

View File

@ -3,7 +3,7 @@ chill_activity_activityreasoncategory:
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:index" }
options:
menus:
admin:
admin_activity:
order: 2010
label: "Activity Reasons Category"

View File

@ -3,7 +3,7 @@ chill_activity_activitytype:
defaults: { _controller: "ChillActivityBundle:ActivityType:index" }
options:
menus:
admin:
admin_activity:
order: 2020
label: "Activity Types"

View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>Symfony2 is great</source>
<target>J'aime Symfony2</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -32,7 +32,24 @@ Reset form: Remise à zéro du formulaire
'Success : activity updated!': Bravo ! L'activité a été mise à jour.
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
# CONTROLLER
# ROLES
CHILL_ACTIVITY_CREATE: Créer une activité
CHILL_ACTIVITY_UPDATE: Modifier une activité
CHILL_ACTIVITY_SEE: Voir une activité
CHILL_ACTIVITY_SEE: Voir une activité
# admin
Activity configuration menu: Configuration des activités
Activity Types: Types d'activité
Activity Reasons: Sujets d'une activité
Activity Reasons Category: Catégories d'activités
# activity reason admin
ActivityReason list: Liste des sujets
Create a new activity reason: Créer un nouveau sujet
Active: Actif
Category: Catégorie
ActivityReason creation: Nouveau sujet
ActivityReason edit: Modification d'un sujet
ActivityReason: Sujet d'activité
The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé
The entity is active and will be proposed: Le sujet est actif et sera proposé

View File

@ -14,19 +14,23 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReason edit</h1>
<h1>{{ 'ActivityReason edit'|trans }}</h1>
{{ form(edit_form) }}
{{ form_start(edit_form) }}
{{ form_row(edit_form.name) }}
{{ form_row(edit_form.active) }}
{{ form_row(edit_form.category) }}
{{ form_row(edit_form.submit, { 'attr': { 'class' : 'sc-button orange' } } ) }}
{{ form_end(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activityreason') }}">
Back to the list
{{ 'Back to the list'|trans }}
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -14,33 +14,29 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReason list</h1>
<h1>{{ 'ActivityReason list'|trans }}</h1>
<table class="records_list">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Active</th>
<th>Actions</th>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td>{{ entity.active }}</td>
<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>
<li>
<a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}">show</a>
<a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}">{{ 'show'|trans }}</a>
</li>
<li>
<a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}">edit</a>
<a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}">{{ 'edit'|trans }}</a>
</li>
</ul>
</td>
@ -52,7 +48,7 @@
<ul>
<li>
<a href="{{ path('chill_activity_activityreason_new') }}">
Create a new entry
{{ 'Create a new activity reason'|trans }}
</a>
</li>
</ul>

View File

@ -14,17 +14,22 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReason creation</h1>
<h1>{{ 'ActivityReason creation'|trans }}</h1>
{{ form(form) }}
{{ form_start(form) }}
{{ form_row(form.name) }}
{{ form_row(form.active) }}
{{ form_row(form.category) }}
{{ form_row(form.submit, { 'attr': { 'class' : 'sc-button green' } } ) }}
{{ form_end(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activityreason') }}">
Back to the list
{{ 'Back to the list'|trans }}
</a>
</li>
</ul>

View File

@ -14,24 +14,26 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReason</h1>
<h1>{{ 'ActivityReason'|trans }}</h1>
<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
</tr>
<tr>
<th>Name</th>
<th>{{ 'Name'|trans }}</th>
<td>{{ entity.name|localize_translatable_string }}</td>
</tr>
<tr>
<th>Active</th>
<td>{{ entity.active }}</td>
<th>{{ 'Active' }}</th>
<td>
{% if entity.active %}
<p>{{ 'The entity is active and will be proposed'|trans }}</p>
{% else %}
<p>{{ "The entity is inactive and won't be proposed"|trans }}</p>
{% endif %}
</td>
</tr>
</tbody>
</table>
@ -39,14 +41,13 @@
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activityreason') }}">
Back to the list
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
<a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}">
Edit
{{ 'Edit'|trans }}
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReasonCategory edit</h1>

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReasonCategory list</h1>

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReasonCategory creation</h1>

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityReasonCategory</h1>

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityType edit</h1>

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityType list</h1>

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityType creation</h1>

View File

@ -14,7 +14,7 @@
* 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 "ChillMainBundle::Admin/layout.html.twig" %}
{% extends "ChillActivityBundle::Admin/layout_activity.html.twig" %}
{% block admin_content %}
<h1>ActivityType</h1>

View File

@ -0,0 +1,31 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <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 "ChillMainBundle::layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_activity', {
'layout': 'ChillActivityBundle::Admin/menu_activity.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}<!-- block personcontent empty -->
<h1>{{ 'Activity configuration' |trans }}</h1>
{% endblock %}
{% endblock %}

View File

@ -0,0 +1,20 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <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 "ChillMainBundle::Menu/verticalMenu.html.twig" %}
{% block v_menu_title %}{{ 'Activity configuration menu'|trans }}{% endblock %}