From c1b8849cb899eca3203143af6d98180d7c310576 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 21:16:47 -0300 Subject: [PATCH] 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 %}