Ajout lecture/édition des paramètres généraux

This commit is contained in:
Aurélien Delobelle 2016-08-22 03:57:13 +02:00
parent b628808493
commit ee998f8a24
6 changed files with 114 additions and 3 deletions

View file

@ -37,6 +37,9 @@
{% if user.username != 'kfet_genericteam' %}
<li><a href="{% url 'kfet.login.genericteam' %}" target="_blank" id="genericteam">Connexion standard</a></li>
{% endif %}
{% if perms.kfet.change_settings %}
<li><a href="{% url 'kfet.settings' %}">Paramètres</a></li>
{% endif %}
</ul>
</li>
{% endif %}

View file

@ -0,0 +1,24 @@
{% extends 'kfet/base.html' %}
{% block title %}Paramètres{% endblock %}
{% block content-header-title %}Paramètres{% endblock %}
{% block content %}
{% include 'kfet/base_messages.html' %}
<table>
<tr>
<td></td>
<td>Nom</td>
<td>Valeur</td>
</tr>
{% for setting in settings %}
<tr>
<td><a href="{% url 'kfet.settings.update' setting.pk %}">Modifier</a></td>
<td>{{ setting.name }}</td>
<td>{% firstof setting.value_decimal setting.value_duration setting.value_account %}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View file

@ -0,0 +1,14 @@
{% extends 'kfet/base.html' %}
{% block title %}Modification de {{ settings.name }}{% endblock %}
{% block content-header-title %}Modification de {{ settings.name }}{% endblock %}
{% block content %}
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Mettre à jour">
</form>
{% endblock %}