profil.html 23.2 KB
Newer Older
1
{% extends 'users/sidebar.html' %}
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.

Copyright © 2017  Gabriel Détraz
Copyright © 2017  Goulven Kermarec
Copyright © 2017  Augustin Lemesle

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}

26
{% load acl %}
27
{% load logs_extra %}
28
{% load design %}
29
{% load i18n %}
30

31
{% block title %}{% trans "Profile" %}{% endblock %}
32

33
{% block content %}
Grizzly's avatar
Grizzly committed
34
<div align="center" class="title-dashboard">
35
    {% if user == users %}
36
    <h2>{% blocktrans with name=users.name surname=users.surname %}Welcome {{ name }} {{ surname }}{% endblocktrans %}</h2>
37
    {% else %}
38
    <h2>{% blocktrans with name=users.name surname=users.surname %}Profile of {{ name }} {{ surname }}{% endblocktrans %}</h2>
39
    {% endif %}
40 41
</div>
<div class="dashboard_container">
42
    <div class="row">
Maël Kervella's avatar
Maël Kervella committed
43
        <div class="col-sm-6 {% if solde_activated %}col-md-4{% else %}col_md-6{% endif %}">
44 45
            {% if users.is_ban%}
            <div class="panel panel-danger">
46
                <div class="panel-heading dashboard">{% trans "Your account has been banned" %}</div>
47
                <div class="panel-body dashboard">
48
                    <i class="text-danger">{% blocktrans with end_ban_date=users.end_ban|date:"SHORT_DATE_FORMAT" %}End of the ban: {{ end_ban_date }}{% endblocktrans %}</i>
49 50
                </div>
            </div>
51
            {% elif not users.has_access %}
52
            <div class="panel panel-danger">
53
                <div class="panel-heading dashboard">{% trans "No connection" %}</div>
54
                <div class="panel-body dashboard">
Maël Kervella's avatar
Maël Kervella committed
55 56
                    {% can_create Facture %}
                    <a class="btn btn-danger btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}">
erdnaxe's avatar
erdnaxe committed
57
                        <i class="fa fa-sign-in"></i> {% trans "Pay for a connection" %}
58
                    </a>
Maël Kervella's avatar
Maël Kervella committed
59
                    {% acl_else %}
60
                    {% trans "Ask for someone with the appropriate rights to pay for a connection." %}
Maël Kervella's avatar
Maël Kervella committed
61
                    {% acl_end %}
62
                </div>
63
            </div>
64
            {% else %}
65
            <div class="panel panel-success">
66
                <div class="panel-heading dashboard">{% blocktrans with end_connection_date=users.end_access|date:"SHORT_DATE_FORMAT" %}Connection (until {{ end_connection_date }} ){% endblocktrans %}</div>
67
                <div class="panel-body dashboard">
68 69
                    {% can_create Facture %}
                    <a class="btn btn-success btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}">
erdnaxe's avatar
erdnaxe committed
70
                        <i class="fa fa-sign-in"></i> {% trans "Extend the connection period" %}
71 72
                    </a>
                    {% acl_end %}
73 74
                </div>
            </div>
75
            {% endif %}
76 77 78
        </div>
        {% if solde_activated %}
        <div class="col-sm-6 col-md-4">
79
            <div class="panel panel-info">
erdnaxe's avatar
erdnaxe committed
80 81 82
                <div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse"
                     data-target="#subscriptions">
                {{ users.solde }} <i class="fa fa-eur"></i>
83
                </div>
84 85
                <div class="panel-body dashboard">
                    <a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}">
erdnaxe's avatar
erdnaxe committed
86
                        <i class="fa fa-eur"></i> {% trans "Refill the balance" %}
87
                    </a>
88
                </div>
89 90
            </div>
        </div>
91
        {% endif %}
Maël Kervella's avatar
Maël Kervella committed
92
        <div class="col-sm-6 {% if solde_activated %}col-md-4{% else %}col-md-6{% endif %}">
Maël Kervella's avatar
Maël Kervella committed
93 94
            {% if nb_machines %}
            <div class="panel panel-info">
