From c5fe188b282475d1ddc3639fd5923c19dcde5004 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 4 Dec 2024 18:25:26 +0100 Subject: [PATCH] UI - Make 'tag' sticky - redirect to current tag on edit or add watch (#2824 #2785) --- changedetectionio/flask_app.py | 6 +++--- changedetectionio/templates/edit.html | 2 +- changedetectionio/templates/watch-overview.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index e496fccd..7d0c9d5c 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -841,7 +841,7 @@ def changedetection_app(config=None, datastore_o=None): if request.args.get("next") and request.args.get("next") == 'diff': return redirect(url_for('diff_history_page', uuid=uuid)) - return redirect(url_for('index')) + return redirect(url_for('index', tag=request.args.get("tag",''))) else: if request.method == 'POST' and not form.validate(): @@ -1395,13 +1395,13 @@ def changedetection_app(config=None, datastore_o=None): if new_uuid: if add_paused: flash('Watch added in Paused state, saving will unpause.') - return redirect(url_for('edit_page', uuid=new_uuid, unpause_on_save=1)) + return redirect(url_for('edit_page', uuid=new_uuid, unpause_on_save=1, tag=request.args.get('tag'))) else: # Straight into the queue. update_q.put(queuedWatchMetaData.PrioritizedItem(priority=1, item={'uuid': new_uuid})) flash("Watch added.") - return redirect(url_for('index')) + return redirect(url_for('index', tag=request.args.get('tag',''))) diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 2e7896c8..f970e608 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -59,7 +59,7 @@
+ action="{{ url_for('edit_page', uuid=uuid, next = request.args.get('next'), unpause_on_save = request.args.get('unpause_on_save'), tag = request.args.get('tag')) }}" method="POST">
diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index 9e075089..6a0a5067 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -6,7 +6,7 @@
- +
Add a new change detection watch @@ -187,7 +187,7 @@ {% if watch.uuid in queued_uuids %}Queued{% else %}Recheck{% endif %} - Edit + Edit {% if watch.history_n >= 2 %} {% if is_unviewed %}