From 079666c0db3854ca0ade03290804aaf784da0053 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 19:32:11 -0300 Subject: [PATCH 01/11] Use verbose names and form snippets for article_create --- kfet/forms.py | 4 ++++ kfet/models.py | 12 ++++++---- kfet/templates/kfet/article_create.html | 26 ++++++++++++++------- kfet/templates/kfet/form_field_snippet.html | 1 + 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/kfet/forms.py b/kfet/forms.py index 2b59e1b3..8bf9fbcf 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -235,16 +235,20 @@ class CheckoutStatementUpdateForm(forms.ModelForm): class ArticleForm(forms.ModelForm): category_new = forms.CharField( + label="Créer une catégorie", max_length=45, required = False) category = forms.ModelChoiceField( + label="Catégorie", queryset = ArticleCategory.objects.all(), required = False) suppliers = forms.ModelMultipleChoiceField( + label="Fournisseurs", queryset = Supplier.objects.all(), required = False) supplier_new = forms.CharField( + label="Créer un fournisseur", max_length = 45, required = False) diff --git a/kfet/models.py b/kfet/models.py index b4af61c1..92a547c1 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -336,19 +336,21 @@ class ArticleCategory(models.Model): @python_2_unicode_compatible class Article(models.Model): - name = models.CharField(max_length = 45) - is_sold = models.BooleanField(default = True) - hidden = models.BooleanField(default=False, + name = models.CharField("nom", max_length = 45) + is_sold = models.BooleanField("en vente", default = True) + hidden = models.BooleanField("caché", + default=False, help_text="Si oui, ne sera pas affiché " "au public ; par exemple " "sur la carte.") price = models.DecimalField( + "prix", max_digits = 6, decimal_places = 2, default = 0) stock = models.IntegerField(default = 0) category = models.ForeignKey( ArticleCategory, on_delete = models.PROTECT, - related_name = "articles") + related_name = "articles", verbose_name='catégorie') BOX_TYPE_CHOICES = ( ("caisse", "caisse"), ("carton", "carton"), @@ -356,10 +358,12 @@ class Article(models.Model): ("fût", "fût"), ) box_type = models.CharField( + "type de contenant", choices = BOX_TYPE_CHOICES, max_length = choices_length(BOX_TYPE_CHOICES), blank = True, null = True, default = None) box_capacity = models.PositiveSmallIntegerField( + "capacité du contenant", blank = True, null = True, default = None) def __str__(self): diff --git a/kfet/templates/kfet/article_create.html b/kfet/templates/kfet/article_create.html index 742756b2..71672f8c 100644 --- a/kfet/templates/kfet/article_create.html +++ b/kfet/templates/kfet/article_create.html @@ -1,17 +1,27 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} +{% load staticfiles %} {% block title %}Nouvel article{% endblock %} {% block content-header-title %}Création d'un article{% endblock %} {% block content %} -
- {% csrf_token %} - {{ form.as_p }} - {% if not perms.kfet.add_article %} - - {% endif %} - -
+{% include "kfet/base_messages.html" %} + +
+
+
+
+ {% csrf_token %} + {% include 'kfet/form_snippet.html' with form=form %} + {% if not perms.kfet.add_article %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} + {% include 'kfet/form_submit_snippet.html' with value="Enregistrer" %} +
+
+
+
{% endblock %} diff --git a/kfet/templates/kfet/form_field_snippet.html b/kfet/templates/kfet/form_field_snippet.html index 92ec385d..705427fe 100644 --- a/kfet/templates/kfet/form_field_snippet.html +++ b/kfet/templates/kfet/form_field_snippet.html @@ -4,6 +4,7 @@
{{ field|add_class:'form-control' }} + {{field.help_text}} {{ field.errors }}
From 8e65298c7cd90db23014af1245bf363da44e90f1 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 19:34:22 -0300 Subject: [PATCH 02/11] Idem for article_update --- kfet/templates/kfet/article_update.html | 26 +++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/kfet/templates/kfet/article_update.html b/kfet/templates/kfet/article_update.html index db0107cc..f4260a97 100644 --- a/kfet/templates/kfet/article_update.html +++ b/kfet/templates/kfet/article_update.html @@ -1,17 +1,27 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} +{% load staticfiles %} {% block title %}Édition de l'article {{ article.name }}{% endblock %} {% block content-header-title %}Article {{ article.name }} - Édition{% endblock %} {% block content %} -
- {% csrf_token %} - {{ form.as_p }} - {% if not perms.kfet.change_article %} - - {% endif %} - -
+{% include "kfet/base_messages.html" %} + +
+
+
+
+ {% csrf_token %} + {% include 'kfet/form_snippet.html' with form=form %} + {% if not perms.kfet.add_article %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} + {% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %} +
+
+
+
{% endblock %} From 91d5fe234c9172a6e3702ea017ffdbe314529dd7 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 21:10:50 -0300 Subject: [PATCH 03/11] Idem for checkoutstatements --- kfet/models.py | 48 +++++++++++-------- kfet/templates/kfet/article_update.html | 2 +- .../kfet/checkoutstatement_create.html | 2 +- .../kfet/checkoutstatement_update.html | 12 ++--- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/kfet/models.py b/kfet/models.py index 92a547c1..624f9deb 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -273,29 +273,35 @@ class CheckoutStatement(models.Model): checkout = models.ForeignKey( Checkout, on_delete = models.PROTECT, related_name = "statements") - balance_old = models.DecimalField(max_digits = 6, decimal_places = 2) - balance_new = models.DecimalField(max_digits = 6, decimal_places = 2) - amount_taken = models.DecimalField(max_digits = 6, decimal_places = 2) - amount_error = models.DecimalField(max_digits = 6, decimal_places = 2) + balance_old = models.DecimalField("Ancienne balance", + max_digits = 6, decimal_places = 2) + balance_new = models.DecimalField("Nouvelle balance", + max_digits = 6, decimal_places = 2) + amount_taken = models.DecimalField("Montant pris", + max_digits = 6, decimal_places = 2) + amount_error = models.DecimalField("Montant de l'erreur", + max_digits = 6, decimal_places = 2) at = models.DateTimeField(auto_now_add = True) - not_count = models.BooleanField(default=False) + not_count = models.BooleanField("Caisse non comptée", default=False) - taken_001 = models.PositiveSmallIntegerField(default=0) - taken_002 = models.PositiveSmallIntegerField(default=0) - taken_005 = models.PositiveSmallIntegerField(default=0) - taken_01 = models.PositiveSmallIntegerField(default=0) - taken_02 = models.PositiveSmallIntegerField(default=0) - taken_05 = models.PositiveSmallIntegerField(default=0) - taken_1 = models.PositiveSmallIntegerField(default=0) - taken_2 = models.PositiveSmallIntegerField(default=0) - taken_5 = models.PositiveSmallIntegerField(default=0) - taken_10 = models.PositiveSmallIntegerField(default=0) - taken_20 = models.PositiveSmallIntegerField(default=0) - taken_50 = models.PositiveSmallIntegerField(default=0) - taken_100 = models.PositiveSmallIntegerField(default=0) - taken_200 = models.PositiveSmallIntegerField(default=0) - taken_500 = models.PositiveSmallIntegerField(default=0) - taken_cheque = models.DecimalField(default=0, max_digits=6, decimal_places=2) + taken_001 = models.PositiveSmallIntegerField("Pièces de 1¢", default=0) + taken_002 = models.PositiveSmallIntegerField("Pièces de 2¢", default=0) + taken_005 = models.PositiveSmallIntegerField("Pièces de 5¢", default=0) + taken_01 = models.PositiveSmallIntegerField("Pièces de 10¢", default=0) + taken_02 = models.PositiveSmallIntegerField("Pièces de 20¢", default=0) + taken_05 = models.PositiveSmallIntegerField("Pièces de 50¢", default=0) + taken_1 = models.PositiveSmallIntegerField("Pièces de 1€", default=0) + taken_2 = models.PositiveSmallIntegerField("Pièces de 2€", default=0) + taken_5 = models.PositiveSmallIntegerField("Billets de 5€", default=0) + taken_10 = models.PositiveSmallIntegerField("Billets de 10€", default=0) + taken_20 = models.PositiveSmallIntegerField("Billets de 20€", default=0) + taken_50 = models.PositiveSmallIntegerField("Billets de 50€", default=0) + taken_100 = models.PositiveSmallIntegerField("Billets de 100€", default=0) + taken_200 = models.PositiveSmallIntegerField("Billets de 200€", default=0) + taken_500 = models.PositiveSmallIntegerField("Billets de 500€", default=0) + taken_cheque = models.DecimalField( + "Montant des chèques", + default=0, max_digits=6, decimal_places=2) def __str__(self): return '%s %s' % (self.checkout, self.at) diff --git a/kfet/templates/kfet/article_update.html b/kfet/templates/kfet/article_update.html index f4260a97..85a29f6b 100644 --- a/kfet/templates/kfet/article_update.html +++ b/kfet/templates/kfet/article_update.html @@ -15,7 +15,7 @@
{% csrf_token %} {% include 'kfet/form_snippet.html' with form=form %} - {% if not perms.kfet.add_article %} + {% if not perms.kfet.change_article %} {% include 'kfet/form_authentication_snippet.html' %} {% endif %} {% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %} diff --git a/kfet/templates/kfet/checkoutstatement_create.html b/kfet/templates/kfet/checkoutstatement_create.html index 0edb66ad..8ed57017 100644 --- a/kfet/templates/kfet/checkoutstatement_create.html +++ b/kfet/templates/kfet/checkoutstatement_create.html @@ -80,7 +80,7 @@ - Chèque: +