erdnaxe's avatar
erdnaxe committed
95 96 97
                <div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse"
                     data-target="#machines">
                <i class="fa fa-desktop"></i>{% trans " Machines" %} <span class="badge"> {{ nb_machines }}</span>
98
                </div>
Maël Kervella's avatar
Maël Kervella committed
99 100
                <div class="panel-body dashboard">
                    <a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
101
                        <i class="fa fa-desktop"></i>{% trans " Add a machine" %}
Maël Kervella's avatar
Maël Kervella committed
102
                    </a>
103
                </div>
104
            </div>
Maël Kervella's avatar
Maël Kervella committed
105 106
            {% else %}
            <div class="panel panel-warning">
erdnaxe's avatar
erdnaxe committed
107 108 109 110
                <div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse"
                     data-target="#machines">
                    {% trans "No machine" %}
                </div>
Maël Kervella's avatar
Maël Kervella committed
111 112
                <div class="panel-body dashboard">
                    <a class="btn btn-warning btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
113
                        <i class="fa fa-desktop"></i>{% trans " Add a machine" %}
Maël Kervella's avatar
Maël Kervella committed
114 115 116 117
                    </a>
                </div>
            </div>
            {% endif %}
118
        </div>
119
    </div>
120 121
</div>

122
<div class="panel-group" id="accordion">
123
    <div class="panel panel-default">
124
        <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
erdnaxe's avatar
erdnaxe committed
125
             data-target="#information">
126 127
            <h3 class="panel-title pull-left">
                <i class="fa fa-user"></i>{% trans " Detailed information" %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
128
            </h3>
129
        </div>
erdnaxe's avatar
erdnaxe committed
130
        <div class="panel-collapse collapse collapse-default" id="information">
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
            <div class="panel-body">
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' users.id %}">
                    <i class="fa fa-edit"></i>
                    {% trans "Edit" %}
                </a>
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' users.id %}">
                    <i class="fa fa-lock"></i>
                    {% trans "Change the password" %}
                </a>
                {% can_change User state %}
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:state' users.id %}">
                    <i class="fa fa-id-badge"></i>
                    {% trans "Change the state" %}
                </a>
                {% acl_end %}
                {% can_change User groups %}
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:groups' users.id %}">
                    <i class="fa fa-check"></i>
                    {% trans "Edit the groups" %}
                </a>
                {% acl_end %}
                {% history_button users text=True %}
153 154
                </ul>
            </div>
155
            <div class="panel-body">
156 157
                <dl class="dl-horizontal row profile-info">
                    <div class="col-md-6">
158
                        {% if users.is_class_club %}
159 160 161 162 163 164 165
                            <dt>{% trans "Mailing" %}</dt>
                            {% if users.club.mailing %}
                                <dd>{{ users.pseudo }}(-admin)</dd>
                            {% else %}
                                <dd>{% trans "Mailing disabled" %}</dd>
                            {% endif %}
                        {% else %}
166
                            <dt>{% trans "First name" %}</dt>
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
                            <dd>{{ users.name }}</dd>
                        {% endif %}
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Surname" %}</dt>
                        <dd>{{ users.surname }}</dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Username" %}</dt>
                        <dd>{{ users.pseudo }}</dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Email address" %}</dt>
                        <dd><a href="mailto:{{ users.email }}">{{ users.email }}</a></dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Room" %}</dt>
                        <dd>
                            {{ users.room }} {% can_view_all Port %}{% if users.room.port_set.all %} /
                            {{ users.room.port_set.all|join:", " }} {% endif %}{% acl_end %}
                        </dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Telephone number" %}</dt>
                        <dd>{{ users.telephone }}</dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "School" %}</dt>
                        <dd>{{ users.school }}</dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Comment" %}</dt>
                        <dd>{{ users.comment }}</dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Registration date" %}</dt>
                        <dd>{{ users.registered }}</dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Last login" %}</dt>
                        <dd>{{ users.last_login }}</dd>
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "End of membership" %}</dt>
221
                        {% if users.end_adhesion != None %}
222
                            <dd><i class="text-success">{{ users.end_adhesion }}</i></dd>
