]> git.agnieray.net Git - galette.git/blob - galette/templates/default/pages/members_public_list.html.twig
Always display staff members first on public lists
[galette.git] / galette / templates / default / pages / members_public_list.html.twig
1 {#
2 /**
3 * Copyright © 2003-2024 The Galette Team
4 *
5 * This file is part of Galette (https://galette.eu).
6 *
7 * Galette is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * Galette is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #}
21 {% extends 'elements/list.html.twig' %}
22
23 {% set nb = members|length %}
24 {% set no_action = true %}
25 {% set is_public = not login.isLogged() %}
26
27 {% macro drawEntry(member, staff) %}
28 {% set rclass = member.getRowClass() %}
29 <tr>
30 <td class="{{ rclass }} username_row" data-scope="row">
31 {% if member.isCompany() %}
32 <span>
33 <i class="ui building outline icon tooltip" title="{{ _T('Is a company') }}" aria-hidden="true"></i>
34 <span class="ui special popup">{{ _T('Is a company') }}</span>
35 </span>
36 {% elseif member.isMan() %}
37 <span>
38 <i class="ui male icon tooltip" title="{{ _T('Is a man') }}" aria-hidden="true"></i>
39 <span class="ui special popup">{{ _T('Is a man') }}</span>
40 </span>
41 {% elseif member.isWoman() %}
42 <span>
43 <i class="ui female icon tooltip" title="{{ _T('Is a woman') }}" aria-hidden="true"></i>
44 <span class="ui special popup">{{ _T('Is a woman') }}</span>
45 </span>
46 {% else %}
47 <i class="ui icon" aria-hidden="true"></i>
48 {% endif %}
49 {% if member.website != '' %}
50 <a href="{{ member.website }}">{{ member.sfullname }}</a>
51 {% else %}
52 {{ member.sfullname }}
53 {% endif %}
54 {% if staff %}
55 <a class="ui label">
56 <i class="ui user tie orange icon tooltip" aria-hidden="true"></i>
57 {{ member.sstatus }}
58 </a>
59 {% endif %}
60 </td>
61 <td class="{{ rclass }}" data-col-label="{{ _T('Nickname') }}">{{ member.nickname|escape }}</td>
62 {% if login.isLogged() %}
63 <td class="{{ rclass }}" data-col-label="{{ _T('Email') }}"><a href="mailto:{{ member.email }}">{{ member.email }}</a></td>
64 {% endif %}
65 <td class="{{ rclass }}" data-col-label="{{ _T('Information') }}">{{ member.others_infos }}</td>
66 </tr>
67 {% endmacro %}
68
69 {% set form = {
70 'order': {
71 'name': 'publicList',
72 'args': {
73 "type": "list"
74 }
75 }
76 } %}
77
78 {% block infoline %}
79 {% set infoline = {
80 'label': _Tn("%count member", "%count members", nb_members)|replace({'%count': nb_members}),
81 'route': {
82 'name': 'filterPublicList',
83 'args': {
84 "type": "list"
85 }
86 }
87 } %}
88 {{ parent() }}
89 {% endblock %}
90
91 {% block header %}
92 {% set columns = [
93 {'label': _T('Name'), order: constant("Galette\\Repository\\Members::ORDERBY_NAME")},
94 {'label': _T("Nickname"), order: constant("Galette\\Repository\\Members::ORDERBY_NICKNAME")},
95 ] %}
96
97 {% if login.isLogged() %}
98 {% set columns = columns|merge([
99 {'label': _T("Email")}
100 ]) %}
101 {% endif %}
102
103 {% set columns = columns|merge([
104 {'label': _T("Information")}
105 ]) %}
106
107 {{ parent() }}
108 {% endblock %}
109
110 {% block search %}
111 <div class="ui icon info visible message">
112 <i class="info circle blue icon" aria-hidden="true"></i>
113 <div class="content">
114 {{ _T("This page shows only members who have choosen to be visible on the public lists and are up-to-date within their contributions. If you want your account to be visible here, edit your profile and check 'Be visible in the members list'") }}
115 </div>
116 </div>
117 {% endblock %}
118
119 {% block body %}
120 {% if nb_members > 0 %}
121 {% for member in members.staff %}
122 {{ _self.drawEntry(member, true) }}
123 {% endfor %}
124
125 {% for member in members.members %}
126 {{ _self.drawEntry(member, false) }}
127 {% endfor %}
128 {% else %}
129 <tr>
130 <td class="emptylist" colspan="4">
131 {{ _T('No member') }}
132 </td>
133 </tr>
134 {% endif %}
135 {% endblock %}