mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
improve ux in admin configuration interface
This commit is contained in:
parent
7ef534438e
commit
6f80bd0d37
30
Controller/AdminController.php
Normal file
30
Controller/AdminController.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\DocStoreBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
/**
|
||||
* Class AdminController
|
||||
*
|
||||
* @package Chill\DocStoreBundle\Controller
|
||||
*/
|
||||
class AdminController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->render('ChillDocStoreBundle:Admin:layout.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
public function redirectToAdminIndexAction()
|
||||
{
|
||||
return $this->redirectToRoute('chill_main_admin_central');
|
||||
}
|
||||
|
||||
}
|
@ -100,7 +100,7 @@ class DocumentCategoryController extends AbstractController
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('document_category_edit', [
|
||||
return $this->redirectToRoute('document_category_index', [
|
||||
'bundleId' => $documentCategory->getBundleId(),
|
||||
'idInsideBundle' => $documentCategory->getIdInsideBundle(),]);
|
||||
}
|
||||
|
31
Resources/views/Admin/layout.html.twig
Normal file
31
Resources/views/Admin/layout.html.twig
Normal 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 "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_docstore', {
|
||||
'layout': '@ChillDocStore/Admin/menu.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block personcontent empty -->
|
||||
<h1>{{ 'Documents configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
21
Resources/views/Admin/menu.html.twig
Normal file
21
Resources/views/Admin/menu.html.twig
Normal file
@ -0,0 +1,21 @@
|
||||
{#
|
||||
* 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 "@ChillMain/Menu/verticalMenu.html.twig" %}
|
||||
{% block v_menu_title %}{{ 'Documents configuration'|trans }}{% endblock %}
|
||||
|
@ -16,5 +16,5 @@
|
||||
#}
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="sc-button bt-create">{{ button_label|default('Save') }}</button>
|
||||
<button class="sc-button bt-edit">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
||||
|
@ -14,18 +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 "@ChillMain/Admin/layout.html.twig" %}
|
||||
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'Document category edit'|trans }}{% endblock title %}
|
||||
|
||||
{% block admin_content %}
|
||||
<h1>{{ 'Document category edit'|trans }}</h1>
|
||||
|
||||
{{ include('ChillDocStoreBundle:DocumentCategory:_form.html.twig', {'button_label': 'Update'}) }}
|
||||
{# DISABLED
|
||||
{{ include('ChillDocStoreBundle:DocumentCategory:_form.html.twig', {'button_label': 'Update'}) }}
|
||||
#}
|
||||
|
||||
<a href="{{ path('document_category_index') }}" class="sc-button">
|
||||
{{ 'Back to the category list' | trans }}
|
||||
</a>
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<ul class="record_actions">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('document_category_index') }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the category list' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<button class="sc-button bt-edit">{{ button_label|default('Edit')|trans }}</button>
|
||||
</li>
|
||||
</ul>
|
||||
{{ form_end(form) }}
|
||||
|
||||
{{ include('ChillDocStoreBundle:DocumentCategory:_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
|
@ -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 "@ChillMain/Admin/layout.html.twig" %}
|
||||
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'Document category list' | trans }}{% endblock title %}
|
||||
|
||||
@ -40,12 +40,10 @@
|
||||
<td>{{ document_category.name | localize_translatable_string}}</td>
|
||||
|
||||
<td>
|
||||
<a href="{{ path('document_category_show', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}" class="sc-button">
|
||||
{{ 'show' | trans }}
|
||||
</a>
|
||||
<a href="{{ path('document_category_edit', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}" class="sc-button bt-edit">
|
||||
{{ 'edit' | trans }}
|
||||
</a>
|
||||
<a href="{{ path('document_category_show', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}"
|
||||
class="sc-button bt-show" title="{{ 'show' | trans }}"></a>
|
||||
<a href="{{ path('document_category_edit', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}"
|
||||
class="sc-button bt-edit" title="{{ 'edit' | trans }}"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
@ -56,5 +54,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('document_category_new') }}" class="sc-button bt-create">{{ 'Create new' | trans }}</a>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('document_category_new') }}" class="sc-button bt-create">{{ 'Create new category' | trans }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
@ -14,16 +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 "@ChillMain/Admin/layout.html.twig" %}
|
||||
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'Create new document category' | trans }}{% endblock title %}
|
||||
|
||||
{% block admin_content %}
|
||||
<h1>{{ 'Create new DocumentCategory' | trans }}</h1>
|
||||
|
||||
{{ include('ChillDocStoreBundle:DocumentCategory:_form.html.twig') }}
|
||||
{# DISABLED
|
||||
{{ include('ChillDocStoreBundle:DocumentCategory:_form.html.twig') }}
|
||||
#}
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<ul class="record_actions">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('document_category_index') }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the category list' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<button class="sc-button bt-new">{{ button_label|default('New')|trans }}</button>
|
||||
</li>
|
||||
</ul>
|
||||
{{ form_end(form) }}
|
||||
|
||||
<a href="{{ path('document_category_index') }}" class="sc-button">
|
||||
{{ 'Back to the category list' | trans }}
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
@ -14,12 +14,12 @@
|
||||
* 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 "@ChillMain/Admin/layout.html.twig" %}
|
||||
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'Document category show'|trans }}{% endblock title %}
|
||||
|
||||
{% block admin_content %}
|
||||
<h1>Document category</h1>
|
||||
<h1>{{ 'Document category show'|trans }}</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@ -42,13 +42,17 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('document_category_index') }}" class="sc-button">
|
||||
{{ 'Back to the category list' | trans }}
|
||||
</a>
|
||||
|
||||
<a href="{{ path('document_category_edit', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}" class="sc-button bt-edit">
|
||||
{{ 'Edit' | trans }}
|
||||
</a>
|
||||
|
||||
{{ include('ChillDocStoreBundle:DocumentCategory:_delete_form.html.twig') }}
|
||||
<ul class="record_actions">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('document_category_index') }}"
|
||||
class="sc-button bt-cancel">{{ 'Back to the category list' | trans }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('document_category_edit', {'bundleId': document_category.bundleId, 'idInsideBundle': document_category.idInsideBundle}) }}"
|
||||
class="sc-button bt-edit">{{ 'Edit' | trans }}</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ include('ChillDocStoreBundle:DocumentCategory:_delete_form.html.twig') }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
@ -1,3 +1,32 @@
|
||||
app:
|
||||
resource: "@ChillDocStoreBundle/Controller/"
|
||||
type: annotation
|
||||
|
||||
## ADMIN SECTION
|
||||
chill_docstore_admin:
|
||||
path: /{_locale}/admin/document
|
||||
controller: Chill\DocStoreBundle\Controller\AdminController::indexAction
|
||||
options:
|
||||
menus:
|
||||
admin_section:
|
||||
order: 2200
|
||||
label: "Documents configuration menu"
|
||||
icons: ['calendar']
|
||||
|
||||
chill_docstore_admin_redirect_to_admin_index:
|
||||
path: /{_locale}/admin/document_redirect_to_main
|
||||
controller: Chill\DocStoreBundle\Controller\AdminController::redirectToAdminIndexAction
|
||||
options:
|
||||
menus:
|
||||
admin_docstore:
|
||||
order: 0
|
||||
label: Main admin menu
|
||||
|
||||
chill_docstore_category_admin:
|
||||
path: /{_locale}/admin/document/category
|
||||
controller: Chill\DocStoreBundle\Controller\DocumentCategoryController::indexAction
|
||||
options:
|
||||
menus:
|
||||
admin_docstore:
|
||||
order: 90
|
||||
label: "Documents categories"
|
@ -34,3 +34,20 @@ CHILL_PERSON_DOCUMENT_DELETE: Supprimer un document
|
||||
CHILL_PERSON_DOCUMENT_SEE: Voir un document
|
||||
CHILL_PERSON_DOCUMENT_SEE_DETAILS: Voir le détail d'un document
|
||||
CHILL_PERSON_DOCUMENT_UPDATE: Modifier un document
|
||||
|
||||
# Admin
|
||||
Documents configuration: Configuration des documents
|
||||
Documents configuration menu: Documents
|
||||
Documents categories: Catégories de documents
|
||||
|
||||
Document category list: Catégories de documents
|
||||
Document category show: Voir la catégorie de documents
|
||||
Document category edit: Modifier la catégorie de documents
|
||||
Creator bundle id: Module
|
||||
Bundle id: Module
|
||||
Internal id inside creator bundle: Identifiant
|
||||
Id inside bundle: Identifiant
|
||||
Document class: Classe de document
|
||||
no records found:
|
||||
Create new category: Créer une nouvelle catégorie
|
||||
Back to the category list: Retour à la liste
|
Loading…
x
Reference in New Issue
Block a user