diff options
Diffstat (limited to 'src/Wallabag/GroupBundle/Resources/views')
4 files changed, 185 insertions, 3 deletions
diff --git a/src/Wallabag/GroupBundle/Resources/views/Manage/edit_user.html.twig b/src/Wallabag/GroupBundle/Resources/views/Manage/edit_user.html.twig new file mode 100644 index 00000000..b7771690 --- /dev/null +++ b/src/Wallabag/GroupBundle/Resources/views/Manage/edit_user.html.twig | |||
@@ -0,0 +1,26 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'group.edit_user.title'|trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | |||
7 | <div class="row"> | ||
8 | <div class="col-md-6"> | ||
9 | |||
10 | {{ form_start(edit_form) }} | ||
11 | {{ form_errors(edit_form) }} | ||
12 | |||
13 | <div class="form-group"> | ||
14 | {{ form_label(edit_form.role) }} | ||
15 | {{ form_errors(edit_form.role) }} | ||
16 | {{ form_widget(edit_form.role) }} | ||
17 | </div> | ||
18 | |||
19 | {{ form_widget(edit_form.save, {'attr': {'class': 'btn waves-effect'}}) }} | ||
20 | <a class="btn btn-default" href="{{ path('group-manage', {'group': group.id}) }}">{{ 'group.edit_user.cancel' | trans }}</a> | ||
21 | {{ form_widget(edit_form._token) }} | ||
22 | {{ form_end(edit_form) }} | ||
23 | </div> | ||
24 | </div> | ||
25 | |||
26 | {% endblock %} | ||
diff --git a/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig b/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig index 01466e52..35a70400 100644 --- a/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig +++ b/src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig | |||
@@ -12,7 +12,7 @@ | |||
12 | <p class="help">{{ 'group.description'|trans|raw }}</p> | 12 | <p class="help">{{ 'group.description'|trans|raw }}</p> |
13 | 13 | ||
14 | {% if groups is not empty %} | 14 | {% if groups is not empty %} |
15 | <table class="bordered"> | 15 | <table class="bordered responsive-table"> |
16 | <thead> | 16 | <thead> |
17 | <tr> | 17 | <tr> |
18 | <th>{{ 'group.form.name_label'|trans }}</th> | 18 | <th>{{ 'group.form.name_label'|trans }}</th> |
@@ -24,9 +24,32 @@ | |||
24 | {% for group in groups %} | 24 | {% for group in groups %} |
25 | <tr> | 25 | <tr> |
26 | <td>{{ group.name }}</td> | 26 | <td>{{ group.name }}</td> |
27 | <td></td> | ||
28 | <td> | 27 | <td> |
29 | <a href="{{ path('group_edit', { 'id': group.id }) }}">{{ 'group.list.edit_action'|trans }}</a> | 28 | {% if app.user in group.users and app.user.inGroup(group) %} |
29 | {{ 'group.user.inGroup' | transchoice(group.users | length) }} | ||
30 | {% else %} | ||
31 | {{ 'group.user.notInGroup' | transchoice(group.users | length) }} | ||
32 | {% endif %} | ||
33 | </td> | ||
34 | <td> | ||
35 | {% if app.user in group.users and app.user.inGroup(group) %} | ||
36 | {% if app.user.getGroupRoleForUser(group) >= 5 %} | ||
37 | <a href="{{ path('group_edit', { 'id': group.id }) }}" class="waves-effect waves-light btn tooltipped" data-delay="50" data-position="bottom" data-tooltip="{{ 'group.list.edit_action'|trans }}"><i class="material-icons">edit</i></a> | ||
38 | <a href="{{ path('group-manage', { 'group': group.id }) }}" class="waves-effect waves-light btn tooltipped" data-delay="50" data-position="bottom" data-tooltip="{{ 'group.manage.label'|trans }}"><i class="material-icons">settings_applications</i></a> | ||
39 | {% endif %} | ||
40 | <a href="{{ path('group-presentations', { 'group': group.id }) }}" class="waves-effect waves-light btn tooltipped" data-delay="50" data-position="bottom" data-tooltip="{{ 'group.entries.label'|trans }}"><i class="material-icons">view_list</i></a> | ||
41 | <a href="{{ path('group_leave', { 'group': group.id }) }}" class="waves-effect waves-light btn red tooltipped" data-delay="50" data-position="bottom" data-tooltip="{{ 'group.leave.label'|trans }}"><i class="material-icons">clear</i></a> | ||
42 | {% elseif app.user in group.users and not app.user.inGroup(group) %} | ||
43 | {{ 'group.requests.sent' | trans }} | ||
44 | {% else %} | ||
45 | <a href="{{ path('group_join', { 'group': group.id }) }}" class="waves-effect waves-light btn tooltipped" data-tooltip="{{ 'group.join.label'|trans }}" data-delay="50" data-position="bottom"> | ||
46 | {% if group.acceptSystem == 3 %} | ||
47 | <i class="material-icons md-18 vertical-align-middle" data-toggle="tooltip" data-placement="bottom" title="{{ 'group.join'|trans }}">lock</i> | ||
48 | {% else %} | ||
49 | <i class="material-icons" data-toggle="tooltip" data-placement="bottom" title="{{ 'group.join'|trans }}">input</i> | ||
50 | {% endif %} | ||
51 | </a> | ||
52 | {% endif %} | ||
30 | </td> | 53 | </td> |
31 | </tr> | 54 | </tr> |
32 | {% endfor %} | 55 | {% endfor %} |
diff --git a/src/Wallabag/GroupBundle/Resources/views/Manage/manage.html.twig b/src/Wallabag/GroupBundle/Resources/views/Manage/manage.html.twig new file mode 100644 index 00000000..2226b299 --- /dev/null +++ b/src/Wallabag/GroupBundle/Resources/views/Manage/manage.html.twig | |||
@@ -0,0 +1,102 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'group.manage.title' |trans({ '%group%': group.name }) }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | |||
7 | <div class="row"> | ||
8 | <div class="input-field col s12"> | ||
9 | <p> | ||
10 | {{ 'group.form.role_label' |trans }}: | ||
11 | <em> | ||
12 | {% if group.defaultRole == 1 %} | ||
13 | {{ 'group.roles.readonly' | trans }} | ||
14 | {% elseif group.defaultRole == 2 %} | ||
15 | {{ 'group.roles.write' | trans }} | ||
16 | {% elseif group.defaultRole == 3 %} | ||
17 | {{ 'group.roles.manage_prez' | trans }} | ||
18 | {% elseif group.defaultRole == 5 %} | ||
19 | {{ 'group.roles.manage_users' | trans }} | ||
20 | {% elseif group.defaultRole == 10 %} | ||
21 | {{ 'group.roles.admin' | trans }} | ||
22 | {% else %} | ||
23 | {{ 'group.roles.unknown' | trans }} | ||
24 | {% endif %} | ||
25 | </em> | ||
26 | </p> | ||
27 | <p> | ||
28 | {{ 'group.form.access_label' | trans }}: | ||
29 | <em> | ||
30 | {% if group.acceptSystem == 1 %} | ||
31 | {{ 'group.access.open' | trans }} | ||
32 | {% elseif group.acceptSystem == 2 %} | ||
33 | {{ 'group.access.request' | trans }} | ||
34 | {% elseif group.acceptSystem == 3 %} | ||
35 | {{ 'group.access.password' | trans }} | ||
36 | {% elseif group.acceptSystem == 4 %} | ||
37 | {{ 'group.access.invitation' | trans }} | ||
38 | {% elseif group.acceptSystem == 10 %} | ||
39 | {{ 'group.access.hidden' | trans }} | ||
40 | {% else %} | ||
41 | {{ 'group.access.unknown' | trans }} | ||
42 | {% endif %} | ||
43 | </em> | ||
44 | </p> | ||
45 | <a href="{{ path('group_edit', {'id' : group.id}) }}" class="btn waves-effect">{{ 'group.edit_group' | trans }}</a> | ||
46 | {% if group.acceptSystem == 2 %} | ||
47 | <a href="{{ path('group-requests', {'group' : group.id}) }}" class="btn waves-effect">{{ 'group.requests.list' | trans }} <span class="badge">{{ group.getRequests() | length }}</span></a> | ||
48 | {% elseif group.acceptSystem >= 4 %} | ||
49 | <a href="{{ path('group-invitations', {'group' : group.id}) }}" class="btn waves-effect">{{ 'group.edit.invitations' | trans }} <span class="badge">{{ group.getInvited() | length }}</span></a> | ||
50 | {% endif %} | ||
51 | <a href="{{ path('group_delete', { 'id': group.id }) }}" class="btn waves-effect red"><i class="material-icons md-18" data-toggle="tooltip" data-placement="bottom" title="{{ 'group.form.delete'|trans }}">delete</i></a> | ||
52 | |||
53 | {% if members | length > 1 %} | ||
54 | <table class="table"> | ||
55 | <thead> | ||
56 | <tr> | ||
57 | <th>{{ 'group.members.name'|trans }}</th> | ||
58 | <th>{{ 'group.members.role' | trans }}</th> | ||
59 | <th>{{ 'group.members.action'|trans }}</th> | ||
60 | </tr> | ||
61 | </thead> | ||
62 | |||
63 | <tbody> | ||
64 | {% for user in members %} | ||
65 | {% if user != app.user %} | ||
66 | <tr> | ||
67 | <td>{{ user.username }}</td> | ||
68 | <td> | ||
69 | {% if user.getGroupRoleForUser(group) == 1 %} | ||
70 | {{ 'group.roles.readonly' | trans }} | ||
71 | {% elseif user.getGroupRoleForUser(group) == 2 %} | ||
72 | {{ 'group.roles.write' | trans }} | ||
73 | {% elseif user.getGroupRoleForUser(group) == 3 %} | ||
74 | {{ 'group.roles.manage_prez' | trans }} | ||
75 | {% elseif user.getGroupRoleForUser(group) == 5 %} | ||
76 | {{ 'group.roles.manage_users' | trans }} | ||
77 | {% elseif user.getGroupRoleForUser(group) == 10 %} | ||
78 | {{ 'group.roles.admin' | trans }} | ||
79 | {% else %} | ||
80 | {{ 'group.roles.unknown' | trans }} | ||
81 | {% endif %} | ||
82 | </td> | ||
83 | <td> | ||
84 | <a href="{{ path('group-user-edit', { 'group': group.id, 'user': user.id }) }}" class="btn waves-effect"><i class="material-icons md-18" data-toggle="tooltip" data-placement="bottom" title="{{ 'group.members.edit'|trans }}">edit</i></a> | ||
85 | <a class="btn waves-effect red" href="{{ path('group-user-exclude', { 'group': group.id, 'user': user.id }) }}"><i class="material-icons md-18" data-toggle="tooltip" data-placement="bottom" title="{{ 'group.members.exclude'|trans }}">clear</i></a> | ||
86 | </td> | ||
87 | </tr> | ||
88 | {% endif %} | ||
89 | {% endfor %} | ||
90 | </tbody> | ||
91 | </table> | ||
92 | {% else %} | ||
93 | <p>{{ 'group.members.empty' | trans }}</p> | ||
94 | {% endif %} | ||
95 | <div class="pull-right"> | ||
96 | {% if members.getNbPages > 1 %} | ||
97 | {{ pagerfanta(members, 'twitter_bootstrap3', {'proximity': 1}) }} | ||
98 | {% endif %} | ||
99 | </div> | ||
100 | </div> | ||
101 | </div> | ||
102 | {% endblock %} | ||
diff --git a/src/Wallabag/GroupBundle/Resources/views/Manage/requests.html.twig b/src/Wallabag/GroupBundle/Resources/views/Manage/requests.html.twig new file mode 100644 index 00000000..36d069ce --- /dev/null +++ b/src/Wallabag/GroupBundle/Resources/views/Manage/requests.html.twig | |||
@@ -0,0 +1,31 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'group.requests.list'|trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | <div class="row"> | ||
7 | <div class="col s12"> | ||
8 | |||
9 | <table class="table"> | ||
10 | <thead> | ||
11 | <tr> | ||
12 | <th>{{ 'group.requests.username'|trans }}</th> | ||
13 | <th>{{ 'group.requests.action'|trans }}</th> | ||
14 | </tr> | ||
15 | </thead> | ||
16 | |||
17 | <tbody> | ||
18 | {% for request in requests %} | ||
19 | <tr> | ||
20 | <td>{{ request.username }}</td> | ||
21 | <td> | ||
22 | <a class="btn waves-effect" href="{{ path('group-activate', {'group': group.id, 'user': request.id, 'accept': 1}) }}"><i class="material-icons">check</i></a> | ||
23 | <a class="btn waves-effect red" href="{{ path('group-activate', {'group': group.id, 'user': request.id, 'accept': 2}) }}"><i class="material-icons">close</i></a> | ||
24 | </td> | ||
25 | </tr> | ||
26 | {% endfor %} | ||
27 | </tbody> | ||
28 | </table> | ||
29 | </div> | ||
30 | </div> | ||
31 | {% endblock %} | ||