From 3add9b0a3377590bcc2cd29487ba90de83eeb3a6 Mon Sep 17 00:00:00 2001 From: terrtia Date: Fri, 8 Dec 2023 16:05:10 +0100 Subject: [PATCH] chg: [tags] search messages by tags --- var/www/blueprints/tags_ui.py | 11 +++++++++- var/www/templates/tags/menu_sidebar.html | 6 ++++++ .../templates/tags/search_obj_by_tags.html | 21 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/var/www/blueprints/tags_ui.py b/var/www/blueprints/tags_ui.py index 7199b98c..f833ab16 100644 --- a/var/www/blueprints/tags_ui.py +++ b/var/www/blueprints/tags_ui.py @@ -275,6 +275,15 @@ def tags_search_items(): dict_tagged['date'] = Date.sanitise_date_range('', '', separator='-') return render_template("tags/search_obj_by_tags.html", bootstrap_label=bootstrap_label, dict_tagged=dict_tagged) +@tags_ui.route('/tag/search/message') +@login_required +@login_read_only +def tags_search_messages(): + object_type = 'message' + dict_tagged = {"object_type": object_type, "object_name": object_type.title() + "s"} + dict_tagged['date'] = Date.sanitise_date_range('', '', separator='-') + return render_template("tags/search_obj_by_tags.html", bootstrap_label=bootstrap_label, dict_tagged=dict_tagged) + @tags_ui.route('/tag/search/domain') @login_required @login_read_only @@ -337,7 +346,7 @@ def get_obj_by_tags(): # TODO REPLACE ME dict_obj = Tag.get_obj_by_tags(object_type, list_tag, date_from=date_from, date_to=date_to, page=page) - print(dict_obj) + # print(dict_obj) if dict_obj['tagged_obj']: dict_tagged = {"object_type": object_type, "object_name": object_type.title() + "s", diff --git a/var/www/templates/tags/menu_sidebar.html b/var/www/templates/tags/menu_sidebar.html index f9da0d41..b4da0792 100644 --- a/var/www/templates/tags/menu_sidebar.html +++ b/var/www/templates/tags/menu_sidebar.html @@ -16,6 +16,12 @@ Search Items by Tags +