From 3d3654c2c13487736b85fb93a721c56cad51f47c Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 27 May 2024 12:11:27 +0200 Subject: [PATCH] UI - preview date and button fixes --- changedetectionio/flask_app.py | 2 +- changedetectionio/static/js/preview.js | 4 ++++ changedetectionio/templates/preview.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/changedetectionio/flask_app.py b/changedetectionio/flask_app.py index 41f80a77..5fc0f48d 100644 --- a/changedetectionio/flask_app.py +++ b/changedetectionio/flask_app.py @@ -127,7 +127,7 @@ def _jinja2_filter_datetimestamp(timestamp, format="%Y-%m-%d %H:%M:%S"): if timestamp == False: return 'Not yet' - return timeago.format(timestamp, time.time()) + return timeago.format(int(timestamp), time.time()) @app.template_filter('pagination_slice') diff --git a/changedetectionio/static/js/preview.js b/changedetectionio/static/js/preview.js index a9895cb2..d85dd9fd 100644 --- a/changedetectionio/static/js/preview.js +++ b/changedetectionio/static/js/preview.js @@ -40,9 +40,13 @@ if (selectElement) { if (selectedOption) { if (selectedOption.previousElementSibling) { document.getElementById('btn-previous').href = "?version=" + selectedOption.previousElementSibling.value; + } else { + document.getElementById('btn-previous').remove() } if (selectedOption.nextElementSibling) { document.getElementById('btn-next').href = "?version=" + selectedOption.nextElementSibling.value; + } else { + document.getElementById('btn-next').remove() } } diff --git a/changedetectionio/templates/preview.html b/changedetectionio/templates/preview.html index 8bc231e1..28431fe9 100644 --- a/changedetectionio/templates/preview.html +++ b/changedetectionio/templates/preview.html @@ -66,7 +66,7 @@
-
{{ watch.snapshot_text_ctime|format_timestamp_timeago }}
+
{{ current_version|format_timestamp_timeago }}
Grey lines are ignored Blue lines are triggers Pro-tip: Highlight text to add to ignore filters