Chèque:

diff --git a/kfet/templates/kfet/checkoutstatement_update.html b/kfet/templates/kfet/checkoutstatement_update.html index 18d8938f..fd35b959 100644 --- a/kfet/templates/kfet/checkoutstatement_update.html +++ b/kfet/templates/kfet/checkoutstatement_update.html @@ -15,15 +15,15 @@ Caisse {{ checkout.name }} - Modification relevé {{ checkoutstatement.at }}
{% include 'kfet/base_messages.html' %} -
-
- +
+
+ {% csrf_token %} - {{ form.as_p }} + {% include 'kfet/form_snippet.html' with form=form %} {% if not perms.kfet.change_checkoutstatement %} - + {% include 'kfet/form_authentication_snippet.html' %} {% endif %} - + {% include 'kfet/form_submit_snippet.html' with value="Enregistrer" %}
From c1b8849cb899eca3203143af6d98180d7c310576 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 21:16:47 -0300 Subject: [PATCH 04/11] Idem for supplier_form --- kfet/models.py | 10 +++++----- kfet/templates/kfet/supplier_form.html | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/kfet/models.py b/kfet/models.py index 624f9deb..1fec62a0 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -427,11 +427,11 @@ class Supplier(models.Model): Article, through = 'SupplierArticle', related_name = "suppliers") - name = models.CharField(max_length = 45) - address = models.TextField() - email = models.EmailField() - phone = models.CharField(max_length = 10) - comment = models.TextField() + name = models.CharField("nom", max_length = 45) + address = models.TextField("adresse") + email = models.EmailField("adresse mail") + phone = models.CharField("téléphone", max_length = 10) + comment = models.TextField("commentaire") def __str__(self): return self.name diff --git a/kfet/templates/kfet/supplier_form.html b/kfet/templates/kfet/supplier_form.html index d1e10a5c..168f74d9 100644 --- a/kfet/templates/kfet/supplier_form.html +++ b/kfet/templates/kfet/supplier_form.html @@ -1,4 +1,6 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} +{% load staticfiles %} {% block title %}Fournisseur - Modification{% endblock %} {% block content-header-title %}Fournisseur - Modification{% endblock %} @@ -7,13 +9,19 @@ {% include 'kfet/base_messages.html' %} -
- {% csrf_token %} - {{ form.as_p }} - {% if not perms.kfet.change_supplier %} - - {% endif %} - -
+
+
+
+
+ {% csrf_token %} + {% include 'kfet/form_snippet.html' with form=form %} + {% if not perms.kfet.change_supplier %} + {% include 'kfet/form_authentication_snippet.html' %} + {% endif %} + {% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %} +
+
+
+
{% endblock %} From 20561eb515a6f78a52e1b00fe4e24ab904d12539 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 21:31:16 -0300 Subject: [PATCH 05/11] Idem for account_update --- kfet/forms.py | 3 +++ kfet/models.py | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/kfet/forms.py b/kfet/forms.py index 8bf9fbcf..600367f7 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -74,8 +74,10 @@ class AccountRestrictForm(AccountForm): class AccountPwdForm(forms.Form): pwd1 = forms.CharField( + label="Mot de passe K-Fêt", widget=forms.PasswordInput) pwd2 = forms.CharField( + label="Confirmer le mot de passe", widget=forms.PasswordInput) def clean(self): @@ -128,6 +130,7 @@ class UserRestrictTeamForm(UserForm): class UserGroupForm(forms.ModelForm): groups = forms.ModelMultipleChoiceField( Group.objects.filter(name__icontains='K-Fêt'), + label='Statut équipe', required=False) def clean_groups(self): diff --git a/kfet/models.py b/kfet/models.py index 1fec62a0..907bf047 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -40,7 +40,7 @@ class Account(models.Model): balance = models.DecimalField( max_digits = 6, decimal_places = 2, default = 0) - is_frozen = models.BooleanField(default = False) + is_frozen = models.BooleanField("est gelé", default = False) created_at = models.DateTimeField(auto_now_add = True, null = True) # Optional PROMO_CHOICES = [(r,r) for r in range(1980, date.today().year+1)] @@ -48,6 +48,7 @@ class Account(models.Model): choices = PROMO_CHOICES, blank = True, null = True, default = default_promo()) nickname = models.CharField( + "surnom(s)", max_length = 255, blank = True, default = "") password = models.CharField( @@ -224,14 +225,18 @@ class AccountNegative(models.Model): start = models.DateTimeField( blank = True, null = True, default = None) balance_offset = models.DecimalField( + "décalage de balance", + help_text="Montant non compris dans l'autorisation de négatif", max_digits = 6, decimal_places = 2, blank = True, null = True, default = None) authz_overdraft_amount = models.DecimalField( + "négatif autorisé", max_digits = 6, decimal_places = 2, blank = True, null = True, default = None) authz_overdraft_until = models.DateTimeField( + "expiration du négatif", blank = True, null = True, default = None) - comment = models.CharField(max_length = 255, blank = True) + comment = models.CharField("commentaire", max_length = 255, blank = True) @python_2_unicode_compatible class Checkout(models.Model): From ebf133d9af276dde656bb2241a52745c4947d737 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 21:38:16 -0300 Subject: [PATCH 06/11] Lowercase model verbose names --- kfet/models.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/kfet/models.py b/kfet/models.py index 907bf047..29ae57b6 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -278,34 +278,34 @@ class CheckoutStatement(models.Model): checkout = models.ForeignKey( Checkout, on_delete = models.PROTECT, related_name = "statements") - balance_old = models.DecimalField("Ancienne balance", + balance_old = models.DecimalField("ancienne balance", max_digits = 6, decimal_places = 2) - balance_new = models.DecimalField("Nouvelle balance", + balance_new = models.DecimalField("nouvelle balance", max_digits = 6, decimal_places = 2) - amount_taken = models.DecimalField("Montant pris", + amount_taken = models.DecimalField("montant pris", max_digits = 6, decimal_places = 2) - amount_error = models.DecimalField("Montant de l'erreur", + amount_error = models.DecimalField("montant de l'erreur", max_digits = 6, decimal_places = 2) at = models.DateTimeField(auto_now_add = True) - not_count = models.BooleanField("Caisse non comptée", default=False) + not_count = models.BooleanField("caisse non comptée", default=False) - taken_001 = models.PositiveSmallIntegerField("Pièces de 1¢", default=0) - taken_002 = models.PositiveSmallIntegerField("Pièces de 2¢", default=0) - taken_005 = models.PositiveSmallIntegerField("Pièces de 5¢", default=0) - taken_01 = models.PositiveSmallIntegerField("Pièces de 10¢", default=0) - taken_02 = models.PositiveSmallIntegerField("Pièces de 20¢", default=0) - taken_05 = models.PositiveSmallIntegerField("Pièces de 50¢", default=0) - taken_1 = models.PositiveSmallIntegerField("Pièces de 1€", default=0) - taken_2 = models.PositiveSmallIntegerField("Pièces de 2€", default=0) - taken_5 = models.PositiveSmallIntegerField("Billets de 5€", default=0) - taken_10 = models.PositiveSmallIntegerField("Billets de 10€", default=0) - taken_20 = models.PositiveSmallIntegerField("Billets de 20€", default=0) - taken_50 = models.PositiveSmallIntegerField("Billets de 50€", default=0) - taken_100 = models.PositiveSmallIntegerField("Billets de 100€", default=0) - taken_200 = models.PositiveSmallIntegerField("Billets de 200€", default=0) - taken_500 = models.PositiveSmallIntegerField("Billets de 500€", default=0) + taken_001 = models.PositiveSmallIntegerField("pièces de 1¢", default=0) + taken_002 = models.PositiveSmallIntegerField("pièces de 2¢", default=0) + taken_005 = models.PositiveSmallIntegerField("pièces de 5¢", default=0) + taken_01 = models.PositiveSmallIntegerField("pièces de 10¢", default=0) + taken_02 = models.PositiveSmallIntegerField("pièces de 20¢", default=0) + taken_05 = models.PositiveSmallIntegerField("pièces de 50¢", default=0) + taken_1 = models.PositiveSmallIntegerField("pièces de 1€", default=0) + taken_2 = models.PositiveSmallIntegerField("pièces de 2€", default=0) + taken_5 = models.PositiveSmallIntegerField("billets de 5€", default=0) + taken_10 = models.PositiveSmallIntegerField("billets de 10€", default=0) + taken_20 = models.PositiveSmallIntegerField("billets de 20€", default=0) + taken_50 = models.PositiveSmallIntegerField("billets de 50€", default=0) + taken_100 = models.PositiveSmallIntegerField("billets de 100€", default=0) + taken_200 = models.PositiveSmallIntegerField("billets de 200€", default=0) + taken_500 = models.PositiveSmallIntegerField("billets de 500€", default=0) taken_cheque = models.DecimalField( - "Montant des chèques", + "montant des chèques", default=0, max_digits=6, decimal_places=2) def __str__(self): From fdcd2e864ce8a7ecc055a04709e648eb765e52f3 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Fri, 31 Mar 2017 11:24:38 -0300 Subject: [PATCH 07/11] Use widget_tweaks everywhere --- kfet/forms.py | 16 +++++----------- kfet/templates/kfet/order_create.html | 3 ++- kfet/templates/kfet/order_to_inventory.html | 9 +++++---- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/kfet/forms.py b/kfet/forms.py index 600367f7..5b56c63a 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -485,9 +485,7 @@ class OrderArticleForm(forms.Form): queryset=Article.objects.all(), widget=forms.HiddenInput(), ) - quantity_ordered = forms.IntegerField( - required=False, - widget=forms.NumberInput(attrs={'class': 'form-control'})) + quantity_ordered = forms.IntegerField(required=False) def __init__(self, *args, **kwargs): super(OrderArticleForm, self).__init__(*args, **kwargs) @@ -514,18 +512,14 @@ class OrderArticleToInventoryForm(forms.Form): ) price_HT = forms.DecimalField( max_digits = 7, decimal_places = 4, - required = False, - widget=forms.NumberInput(attrs={'class': 'form-control'})) + required = False) TVA = forms.DecimalField( max_digits = 7, decimal_places = 2, - required = False, - widget=forms.NumberInput(attrs={'class': 'form-control'})) + required = False) rights = forms.DecimalField( max_digits = 7, decimal_places = 4, - required = False, - widget=forms.NumberInput(attrs={'class': 'form-control'})) - quantity_received = forms.IntegerField( - widget=forms.NumberInput(attrs={'class': 'form-control'})) + required = False) + quantity_received = forms.IntegerField() def __init__(self, *args, **kwargs): super(OrderArticleToInventoryForm, self).__init__(*args, **kwargs) diff --git a/kfet/templates/kfet/order_create.html b/kfet/templates/kfet/order_create.html index cbd84ba8..1bd6d54f 100644 --- a/kfet/templates/kfet/order_create.html +++ b/kfet/templates/kfet/order_create.html @@ -1,4 +1,5 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} {% block title %}Nouvelle commande{% endblock %} {% block content-header-title %}Nouvelle commande {{ supplier.name }}{% endblock %} @@ -60,7 +61,7 @@ {{ form.v_prev }} {{ form.stock }} {{ form.c_rec }} - {{ form.quantity_ordered }} + {{ form.quantity_ordered | add_class:"form-control" }} {% endfor %} diff --git a/kfet/templates/kfet/order_to_inventory.html b/kfet/templates/kfet/order_to_inventory.html index ab107065..5fe920e9 100644 --- a/kfet/templates/kfet/order_to_inventory.html +++ b/kfet/templates/kfet/order_to_inventory.html @@ -1,4 +1,5 @@ {% extends 'kfet/base.html' %} +{% load widget_tweaks %} {% block title %}{% endblock %} {% block content-header-title %}{% endblock %} @@ -33,11 +34,11 @@ {{ form.article }} {{ form.name }} - {{ form.price_HT }} - {{ form.TVA }} - {{ form.rights }} + {{ form.price_HT | add_class:"form-control" }} + {{ form.TVA | add_class:"form-control" }} + {{ form.rights | add_class:"form-control" }} {{ form.quantity_ordered }} - {{ form.quantity_received }} + {{ form.quantity_received | add_class:"form-control" }} {% endfor %} From 49c84076deb79ea21a069b2858047963703b6d29 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Fri, 31 Mar 2017 15:01:31 -0300 Subject: [PATCH 08/11] Manage help_text and errors --- kfet/templates/kfet/form_field_snippet.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kfet/templates/kfet/form_field_snippet.html b/kfet/templates/kfet/form_field_snippet.html index 705427fe..34ebe58e 100644 --- a/kfet/templates/kfet/form_field_snippet.html +++ b/kfet/templates/kfet/form_field_snippet.html @@ -4,7 +4,10 @@
{{ field|add_class:'form-control' }} + {% if field.errors %} + {{field.errors}} + {% else %} {{field.help_text}} - {{ field.errors }} + {% endif %}
From cf03fba1cc482a2ee0c8164e4e6d5b7e1544fc28 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Fri, 31 Mar 2017 23:54:38 -0300 Subject: [PATCH 09/11] Remove whitespace by using elif --- kfet/templates/kfet/form_field_snippet.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kfet/templates/kfet/form_field_snippet.html b/kfet/templates/kfet/form_field_snippet.html index 34ebe58e..771e4185 100644 --- a/kfet/templates/kfet/form_field_snippet.html +++ b/kfet/templates/kfet/form_field_snippet.html @@ -6,7 +6,7 @@ {{ field|add_class:'form-control' }} {% if field.errors %} {{field.errors}} - {% else %} + {% elif field.help_text %} {{field.help_text}} {% endif %}
From 6797c92a1f86e88f33f0128cf05d731fee7b8704 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Sat, 1 Apr 2017 09:35:37 -0300 Subject: [PATCH 10/11] Ok ok je me rends --- kfet/templates/kfet/form_field_snippet.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kfet/templates/kfet/form_field_snippet.html b/kfet/templates/kfet/form_field_snippet.html index 771e4185..0873a481 100644 --- a/kfet/templates/kfet/form_field_snippet.html +++ b/kfet/templates/kfet/form_field_snippet.html @@ -6,7 +6,8 @@ {{ field|add_class:'form-control' }} {% if field.errors %} {{field.errors}} - {% elif field.help_text %} + {% endif %} + {% if field.help_text %} {{field.help_text}} {% endif %}
From c9973cde75d9d33caf0a218b6e7aefe2706bf1e9 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Sat, 1 Apr 2017 23:25:47 -0300 Subject: [PATCH 11/11] Help text for password length --- kfet/forms.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kfet/forms.py b/kfet/forms.py index 5b56c63a..2418c840 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -75,6 +75,7 @@ class AccountRestrictForm(AccountForm): class AccountPwdForm(forms.Form): pwd1 = forms.CharField( label="Mot de passe K-Fêt", + help_text="Le mot de passe doit contenir au moins huit caractères", widget=forms.PasswordInput) pwd2 = forms.CharField( label="Confirmer le mot de passe",