From d497db639e709cb7ba17621d248ca4bea734649b Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 14 Sep 2023 14:16:08 +0200 Subject: [PATCH] UI - Notifications - Tidyup - Hide the notification tokens but show with a button/link --- changedetectionio/static/js/global-settings.js | 5 +++++ changedetectionio/static/js/watch-settings.js | 4 ++++ .../templates/_common_fields.jinja | 18 +++++++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/changedetectionio/static/js/global-settings.js b/changedetectionio/static/js/global-settings.js index dc7818bb..16ba33e1 100644 --- a/changedetectionio/static/js/global-settings.js +++ b/changedetectionio/static/js/global-settings.js @@ -32,5 +32,10 @@ $(document).ready(function () { window.getSelection().removeAllRanges(); }); + + $("#notification-token-toggle").click(function (e) { + e.preventDefault(); + $('#notification-tokens-info').toggle(); + }); }); diff --git a/changedetectionio/static/js/watch-settings.js b/changedetectionio/static/js/watch-settings.js index 353b23a3..0b419959 100644 --- a/changedetectionio/static/js/watch-settings.js +++ b/changedetectionio/static/js/watch-settings.js @@ -42,4 +42,8 @@ $(document).ready(function () { $('#notification_urls').val(''); e.preventDefault(); }); + $("#notification-token-toggle").click(function (e) { + e.preventDefault(); + $('#notification-tokens-info').toggle(); + }); }); diff --git a/changedetectionio/templates/_common_fields.jinja b/changedetectionio/templates/_common_fields.jinja index 33b9bbe5..8745ae48 100644 --- a/changedetectionio/templates/_common_fields.jinja +++ b/changedetectionio/templates/_common_fields.jinja @@ -35,18 +35,19 @@
{{ render_field(form.notification_body , rows=5, class="notification-body", placeholder=settings_application['notification_body']) }} - Body for all notifications + Body for all notifications ‐ You can use Jinja2 templating in the notification title, body and URL, and tokens from below. + + +
+
+
Show token/placeholders
{{ render_field(form.notification_format , class="notification-format") }} Format for all notifications
-
-

- You can use Jinja2 templating in the notification title, body and URL. -

- +