223
                        {% else %}
224
                            <dd><i class="text-danger">{% trans "Not a member" %}</i></dd>
225
                        {% endif %}
226 227 228 229
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Whitelist" %}</dt>
230
                        {% if users.end_whitelist != None %}
231
                            <dd><i class="text-success">{{ users.end_whitelist }}</i></dd>
232
                        {% else %}
233
                            <dd><i class="text-warning">{% trans "None" %}</i></dd>
234
                        {% endif %}
235 236 237 238
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Ban" %}</dt>
239
                        {% if users.end_ban != None %}
240
                            <dd><i class="text-danger">{{ users.end_ban }}</i></dd>
241
                        {% else %}
242
                            <dd><i class="text-success">{% trans "Not banned" %}</i></dd>
243
                        {% endif %}
244 245 246 247
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "State" %}</dt>
248
                        {% if users.state == 0 %}
249
                            <dd><i class="text-success">{% trans "Active" %}</i></dd>
250
                        {% elif users.state == 1 %}
251
                            <dd><i class="text-warning">{% trans "Disabled" %}</i></dd>
252
                        {% elif users.state == 2 %}
253
                            <dd><i class="text-danger">{% trans "Archived" %}</i></dd>
254
                        {% elif users.state == 3 %}
255
                            <dd><i class="text-danger">{% trans "Not yet member" %}</i></dd>
256
                        {% endif %}
257 258 259 260
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Internet access" %}</dt>
261
                        {% if users.has_access == True %}
262
                            <dd><i class="text-success">
263
                                {% blocktrans with end_access=users.end_access %}Active (until {{ end_access }}){% endblocktrans %}</i></dd>
264
                        {% else %}
265
                            <dd><i class="text-danger">{% trans "Disabled" %}</i></dd>
266
                        {% endif %}
267 268 269 270
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Groups of rights" %}</dt>
271
                        {% if users.groups.all %}
272
                            <dd>{{ users.groups.all|join:", " }}</dd>
273
                        {% else %}
274
                            <dd>{% trans "None" %}</dd>
275
                        {% endif %}
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
                    </div>

                    <div class="col-md-6">
                        <dt>{% trans "Balance" %}</dt>
                        <dd>
                            {{ users.solde }} €
                            {% if user_solde %}
                                <a class="btn btn-primary btn-sm" style='float:right' role="button"
                                   href="{% url 'cotisations:credit-solde' users.pk %}">
                                    <i class="fa fa-eur"></i>
                                    {% trans "Refill" %}
                                </a>
                            {% endif %}
                        </dd>
                    </div>

292 293
                    {% if users.adherent.gpg_fingerprint %}
                        <div class="col-md-6 col-xs-12">
294 295
                            <dt>{% trans "GPG fingerprint" %}</dt>
                            <dd>{{ users.adherent.gpg_fingerprint }}</dd>
296 297
                        </div>
                    {% endif %}
298

299 300
                    {% if users.shell %}
                        <div class="col-md-6 col-xs-12">
301 302
                            <dt>{% trans "Shell" %}</dt>
                            <dd>{{ users.shell }}</dd>
303 304
                        </div>
                    {% endif %}
305
                </dl>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
306 307 308
            </div>
        </div>
    </div>
