From 6a50b4ccb58860f5db872745c7f1894c75cdd027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 9 Nov 2016 13:32:58 +0100 Subject: Added group in user form --- src/Wallabag/GroupBundle/Entity/Group.php | 1 + src/Wallabag/GroupBundle/Form/GroupType.php | 7 ---- .../Resources/views/Manage/edit.html.twig | 8 ----- .../Resources/views/Manage/index.html.twig | 42 +++++++++++----------- 4 files changed, 23 insertions(+), 35 deletions(-) (limited to 'src/Wallabag/GroupBundle') diff --git a/src/Wallabag/GroupBundle/Entity/Group.php b/src/Wallabag/GroupBundle/Entity/Group.php index e889f74e..1381d1ea 100644 --- a/src/Wallabag/GroupBundle/Entity/Group.php +++ b/src/Wallabag/GroupBundle/Entity/Group.php @@ -2,6 +2,7 @@ namespace Wallabag\GroupBundle\Entity; +use Doctrine\Common\Collections\ArrayCollection; use FOS\UserBundle\Model\Group as BaseGroup; use Doctrine\ORM\Mapping as ORM; use Wallabag\UserBundle\Entity\User; diff --git a/src/Wallabag/GroupBundle/Form/GroupType.php b/src/Wallabag/GroupBundle/Form/GroupType.php index 749c15e9..c2ad764b 100644 --- a/src/Wallabag/GroupBundle/Form/GroupType.php +++ b/src/Wallabag/GroupBundle/Form/GroupType.php @@ -2,7 +2,6 @@ namespace Wallabag\GroupBundle\Form; -use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -22,12 +21,6 @@ class GroupType extends AbstractType 'required' => false, 'label' => 'group.form.name_label', ]) - ->add('users', EntityType::class, array( - 'class' => 'WallabagUserBundle:User', - 'choice_label' => 'username', - 'multiple' => true, - 'expanded' => true, - )) ->add('save', SubmitType::class, [ 'label' => 'group.form.save', ]) diff --git a/src/Wallabag/GroupBundle/Resources/views/Manage/edit.html.twig b/src/Wallabag/GroupBundle/Resources/views/Manage/edit.html.twig index 791a7a18..7de68c35 100644 --- a/src/Wallabag/GroupBundle/Resources/views/Manage/edit.html.twig +++ b/src/Wallabag/GroupBundle/Resources/views/Manage/edit.html.twig @@ -23,14 +23,6 @@ -
-
- {{ form_label(edit_form.users) }} - {{ form_errors(edit_form.users) }} - {{ form_widget(edit_form.users) }} -
-
-
{{ form_widget(edit_form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} diff --git a/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig b/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig index ce2a4556..58af3a75 100644 --- a/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig +++ b/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig @@ -11,26 +11,28 @@

{{ 'group.description'|trans|raw }}

- - - - - - - - - - {% for group in groups %} - - - - - - {% endfor %} - -
{{ 'group.form.name_label'|trans }}{{ 'group.form.roles_label'|trans }}{{ 'group.list.actions'|trans }}
{{ group.name }} - {{ 'group.list.edit_action'|trans }} -
+ {% if groups is not empty %} + + + + + + + + + + {% for group in groups %} + + + + + + {% endfor %} + +
{{ 'group.form.name_label'|trans }}{{ 'group.form.roles_label'|trans }}{{ 'group.list.actions'|trans }}
{{ group.name }} + {{ 'group.list.edit_action'|trans }} +
+ {% endif %}

{{ 'group.list.create_new_one'|trans }} -- cgit v1.2.3