mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Improve user views
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
{% block header %}
|
||||
{% if user.is_authenticated %}Hello, {{ user.username }}!{% endif %}
|
||||
<ul>
|
||||
<li><a href="">Register</a></li>
|
||||
<li><a href="{% url 'core:register' %}">Register</a></li>
|
||||
<li><a href="{% url 'core:login' %}">Login</a></li>
|
||||
<li><a href="{% url 'core:logout' %}">Logout</a></li>
|
||||
<li><a href="{% url 'core:user_list' %}">Users</a></li>
|
||||
|
@ -1,32 +0,0 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{% if profile %}
|
||||
{{ profile.get_display_name }}'s profile
|
||||
{% endif %}
|
||||
{% if user_list %}
|
||||
User list
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if profile %}
|
||||
<h3>User Profile</h3>
|
||||
<p><a href="{% url 'core:user_list' %}">Back to list</a></p>
|
||||
{% if user.is_superuser or user.id == profile.id %}
|
||||
<p><a href="{% url 'core:user_edit' profile.id %}">Edit</a></p>
|
||||
{% endif %}
|
||||
<p>You're seeing the profile of <strong>{{ profile.get_display_name }}</strong></p>
|
||||
<p>{{ profile.nick_name }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if user_list %}
|
||||
<h3>User list</h3>
|
||||
<ul>
|
||||
{% for u in user_list %}
|
||||
<li><a href="{% url 'core:user_profile' u.id %}">{{ u.get_display_name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
26
core/templates/core/user_detail.html
Normal file
26
core/templates/core/user_detail.html
Normal file
@ -0,0 +1,26 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{{ profile.get_display_name }}'s profile
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>User Profile</h3>
|
||||
<p><a href="{% url 'core:user_list' %}">Back to list</a></p>
|
||||
|
||||
{% if user.is_superuser or user.id == profile.id %}
|
||||
<ul>
|
||||
<li><a href="{% url 'core:user_edit' profile.id %}">Edit</a></li>
|
||||
<li><a href="{% url 'core:user_groups' profile.id %}">Groups</a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
<p>
|
||||
You're seeing the profile of <strong>{{ profile.get_full_name }}</strong><br/>
|
||||
<strong>{{ profile.nick_name }}</strong><br/>
|
||||
<em>{{ profile.date_of_birth|date:"d/m/Y" }}</em>
|
||||
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
|
14
core/templates/core/user_edit.html
Normal file
14
core/templates/core/user_edit.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Edit user profile</h2>
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<p><input type="submit" value="Update" /></p>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
14
core/templates/core/user_groups.html
Normal file
14
core/templates/core/user_groups.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Edit user groups</h2>
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<p><input type="submit" value="Update" /></p>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
15
core/templates/core/user_list.html
Normal file
15
core/templates/core/user_list.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
User list
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>User list</h3>
|
||||
<ul>
|
||||
{% for u in user_list %}
|
||||
<li><a href="{% url 'core:user_profile' u.id %}">{{ u.get_display_name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user