Idem for supplier_form

This commit is contained in:
Ludovic Stephan 2017-03-30 21:16:47 -03:00
parent 91d5fe234c
commit c1b8849cb8
2 changed files with 21 additions and 13 deletions

View file

@ -427,11 +427,11 @@ class Supplier(models.Model):
Article, Article,
through = 'SupplierArticle', through = 'SupplierArticle',
related_name = "suppliers") related_name = "suppliers")
name = models.CharField(max_length = 45) name = models.CharField("nom", max_length = 45)
address = models.TextField() address = models.TextField("adresse")
email = models.EmailField() email = models.EmailField("adresse mail")
phone = models.CharField(max_length = 10) phone = models.CharField("téléphone", max_length = 10)
comment = models.TextField() comment = models.TextField("commentaire")
def __str__(self): def __str__(self):
return self.name return self.name

View file

@ -1,4 +1,6 @@
{% extends 'kfet/base.html' %} {% extends 'kfet/base.html' %}
{% load widget_tweaks %}
{% load staticfiles %}
{% block title %}Fournisseur - Modification{% endblock %} {% block title %}Fournisseur - Modification{% endblock %}
{% block content-header-title %}Fournisseur - Modification{% endblock %} {% block content-header-title %}Fournisseur - Modification{% endblock %}
@ -7,13 +9,19 @@
{% include 'kfet/base_messages.html' %} {% include 'kfet/base_messages.html' %}
<form action="" method="post"> <div class="row form-only">
{% csrf_token %} <div class="col-sm-12 col-md-8 col-md-offset-2">
{{ form.as_p }} <div class="content-form">
{% if not perms.kfet.change_supplier %} <form submit="" method="post" class="form-horizontal">
<input type="password" name="KFETPASSWORD"> {% csrf_token %}
{% endif %} {% include 'kfet/form_snippet.html' with form=form %}
<input type="submit" class="btn btn-primary btn-lg"> {% if not perms.kfet.change_supplier %}
</form> {% include 'kfet/form_authentication_snippet.html' %}
{% endif %}
{% include 'kfet/form_submit_snippet.html' with value="Mettre à jour" %}
</form>
</div>
</div>
</div>
{% endblock %} {% endblock %}