From c4f54d9d5b0bcd84ef7c2257b9e01686eecf68bd Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO
Date: Wed, 11 Mar 2020 22:51:46 +0100
Subject: [PATCH] Multiple select
---
apps/note/models/transactions.py | 1 +
apps/note/tables.py | 2 +-
templates/note/conso_form.html | 83 ++++++++++++++++++++++----------
3 files changed, 59 insertions(+), 27 deletions(-)
diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py
index 809e7c44..ed8619d6 100644
--- a/apps/note/models/transactions.py
+++ b/apps/note/models/transactions.py
@@ -132,6 +132,7 @@ class Transaction(PolymorphicModel):
if self.source.pk == self.destination.pk:
# When source == destination, no money is transfered
+ super().save(*args, **kwargs)
return
created = self.pk is None
diff --git a/apps/note/tables.py b/apps/note/tables.py
index 08a4d2d9..3306cb3b 100644
--- a/apps/note/tables.py
+++ b/apps/note/tables.py
@@ -18,7 +18,7 @@ class HistoryTable(tables.Table):
}
model = Transaction
exclude = ("polymorphic_ctype", )
- order_by = ('-created_at', )
+ order_by = ('-id', )
template_name = 'django_tables2/bootstrap4.html'
sequence = ('...', 'total', 'valid')
diff --git a/templates/note/conso_form.html b/templates/note/conso_form.html
index 89adb264..5072a1e7 100644
--- a/templates/note/conso_form.html
+++ b/templates/note/conso_form.html
@@ -30,18 +30,15 @@
Sélection des émitteurs
-
- -
- Cras justo odio
- 14
-
- -
- Dapibus ac facilisis in
- 1
-
+
- TODO: reimplement select2 here in JS
+
@@ -83,10 +80,12 @@
{% for button in category.list %}
+ {% if button.display %}
+ {% endif %}
{% endfor %}
@@ -131,10 +130,23 @@
min-width: 100%;
}
+
+
+
+
+
+
+
+
+
+
+
{% endblock %}
{% block extrajavascript %}