From 6301edf4bbcd324ff7cb402ee76aa55645b308d3 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Tue, 3 Dec 2024 15:01:16 -0300 Subject: [PATCH] added Sortable js for state definitions list --- admin/templates/states_panel.html | 76 +++++++++++++++++++++++-------- dashboard/templates/base.html | 1 + 2 files changed, 59 insertions(+), 18 deletions(-) diff --git a/admin/templates/states_panel.html b/admin/templates/states_panel.html index c546f6e..77d36ea 100644 --- a/admin/templates/states_panel.html +++ b/admin/templates/states_panel.html @@ -17,22 +17,37 @@

{% trans "State Definitions" %}

{% if state_definitions %} - - {% else %} +

{% trans "Move state definitions to reorder" %}

+ + + + + + + + + + {% for state_definition in state_definitions %} + + + + + + {% endfor %} + +
{% trans "Order" %}{% trans "State" %}
{{ state_definition.order }}{{ state_definition.state }} + +
+
+ {% csrf_token %} + + +
+ + + {% else %} @@ -69,7 +84,6 @@
-{% if state_definitions %} {% for state_definition in state_definitions %} {% endfor %} -{% endif %} + + + + {% endblock %} diff --git a/dashboard/templates/base.html b/dashboard/templates/base.html index 004e805..d9179d9 100644 --- a/dashboard/templates/base.html +++ b/dashboard/templates/base.html @@ -18,6 +18,7 @@ +