From c0fe72ccd019f2b172533e969a746abfe86ba98b Mon Sep 17 00:00:00 2001 From: Son Nguyen Kim Date: Thu, 22 Jul 2021 10:30:17 +0200 Subject: [PATCH] user can change the expand_alias setting --- .../templates/dashboard/setting.html | 21 +++++++++++++++++++ app/dashboard/views/setting.py | 10 +++++++++ 2 files changed, 31 insertions(+) diff --git a/app/dashboard/templates/dashboard/setting.html b/app/dashboard/templates/dashboard/setting.html index 9df346df..ed3cb21b 100644 --- a/app/dashboard/templates/dashboard/setting.html +++ b/app/dashboard/templates/dashboard/setting.html @@ -368,6 +368,27 @@ + +
+
+
Always expand alias info
+
+ By default, additional alias info is shown after clicking on the "More" button.
+ When this option is enabled, alias additional info will always be shown.
+
+
+ +
+ + +
+ +
+
+
+ +
Quarantine
diff --git a/app/dashboard/views/setting.py b/app/dashboard/views/setting.py index c8db8202..43988ffc 100644 --- a/app/dashboard/views/setting.py +++ b/app/dashboard/views/setting.py @@ -284,6 +284,16 @@ def setting(): flash("Your preference has been updated", "success") return redirect(url_for("dashboard.setting")) + elif request.form.get("form-name") == "expand-alias-info": + choose = request.form.get("enable") + if choose == "on": + current_user.expand_alias_info = True + else: + current_user.expand_alias_info = False + db.session.commit() + flash("Your preference has been updated", "success") + return redirect(url_for("dashboard.setting")) + elif request.form.get("form-name") == "export-data": return redirect(url_for("api.export_data")) elif request.form.get("form-name") == "export-alias":