mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
WIP: Improve many views and a bit user permissions (idea for class scale perm)
This commit is contained in:
@ -10,12 +10,20 @@
|
||||
{% block header %}
|
||||
{% if user.is_authenticated %}Hello, {{ user.username }}!{% endif %}
|
||||
<ul>
|
||||
{% if not user.is_authenticated %}
|
||||
<li><a href="{% url 'core:register' %}">Register</a></li>
|
||||
<li><a href="{% url 'core:login' %}">Login</a></li>
|
||||
{% else %}
|
||||
<li><a href="{% url 'core:logout' %}">Logout</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% if user.is_authenticated %}
|
||||
<ul>
|
||||
<li><a href="{% url 'core:user_profile' user.id %}">Profile</a></li>
|
||||
<li><a href="{% url 'core:user_list' %}">Users</a></li>
|
||||
<li><a href="{% url 'core:page_list' %}">Pages</a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
||||
|
@ -8,12 +8,18 @@
|
||||
<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 %}
|
||||
{{ perms.core }}
|
||||
<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>
|
||||
{% if user.id == profile.id %}
|
||||
<li><a href="{% url 'core:user_tools' %}">Tools</a></li>
|
||||
{% endif %}
|
||||
{% if perms.core.change_user or user.id == profile.id %}
|
||||
<li><a href="{% url 'core:user_edit' profile.id %}">Edit</a></li>
|
||||
{% endif %}
|
||||
{% if perms.core.change_prop_user %}
|
||||
<li><a href="{% url 'core:user_groups' profile.id %}">Groups</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
You're seeing the profile of <strong>{{ profile.get_full_name }}</strong><br/>
|
||||
|
20
core/templates/core/user_tools.html
Normal file
20
core/templates/core/user_tools.html
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends "core/base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{{ user.get_display_name }}'s tools
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>User Tools</h3>
|
||||
<p><a href="{% url 'core:user_profile' user.id %}">Back to profile</a></p>
|
||||
|
||||
<ul>
|
||||
{% if perms.core.add_group %}
|
||||
<li><a href="{% url 'core:group_list' %}">Groups</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user