From 8de5c32c4846b0382ded05ddb633ab67e5e062c8 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 1 Jun 2021 16:34:08 +0300 Subject: templates: edit_trait: Only submit form elements that have changed We only submit form elements that have changed, and use that to update the relevant tables. See: https://stackoverflow.com/a/5221915 --- wqflask/wqflask/templates/edit_trait.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wqflask/wqflask/templates/edit_trait.html b/wqflask/wqflask/templates/edit_trait.html index 2cd8a6fd..05bdebd1 100644 --- a/wqflask/wqflask/templates/edit_trait.html +++ b/wqflask/wqflask/templates/edit_trait.html @@ -162,5 +162,13 @@ Submit Trait | Reset {% block js %} {% endblock %} -- cgit v1.2.3 From 23c9d5eef66f159c422b136be9a837b6700208a4 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 1 Jun 2021 16:40:16 +0300 Subject: templates: edit_trait: Add "changed" class to hidden input values When a form element changes, it's marked as changed. Only input elements with "changed" get submitted. Since we need to submit the "hidden" input fields, we add "changed" to them anyways. --- wqflask/wqflask/templates/edit_trait.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wqflask/wqflask/templates/edit_trait.html b/wqflask/wqflask/templates/edit_trait.html index 05bdebd1..393b8c39 100644 --- a/wqflask/wqflask/templates/edit_trait.html +++ b/wqflask/wqflask/templates/edit_trait.html @@ -148,12 +148,12 @@ Submit Trait | Reset