Ajout groupes K-Fêt utilisateurs en lecture
- Pour voir les groupes, il faut la permission `kfet.manage_perms` - Pour modifier les groupes auxquels fait parti un compte, il la faut également
This commit is contained in:
parent
8507072c8f
commit
e64a443fb3
9 changed files with 198 additions and 67 deletions
|
@ -6,21 +6,34 @@
|
|||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="btn-group btn-group-lg">
|
||||
<a class="btn btn-primary" href="{% url 'kfet.account.create' %}">Créer un compte</a>
|
||||
<div class="col-sm-4 col-md-3 col-content-left">
|
||||
<div class="content-left">
|
||||
<div class="content-left-top text-center">
|
||||
<div class="line">{{ accounts|length|add:-1 }} comptes</div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary btn-lg" href="{% url 'kfet.account.create' %}">Créer un compte</a>
|
||||
<a class="btn btn-primary btn-lg" href="{% url 'kfet.account.group' %}">Permissions</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8 col-md-9 col-content-right">
|
||||
{% include 'kfet/base_messages.html' %}
|
||||
<div class="content-right">
|
||||
<div class="content-right-block">
|
||||
<h2>Liste des comptes</h2>
|
||||
<div>
|
||||
<ul>
|
||||
{% for account in accounts %}
|
||||
<li>
|
||||
<a href="{% url 'kfet.account.read' account.trigramme %}">{{ account }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
{% for account in accounts %}
|
||||
<li>
|
||||
<a href="{% url 'kfet.account.read' account.trigramme %}">
|
||||
{{ account }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
|
49
kfet/templates/kfet/account_group.html
Normal file
49
kfet/templates/kfet/account_group.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
{% extends 'kfet/base.html' %}
|
||||
|
||||
{% block title %}Groupes de comptes{% endblock %}
|
||||
{% block content-header-title %}Groupes de comptes{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-md-3 col-content-left">
|
||||
<div class="content-left">
|
||||
<div class="content-left-top text-center">
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<a class="btn btn-primary btn-lg" href="">Créer un groupe</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8 col-md-9 col-content-right">
|
||||
{% include 'kfet/base_messages.html' %}
|
||||
<div class="content-right">
|
||||
{% for group in groups %}
|
||||
<div class="content-right-block">
|
||||
<h2>{{ group.name }}</h2>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>Permissions</h3>
|
||||
<ul>
|
||||
{% for perm in group.permissions.all %}
|
||||
<li>{{ perm.name }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<h3>Comptes</h3>
|
||||
<ul>
|
||||
{% for user in group.user_set.all %}
|
||||
<li>{{ user.profile.account_kfet }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
|
@ -33,6 +33,7 @@
|
|||
{{ user_form.as_p }}
|
||||
{{ cof_form.as_p }}
|
||||
{{ account_form.as_p }}
|
||||
{{ group_form.as_p }}
|
||||
{% if perms.kfet.is_team and not perms.kfet.change_account %}
|
||||
<input type="password" name="KFETPASSWORD">
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue