diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 7bdab03b..c6ee9ff6 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -202,7 +202,7 @@ textarea { padding:15px; } -.form-only #id_trigramme { +.form-only .account_create #id_trigramme { display:block; width:200px; height:80px; diff --git a/kfet/templates/kfet/account.html b/kfet/templates/kfet/account.html index d93b1201..76445e73 100644 --- a/kfet/templates/kfet/account.html +++ b/kfet/templates/kfet/account.html @@ -14,7 +14,9 @@
Créer un compte - Permissions + {% if perms.kfet.manage_perms %} + Permissions + {% endif %} {% if perms.kfet.view_negs %} Négatifs {% endif %} diff --git a/kfet/templates/kfet/account_create.html b/kfet/templates/kfet/account_create.html index dccc210e..ac6c5daa 100644 --- a/kfet/templates/kfet/account_create.html +++ b/kfet/templates/kfet/account_create.html @@ -32,12 +32,7 @@ {% include 'kfet/account_create_form.html' %}
{% if not perms.kfet.add_account %} -
- -
- -
-
+ {% include 'kfet/form_authentication_snippet.html' %} {% endif %} diff --git a/kfet/templates/kfet/account_create_form.html b/kfet/templates/kfet/account_create_form.html index 26e4175b..aa040058 100644 --- a/kfet/templates/kfet/account_create_form.html +++ b/kfet/templates/kfet/account_create_form.html @@ -1,39 +1,9 @@ {% load widget_tweaks %} -{% for field in user_form %} -
- -
- {{ field|add_class:'form-control' }} - {{ field.errors }} -
-
-{% endfor %} - -{% for field in cof_form %} -
- -
- {{ field|add_class:'form-control' }} - {{ field.errors }} -
-
-{% endfor %} - -{% for field in account_form %} -
- -
- {{ field|add_class:'form-control' }} - {{ field.errors }} -
-
-{% endfor %} +{% include 'kfet/form_snippet.html' with form=user_form %} +{% include 'kfet/form_snippet.html' with form=cof_form %} +{% include 'kfet/form_snippet.html' with form=account_form %} {% if user_form %} -
-
- -
-
+ {% include 'kfet/form_submit_snippet.html' with value="Enregistrer" %} {% endif %} diff --git a/kfet/templates/kfet/account_update.html b/kfet/templates/kfet/account_update.html index 83e56934..faacfe4b 100644 --- a/kfet/templates/kfet/account_update.html +++ b/kfet/templates/kfet/account_update.html @@ -1,4 +1,6 @@ {% extends "kfet/base.html" %} +{% load widget_tweaks %} +{% load staticfiles %} {% block extra_head %} {{ negative_form.media }} @@ -22,38 +24,24 @@ {% block content %} -
-
-
- {% include 'kfet/left_account.html' %} -
-
-
- {% include "kfet/base_messages.html" %} -
-
-
- {% csrf_token %} - {{ user_form.as_p }} - {{ cof_form.as_p }} - {{ account_form.as_p }} - {{ group_form.as_p }} - {{ pwd_form.as_p }} - {{ negative_form.non_field_errors }} - {% for field in negative_form %} - {{ field.errors }} - {{ field.label_tag }} -
{{ field }}
- {% if field.help_text %} -

{{ field.help_text|safe }}

- {% endif %} - {% endfor %} - {% if perms.kfet.is_team %} - - {% endif %} - -
-
+{% include "kfet/base_messages.html" %} + +
+
+
+
+ {% csrf_token %} + {% include 'kfet/form_snippet.html' with form=user_form %} + {% include 'kfet/form_snippet.html' with form=cof_form %} + {% include 'kfet/form_snippet.html' with form=account_form %} + {% include 'kfet/form_snippet.html' with form=group_form %} + {% include 'kfet/form_snippet.html' with form=pwd_form %} + {% include 'kfet/form_snippet.html' with form=negative_form %} + {% if perms.kfet.is_team %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} + {% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %} +
diff --git a/kfet/templates/kfet/form_authentication_snippet.html b/kfet/templates/kfet/form_authentication_snippet.html new file mode 100644 index 00000000..d3eb2496 --- /dev/null +++ b/kfet/templates/kfet/form_authentication_snippet.html @@ -0,0 +1,6 @@ +
+ +
+ +
+
diff --git a/kfet/templates/kfet/form_field_snippet.html b/kfet/templates/kfet/form_field_snippet.html new file mode 100644 index 00000000..92ec385d --- /dev/null +++ b/kfet/templates/kfet/form_field_snippet.html @@ -0,0 +1,9 @@ +{% load widget_tweaks %} + +
+ +
+ {{ field|add_class:'form-control' }} + {{ field.errors }} +
+
diff --git a/kfet/templates/kfet/form_snippet.html b/kfet/templates/kfet/form_snippet.html new file mode 100644 index 00000000..2f6d9c7c --- /dev/null +++ b/kfet/templates/kfet/form_snippet.html @@ -0,0 +1,3 @@ +{% for field in form %} + {% include 'kfet/form_field_snippet.html' with field=field %} +{% endfor %} diff --git a/kfet/templates/kfet/form_submit_snippet.html b/kfet/templates/kfet/form_submit_snippet.html new file mode 100644 index 00000000..fba168da --- /dev/null +++ b/kfet/templates/kfet/form_submit_snippet.html @@ -0,0 +1,5 @@ +
+
+ +
+
diff --git a/kfet/templates/kfet/history.html b/kfet/templates/kfet/history.html index 5b78a8b7..881a5fa9 100644 --- a/kfet/templates/kfet/history.html +++ b/kfet/templates/kfet/history.html @@ -213,7 +213,8 @@ $(document).ready(function() { content += ''; } if ('negative' in data['errors']) - content += 'Autorisation de négatif requise'; + for (var i=0; iAutorisation de négatif requise pour '+data['errors']['negative'][i]+''; return content; }