Minor changes

- Création d'un template pour nav
- Modification des liens entre les pages account
- Correction de la balise form dans account_update.html
- Ajout d'un nom pour la résolution inversée de account
This commit is contained in:
Aurélien Delobelle 2016-08-03 06:33:27 +02:00
parent b8fe555741
commit 49fdaa6824
6 changed files with 27 additions and 13 deletions

View file

@ -4,6 +4,8 @@
{% block content %}
<a href="{% url 'kfet.account.create' %}">Créer un compte</a>
<ul>
{% for account in accounts %}
<li>

View file

@ -15,7 +15,7 @@
{% elif post and not success %}
<p>Echec de la mise à jour des informations</p>
{% endif %}
<form submit="{% url 'kfet.account.update' account.trigramme %}" method="post">
<form action="{% url 'kfet.account.update' account.trigramme %}" method="post">
{% csrf_token %}
{{ user_form.as_p }}
{{ cof_form.as_p }}

View file

@ -12,16 +12,7 @@
<![endif]-->
</head>
<body>
<nav>
<ul>
<li><a href="{% url "kfet.home" %}">Home</a></li>
{% if perms.kfet.add_account %}
<li>
<a href={% url "kfet.account.create" %}>Créer un compte</a>
</li>
{% endif %}
</ul>
</nav>
{% include "kfet/base_nav.html" %}
<section id="content">
{% block content %}TGTG{% endblock %}
</section>

View file

@ -0,0 +1,20 @@
<nav>
Standard
<ul>
<li><a href="{% url "kfet.home" %}">Home</a></li>
<li>
{% if request.user.profile.account_kfet %}
<a href="{% url "kfet.account.read" request.user.profile.account_kfet.trigramme %}">
Mes infos
</a>
{% endif %}
</li>
</ul>
Equipe
{% if perms.is_team %}
<ul>
<li><a href="{% url "kfet.account" %}">Comptes</a></li>
</ul>
{% endif %}
</nav>

View file

@ -11,7 +11,8 @@ urlpatterns = [
# -----
# General
url(r'^account/$', views.account),
url(r'^account/$', views.account,
name = 'kfet.account'),
url(r'^account/is_validandfree$', views.account_is_validandfree_ajax,
name = 'kfet.account.is_validandfree.ajax'),

View file

@ -199,7 +199,7 @@ def account_update(request, trigramme):
if request.user.has_perm('kfet.change_account'):
account_form = AccountForm(request.POST, instance = account)
else:
account_form = AccountRestrictForm(instance = account)
account_form = AccountRestrictForm(request.POST, instance = account)
cof_form = CofRestrictForm(request.POST, instance=account.cofprofile)
user_form = UserRestrictForm(request.POST, instance=account.cofprofile.user)