aboutsummaryrefslogtreecommitdiffhomepage
path: root/main/app/sprinkles/admin/templates/pages/group.html.twig
blob: bab5b131901d203a33c0f0eb94ff562e201ca74c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{% extends "pages/abstract/dashboard.html.twig" %}

{% block stylesheets_page %}
    <!-- Page-specific CSS asset bundle -->
    {{ assets.css('css/form-widgets') | raw }}
{% endblock %}

{# Overrides blocks in head of base template #}
{% block page_title %}{{ translate("GROUP", 2) }} | {{ group.name }}{% endblock %}

{% block page_description %}{{ translate("GROUP.INFO_PAGE", {name: group.name}) }}{% endblock %}

{% block body_matter %}
    <div class="row">
        <div class="col-lg-4">
            <div id="view-group" class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">{{ translate('GROUP.SUMMARY') }}</h3>
                    {% if 'tools' not in tools.hidden %}
                        <div class="box-tools pull-right">
                            <div class="btn-group">
                                <button type="button" class="btn btn-sm dropdown-toggle" data-toggle="dropdown"
                                        aria-haspopup="true" aria-expanded="false">
                                    <i class="fa fa-gear"></i>
                                    <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu box-tool-menu">
                                    {% block tools %}
                                        <li>
                                            <a href="#" class="js-group-edit" data-slug="{{ group.slug }}">
                                                <i class="fa fa-edit fa-fw"></i> {{ translate('EDIT') }}
                                            </a>
                                        </li>
                                        {% if 'delete' not in tools.hidden %}
                                            <li>
                                                <a href="#" class="js-group-delete" data-slug="{{ group.slug }}">
                                                    <i class="fa fa-trash-o fa-fw"></i> {{ translate('DELETE') }}
                                                </a>
                                            </li>
                                        {% endif %}
                                    {% endblock %}
                                </ul>
                            </div>
                        </div>
                    {% endif %}
                </div>
                <div class="box-body box-profile">
                    <div class="text-center">
                        <i class="{{ group.icon }} fa-5x"></i>
                    </div>

                    <h3 class="profile-username text-center">{{ group.name }}</h3>

                    {% if 'description' not in fields.hidden %}
                        <p class="text-muted">
                            {{ group.description }}
                        </p>
                    {% endif %}
                    {% if 'users' not in fields.hidden %}
                        <hr>
                        <strong><i class="fa fa-users margin-r-5"></i> {{ translate('USER', 2) }}</strong>
                        <p class="badge bg-blue box-profile-property">
                            {{ group.users.count }}
                        </p>
                    {% endif %}
                    {% block group_profile %}{% endblock %}
                </div>
            </div>
        </div>
        <div class="col-lg-8">
            <div id="widget-group-users" class="box box-primary">
                <div class="box-header">
                    <h3 class="box-title"><i class="fa fa-fw fa-user"></i> {{ translate('USER', 2) }}</h3>
                    {% include "tables/table-tool-menu.html.twig" %}
                </div>
                <div class="box-body">
                    {% include "tables/users.html.twig" with {
                        "table" : {
                            "id" : "table-group-users"
                        }
                    } %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block scripts_page %}
    <!-- Include page variables -->
    <script>
        {% include "pages/partials/page.js.twig" %}

        // Add user name
        page = $.extend(
            true,               // deep extend
            {
                "group_slug": "{{ group.slug }}"
            },
            page
        );
    </script>

    <!-- Include form widgets JS -->
    {{ assets.js('js/form-widgets') | raw }}

    <!-- Include page-specific JS -->
    {{ assets.js('js/pages/group') | raw }}
{% endblock %}