Skip to content

Commit 78915e5

Browse files
committed
feat(users): add template to display user profile (and tests)
1 parent f569ed7 commit 78915e5

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

users/templates/users/profile.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
<h2>Profilo Utente</h2>
5+
6+
<table class="table table-striped table-bordered">
7+
<tbody>
8+
<tr>
9+
<th>Username</th>
10+
<td>{{ user.username }}</td>
11+
</tr>
12+
<tr>
13+
<th>Email</th>
14+
<td>{{ user.email }}</td>
15+
</tr>
16+
<tr>
17+
<th>Nome</th>
18+
<td>{{ user.first_name | default:"Non specificato" }}</td>
19+
</tr>
20+
<tr>
21+
<th>Cognome</th>
22+
<td>{{ user.last_name | default:"Non specificato" }}</td>
23+
</tr>
24+
<tr>
25+
<th>Data di Nascita</th>
26+
<td>{{ user.date_of_birth | default:"Non specificata" }}</td>
27+
</tr>
28+
<tr>
29+
<th>Numero di Telefono</th>
30+
<td>{{ user.phone_number | default:"Non specificato" }}</td>
31+
</tr>
32+
<tr>
33+
<th>Bio</th>
34+
<td>{{ user.bio|default:"Non specificata" }}</td>
35+
</tr>
36+
<tr>
37+
<th>Ultimo Accesso</th>
38+
<td>{{ user.last_login|date:"d/m/Y H:i" }}</td>
39+
</tr>
40+
<tr>
41+
<th>Data di Registrazione</th>
42+
<td>{{ user.date_joined|date:"d/m/Y H:i" }}</td>
43+
</tr>
44+
<tr>
45+
<th>È Staff</th>
46+
<td>{{ user.is_staff|yesno:"Sì,No" }}</td>
47+
</tr>
48+
<tr>
49+
<th>È Superutente</th>
50+
<td>{{ user.is_superuser|yesno:"Sì,No" }}</td>
51+
</tr>
52+
<tr>
53+
<th>È Attivo</th>
54+
<td>{{ user.is_active|yesno:"Sì,No" }}</td>
55+
</tr>
56+
</tbody>
57+
</table>
58+
59+
<hr>
60+
61+
<a href="{% url 'homepage' %}" class="btn btn-secondary">Torna alla Home</a>
62+
{% endblock %}
63+

users/tests/test_templates.py

Whitespace-only changes.

0 commit comments

Comments
 (0)