]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/GroupBundle/Resources/views/Manage/index.html.twig
MOAR WIP
[github/wallabag/wallabag.git] / src / Wallabag / GroupBundle / Resources / views / Manage / index.html.twig
index ce2a4556b4cad9e9d6d323b7e35ac3fe2992e3d1..35a70400889e25b90a8d295d697b72b79a5e8afb 100644 (file)
                     <div class="input-field col s12">
                         <p class="help">{{ 'group.description'|trans|raw }}</p>
 
-                        <table class="bordered">
-                            <thead>
-                                <tr>
-                                    <th>{{ 'group.form.name_label'|trans }}</th>
-                                    <th>{{ 'group.form.roles_label'|trans }}</th>
-                                    <th>{{ 'group.list.actions'|trans }}</th>
-                                </tr>
-                            </thead>
-                            <tbody>
-                            {% for group in groups %}
-                                <tr>
-                                    <td>{{ group.name }}</td>
-                                    <td></td>
-                                    <td>
-                                        <a href="{{ path('group_edit', { 'id': group.id }) }}">{{ 'group.list.edit_action'|trans }}</a>
-                                    </td>
-                                </tr>
-                            {% endfor %}
-                            </tbody>
-                        </table>
+                        {% if groups is not empty %}
+                            <table class="bordered responsive-table">
+                                <thead>
+                                    <tr>
+                                        <th>{{ 'group.form.name_label'|trans }}</th>
+                                        <th>{{ 'group.form.roles_label'|trans }}</th>
+                                        <th>{{ 'group.list.actions'|trans }}</th>
+                                    </tr>
+                                </thead>
+                                <tbody>
+                                {% for group in groups %}
+                                    <tr>
+                                        <td>{{ group.name }}</td>
+                                        <td>
+                                            {% if app.user in group.users and app.user.inGroup(group) %}
+                                                {{ 'group.user.inGroup' | transchoice(group.users | length) }}
+                                            {% else %}
+                                                {{ 'group.user.notInGroup' | transchoice(group.users | length) }}
+                                            {% endif %}
+                                        </td>
+                                        <td>
+                                            {% if app.user in group.users and app.user.inGroup(group) %}
+                                                {% if app.user.getGroupRoleForUser(group) >= 5 %}
+                                                    <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>
+                                                    <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>
+                                                {% endif %}
+                                                <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>
+                                                <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>
+                                            {% elseif app.user in group.users and not app.user.inGroup(group) %}
+                                                {{ 'group.requests.sent' | trans }}
+                                            {% else %}
+                                                <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">
+                                                    {% if group.acceptSystem == 3 %}
+                                                        <i class="material-icons md-18 vertical-align-middle" data-toggle="tooltip" data-placement="bottom" title="{{ 'group.join'|trans }}">lock</i>
+                                                    {% else %}
+                                                        <i class="material-icons" data-toggle="tooltip" data-placement="bottom" title="{{ 'group.join'|trans }}">input</i>
+                                                    {% endif %}
+                                                </a>
+                                            {% endif %}
+                                        </td>
+                                    </tr>
+                                {% endfor %}
+                                </tbody>
+                            </table>
+                        {% endif %}
                         <br />
                         <p>
                             <a href="{{ path('group_new') }}" class="waves-effect waves-light btn">{{ 'group.list.create_new_one'|trans }}</a>
                         </p>
+                        {% if groups.getNbPages > 1 %}
+                            {{ pagerfanta(groups, 'twitter_bootstrap_translated', {'proximity': 1}) }}
+                        {% endif %}
                     </div>
                 </div>
             </div>