309
    {% if users.is_class_club %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
310
    <div class="panel panel-default">
311
        <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#club">
312
            <h3 class="panel-title pull-left">
313
                <i class="fa fa-users"></i>{% trans " Manage the club" %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
314
            </h3>
315
        </div>
erdnaxe's avatar
erdnaxe committed
316
        <div class="panel-collapse collapse" id="club">
317
            <div class="panel-body">
318 319
                <a class="btn btn-primary btn-sm" role="button"
                   href="{% url 'users:edit-club-admin-members' users.club.id %}">
320
                    <i class="fa fa-lock"></i>
321 322
                    {% trans "Manage the admins and members" %}
                </a>
323
            </div>
324 325
	    <div class="panel-body">
		<h4>{% trans "Club admins" %}</h4>
326
                <div class="table-responsive">
327 328 329
                    <table class="table table-striped">
                        <thead>
                            <tr>
330 331 332
				<th>{% trans "Surname" %}</th>
				<th>{% trans "First name" %}</th>
				<th>{% trans "Username" %}</th>
333 334 335
                            </tr>
                        </thead>
                        {% for admin in users.club.administrators.all %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
336
                        <tr>
337 338 339
                            <td>{{ admin.surname }}</td>
                            <td>{{ admin.name }}</td>
                            <td>{{ admin.pseudo }}</td>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
340
                        </tr>
341 342
                        {% endfor %}
                    </table>
343
                </div>
344
		<h4>{% trans "Members" %}</h4>
345
                <div class="table-responsive">
346 347 348
                    <table class="table table-striped">
                        <thead>
                            <tr>
349 350 351
				<th>{% trans "Surname" %}</th>
				<th>{% trans "First name" %}</th>
				<th>{% trans "Username" %}</th>
352 353 354
                            </tr>
                        </thead>
                        {% for admin in users.club.members.all %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
355
                        <tr>
356 357 358
                            <td>{{ admin.surname }}</td>
                            <td>{{ admin.name }}</td>
                            <td>{{ admin.pseudo }}</td>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
359
                        </tr>
360 361
                        {% endfor %}
                    </table>
362
                </div>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
363 364 365
            </div>
        </div>
    </div>
chirac's avatar
chirac committed
366
    {% endif %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
367
    <div class="panel panel-default">
erdnaxe's avatar
erdnaxe committed
368 369
        <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
             data-target="#machines">
370
            <h3 class="panel-title pull-left">
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
371
                <i class="fa fa-desktop"></i>
372
		{% trans "Machines" %}
373
                <span class="badge">{{ nb_machines }}</span>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
374
            </h3>
375
        </div>
erdnaxe's avatar
erdnaxe committed
376
        <div id="machines" class="panel-collapse collapse">
377
            <div class="panel-body">
378 379 380
               <a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
                   <i class="fa fa-desktop"></i>
		   {% trans "Add a machine" %}
381 382
                </a>
            </div>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
383 384
            <div class="panel-body">
                {% if machines_list %}
385
                {% include 'machines/aff_machines.html' with machines_list=machines_list %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
386
                {% else %}
387
		<p>{% trans "No machine" %}</p>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
388 389 390 391 392
                {% endif %}
            </div>
        </div>
    </div>
    <div class="panel panel-default">
erdnaxe's avatar
erdnaxe committed
393 394
        <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
             data-target="#subscriptions">
395
            <h3 class="panel-title pull-left">
erdnaxe's avatar
erdnaxe committed
396
                <i class="fa fa-eur"></i>
397
		{% trans "Subscriptions" %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
398
            </h3>
399
        </div>
erdnaxe's avatar
erdnaxe committed
400
        <div id="subscriptions" class="panel-collapse collapse">
401 402 403
            <div class="panel-body">
                {% can_create Facture %}
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:new-facture' users.id %}">
erdnaxe's avatar
erdnaxe committed
404
                    <i class="fa fa-eur"></i>
405
		    {% trans "Add a subscription" %}
406 407
                </a>
                {% if user_solde %}
408
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'cotisations:credit-solde' users.id %}">
erdnaxe's avatar
erdnaxe committed
409
                    <i class="fa fa-eur"></i>
410
		    {% trans "Edit the balance" %}
411
                </a>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
412
                {% endif%}
413
                {% acl_end %}
414
            </div>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
415 416
            <div class="panel-body">
                {% if facture_list %}
417
                {% include 'cotisations/aff_cotisations.html' with facture_list=facture_list %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
418
                {% else %}
419
		<p>{% trans "No invoice" %}</p>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
420 421 422 423 424
                {% endif %}
            </div>
        </div>
    </div>
    <div class="panel panel-default">
erdnaxe's avatar
erdnaxe committed
425
        <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#bans">
426
            <h3 class="panel-title pull-left">
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
427
                <i class="fa fa-ban"></i>
428
		{% trans "Bans" %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
429
            </h3>
430
        </div>
erdnaxe's avatar
erdnaxe committed
431
        <div id="bans" class="panel-collapse collapse">
432 433 434 435 436
             <div class="panel-body">
             	{% can_create Ban %}
              	<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-ban' users.id %}">
                 	<i class="fa fa-ban"></i>
			{% trans "Add a ban" %}
437
                </a>
438
                {% acl_end %}
439
            </div>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
440 441
            <div class="panel-body">
                {% if ban_list %}
442
                {% include 'users/aff_bans.html' with ban_list=ban_list %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
443
                {% else %}
444
		<p>{% trans "No ban" %}</p>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
445 446 447 448 449
                {% endif %}
            </div>
        </div>
    </div>
    <div class="panel panel-default">
erdnaxe's avatar
erdnaxe committed
450
        <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#whitelists">
451
            <h3 class="panel-title pull-left">
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
452
                <i class="fa fa-check-circle"></i>
453
		{% trans "Whitelists" %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
454
            </h3>
455
        </div>
erdnaxe's avatar
erdnaxe committed
456
        <div id="whitelists" class="panel-collapse collapse">
457
            <div class="panel-body">
458
                {% can_create Whitelist %}
459 460 461 462
				<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-whitelist' users.id %}">
					<i class="fa fa-check-circle"></i>
					{% trans "Grant a whitelist" %}
				</a>
463 464
                {% acl_end %}
            </div>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
465 466
            <div class="panel-body">
                {% if white_list %}
467
                {% include 'users/aff_whitelists.html' with white_list=white_list %}
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
468
                {% else %}
469
		<p>{% trans "No whitelist" %}</p>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
470 471 472 473
                {% endif %}
            </div>
        </div>
    </div>
474
    <div class="panel panel-default">
erdnaxe's avatar
erdnaxe committed
475
        <div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#email">
476
            <h3 class="panel-title pull-left">
477
                <i class="fa fa-envelope"></i>{% trans " Email settings" %}
478
            </h3>
479
        </div>
erdnaxe's avatar
erdnaxe committed
480
        <div id="email" class="panel-collapse collapse">
481
            <div class="panel-body">
482
                {% can_edit users %}
483
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-email-settings' users.id %}">
erdnaxe's avatar
erdnaxe committed
484
                    <i class="fa fa-pencil"></i>{% trans " Edit email settings" %}
485
                </a>
486
                {% acl_end %}
487 488 489 490 491 492
            </div>
            <div class="panel-body">
                {% if local_email_accounts_enabled %}
                <div class="table-responsive">
                    <table class="table">
                        <tr>
493
                            <th colspan="2">{% trans "Contact email address" %}</th>
494
                            <td colspan="2">{{ users.get_mail }}</td>
495 496
                        </tr>
                        <tr>
497
                            <th>{% trans "Enable the local email account" %}</th>
498
                            <td>{{ users.local_email_enabled | tick }}</td>
499
                            <th>{% trans "Enable the local email redirection" %}</th>
500 501 502
                            <td>{{ users.local_email_redirect | tick }}</td>
                        </tr>
                    </table>
503
                    <p>{% trans "The contact email address is the email address where we send emails to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection." %}</p>
504 505
                </div>
                {% if users.local_email_enabled %}
506 507
                {% can_create EMailAddress users.id %}
                <a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-emailaddress' users.id %}">
508
                    <i class="fa fa-plus-square"></i>{% trans " Add an email address" %}
509
                </a>
510
                {% acl_end %}
511
                {% if emailaddress_list %}
512
                {% include 'users/aff_emailaddress.html' with emailaddress_list=emailaddress_list %}
513
                {% endif %}
514 515 516 517 518
                {% endif %}
                {% else %}
                <div class="table-responsive">
                    <table class="table">
                        <tr>
519
                            <th>{% trans "Contact email address" %}</th>
520
                            <td>{{ users.get_mail }}</td>
521 522 523 524 525
                        </tr>
                    </table>
                </div>
                {% endif %}
            </div>
526 527
        </div>
    </div>
Hugo LEVY-FALK's avatar
Hugo LEVY-FALK committed
528
</div>
529
{% endblock %}
530