/
user.html
98 lines (88 loc) · 3.45 KB
/
user.html
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
{% extends "base.html" %}
{% set active_page = "account" %}
{% block title %} Account overview {% endblock %}
{% block divs %}
<div class="container-fluid" style="text-align:center;">
<a href="/users">Return to user overview</a>
</div>
{% if user %}
<h2> Account overview for {{ user.username }} </h2>
<div class="container-fluid">
<div class="row">
<div class="col-sm-1">
<form action="/users/reset_password_for/{{ user.id }}" method="get">
<button class="btn btn-sm btn-responsive btn-info" type="submit"
title="Reset the password and send instructions how to choose a new one.">Reset password</button>
</form>
</div>
<div class="col-sm-1">
<form action="/users/toggle_active/{{ user.id }}" method="get">
<button class="btn btn-sm btn-responsive {% if user.active %} btn-warning {% else %} btn-success {% endif %}" type="submit"
title="Toggle activation status of this user.">
{% if user.active %} Deactivate user {% else %} Activate user {% endif %}
</button>
</form>
</div>
<div class="col-sm-10">
</div>
</div>
<div class="row" style="margin-top: 1em;">
<div class="col-sm-12">
<table class="table">
<tbody>
<tr>
<td>
Email address
</td>
<td>
<a href="mailto:{{ user.email }}">{{ user.email }}</a>
</td>
</tr>
<tr>
<td>
Time Zone
</td>
<td>
{{ user.timezone }}
</td>
</tr>
<tr>
<td>
Last login was
</td>
<td>
{{ user.last_login_at | localized_datetime }}
</td>
</tr>
<tr>
<td>
Assets owned
</td>
<td>
<a href="/assets/owned_by/{{ user.id }}">{{ asset_count }}</a>
</td>
</tr>
<tr>
<td>
Roles
</td>
<td>{% for role in user.flexmeasures_roles %}
{{ role.name }}{{ "," if not loop.last }}
{% endfor %}
</td>
</tr>
<tr>
<td>
Active
</td>
<td>
{{ user.active }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% endblock %}