diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-09 13:32:58 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-23 09:24:20 +0200 |
commit | 6a50b4ccb58860f5db872745c7f1894c75cdd027 (patch) | |
tree | 3ed2302821140b1de2142b2403ad7e5ff4a7ff83 /src/Wallabag/GroupBundle | |
parent | 56c81a2f433eaba98f8cf0bfdd3672bc517ae266 (diff) | |
download | wallabag-6a50b4ccb58860f5db872745c7f1894c75cdd027.tar.gz wallabag-6a50b4ccb58860f5db872745c7f1894c75cdd027.tar.zst wallabag-6a50b4ccb58860f5db872745c7f1894c75cdd027.zip |
Added group in user form
Diffstat (limited to 'src/Wallabag/GroupBundle')
4 files changed, 23 insertions, 35 deletions
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\GroupBundle\Entity; | 3 | namespace Wallabag\GroupBundle\Entity; |
4 | 4 | ||
5 | use Doctrine\Common\Collections\ArrayCollection; | ||
5 | use FOS\UserBundle\Model\Group as BaseGroup; | 6 | use FOS\UserBundle\Model\Group as BaseGroup; |
6 | use Doctrine\ORM\Mapping as ORM; | 7 | use Doctrine\ORM\Mapping as ORM; |
7 | use Wallabag\UserBundle\Entity\User; | 8 | 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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\GroupBundle\Form; | 3 | namespace Wallabag\GroupBundle\Form; |
4 | 4 | ||
5 | use Symfony\Bridge\Doctrine\Form\Type\EntityType; | ||
6 | use Symfony\Component\Form\AbstractType; | 5 | use Symfony\Component\Form\AbstractType; |
7 | use Symfony\Component\Form\FormBuilderInterface; | 6 | use Symfony\Component\Form\FormBuilderInterface; |
8 | use Symfony\Component\OptionsResolver\OptionsResolver; | 7 | use Symfony\Component\OptionsResolver\OptionsResolver; |
@@ -22,12 +21,6 @@ class GroupType extends AbstractType | |||
22 | 'required' => false, | 21 | 'required' => false, |
23 | 'label' => 'group.form.name_label', | 22 | 'label' => 'group.form.name_label', |
24 | ]) | 23 | ]) |
25 | ->add('users', EntityType::class, array( | ||
26 | 'class' => 'WallabagUserBundle:User', | ||
27 | 'choice_label' => 'username', | ||
28 | 'multiple' => true, | ||
29 | 'expanded' => true, | ||
30 | )) | ||
31 | ->add('save', SubmitType::class, [ | 24 | ->add('save', SubmitType::class, [ |
32 | 'label' => 'group.form.save', | 25 | 'label' => 'group.form.save', |
33 | ]) | 26 | ]) |
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 @@ | |||
23 | </div> | 23 | </div> |
24 | </div> | 24 | </div> |
25 | 25 | ||
26 | <div class="row"> | ||
27 | <div class="input-field col s12"> | ||
28 | {{ form_label(edit_form.users) }} | ||
29 | {{ form_errors(edit_form.users) }} | ||
30 | {{ form_widget(edit_form.users) }} | ||
31 | </div> | ||
32 | </div> | ||
33 | |||
34 | <br/> | 26 | <br/> |
35 | 27 | ||
36 | {{ form_widget(edit_form.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} | 28 | {{ 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 @@ | |||
11 | <div class="input-field col s12"> | 11 | <div class="input-field col s12"> |
12 | <p class="help">{{ 'group.description'|trans|raw }}</p> | 12 | <p class="help">{{ 'group.description'|trans|raw }}</p> |
13 | 13 | ||
14 | <table class="bordered"> | 14 | {% if groups is not empty %} |
15 | <thead> | 15 | <table class="bordered"> |
16 | <tr> | 16 | <thead> |
17 | <th>{{ 'group.form.name_label'|trans }}</th> | 17 | <tr> |
18 | <th>{{ 'group.form.roles_label'|trans }}</th> | 18 | <th>{{ 'group.form.name_label'|trans }}</th> |
19 | <th>{{ 'group.list.actions'|trans }}</th> | 19 | <th>{{ 'group.form.roles_label'|trans }}</th> |
20 | </tr> | 20 | <th>{{ 'group.list.actions'|trans }}</th> |
21 | </thead> | 21 | </tr> |
22 | <tbody> | 22 | </thead> |
23 | {% for group in groups %} | 23 | <tbody> |
24 | <tr> | 24 | {% for group in groups %} |
25 | <td>{{ group.name }}</td> | 25 | <tr> |
26 | <td></td> | 26 | <td>{{ group.name }}</td> |
27 | <td> | 27 | <td></td> |
28 | <a href="{{ path('group_edit', { 'id': group.id }) }}">{{ 'group.list.edit_action'|trans }}</a> | 28 | <td> |
29 | </td> | 29 | <a href="{{ path('group_edit', { 'id': group.id }) }}">{{ 'group.list.edit_action'|trans }}</a> |
30 | </tr> | 30 | </td> |
31 | {% endfor %} | 31 | </tr> |
32 | </tbody> | 32 | {% endfor %} |
33 | </table> | 33 | </tbody> |
34 | </table> | ||
35 | {% endif %} | ||
34 | <br /> | 36 | <br /> |
35 | <p> | 37 | <p> |
36 | <a href="{{ path('group_new') }}" class="waves-effect waves-light btn">{{ 'group.list.create_new_one'|trans }}</a> | 38 | <a href="{{ path('group_new') }}" class="waves-effect waves-light btn">{{ 'group.list.create_new_one'|trans }}</a> |