mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Basic user permissions for user editing
This commit is contained in:
@ -8,11 +8,12 @@
|
||||
<body>
|
||||
<header>
|
||||
{% block header %}
|
||||
{% if user %}Hello, {{ user.username }}!{% endif %}
|
||||
{% if user.is_authenticated %}Hello, {{ user.username }}!{% endif %}
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
15
core/templates/core/edit_user.html
Normal file
15
core/templates/core/edit_user.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{% if profile %}
|
||||
Edit {{ profile.get_display_name }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if profile %}
|
||||
<h3>Edit user</h3>
|
||||
<p><a href="{% url 'core:user_profile' profile.id %}">Back to profile</a></p>
|
||||
<p>You're editing the profile of <strong>{{ profile.get_display_name }}</strong></p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
@ -13,6 +13,9 @@ User list
|
||||
{% 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>
|
||||
{% endif %}
|
||||
|
||||
|
Reference in New Issue
Block a user