diff --git a/copanier/models.py b/copanier/models.py index 774cc4a..be05223 100644 --- a/copanier/models.py +++ b/copanier/models.py @@ -210,6 +210,7 @@ class Producer(Base): referent_name: str = "" contact: str = "" description: str = "" + practical_info: str = "" def has_active_products(self, delivery): products = delivery.get_products_by(self.id) diff --git a/copanier/static/app.css b/copanier/static/app.css index bb6a700..b5cc6b3 100644 --- a/copanier/static/app.css +++ b/copanier/static/app.css @@ -258,6 +258,13 @@ textarea { box-sizing: border-box; } +textarea { + /* override 2rem from the previous rule to enable textareas to size themselves automatically, + and/or using the `rows` attribute: */ + height: auto; + resize: vertical; +} + select { -webkit-appearance: none; -moz-appearance: none; diff --git a/copanier/templates/products/edit_producer.html b/copanier/templates/products/edit_producer.html index 7142dbb..a046d13 100644 --- a/copanier/templates/products/edit_producer.html +++ b/copanier/templates/products/edit_producer.html @@ -34,37 +34,56 @@ {% endif %}
- {% if producer.id %} - - {% else %} -
- - -
- {% endif %} -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
+ {% if producer.id %} + + {% else %} +
+ + +
+ {% endif %} + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
diff --git a/copanier/views/products.py b/copanier/views/products.py index ba7071e..9ec73ed 100644 --- a/copanier/views/products.py +++ b/copanier/views/products.py @@ -70,6 +70,7 @@ async def edit_producer(request, response, delivery_id, producer_id): producer.referent_name = form.get("referent_name") producer.description = form.get("description") producer.contact = form.get("contact") + producer.practical_info = form.get("practical_info") delivery.producers[producer_id] = producer delivery.persist()