From ff338d049c5ab3ecf69f83f8f215af51ece5c7cd Mon Sep 17 00:00:00 2001 From: David Schmitz <schmitz@lrz.de> Date: Thu, 7 Jun 2018 12:36:02 +0000 Subject: [PATCH] route_detail view: add info about current TZ --- flowspec/views.py | 7 ++++++- locale/el/LC_MESSAGES/django.po | 4 ++++ templates/flowspy/route_details.html | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/flowspec/views.py b/flowspec/views.py index 95ac94e7..bad7f378 100644 --- a/flowspec/views.py +++ b/flowspec/views.py @@ -823,7 +823,12 @@ def routedetails(request, route_slug): route = get_object_or_404(Route, name=route_slug) #return render(request, 'flowspy/route_details.html', {'route': route}) now = datetime.datetime.now() - return render(request, 'flowspy/route_details.html', {'route': route, 'mytime': now, 'route_comments_len' : len(str(route.comments)) }) + return render(request, 'flowspy/route_details.html', { + 'route': route, + 'mytime': now, + 'tz' : settings.TIME_ZONE, + 'route_comments_len' : len(str(route.comments)) + }) @login_required def routestats(request, route_slug): diff --git a/locale/el/LC_MESSAGES/django.po b/locale/el/LC_MESSAGES/django.po index 0b1966bb..14688425 100644 --- a/locale/el/LC_MESSAGES/django.po +++ b/locale/el/LC_MESSAGES/django.po @@ -398,6 +398,10 @@ msgstr "Τελευταία 10" msgid "Last update" msgstr "Ενημερώθηκε" +#: templates/dashboard.html:66 +msgid "Last rule edit" +msgstr "Ενημερώθηκε" + #: templates/dashboard.html:66 msgid "by" msgstr "από" diff --git a/templates/flowspy/route_details.html b/templates/flowspy/route_details.html index 470e2ad4..97c09be2 100644 --- a/templates/flowspy/route_details.html +++ b/templates/flowspy/route_details.html @@ -22,7 +22,7 @@ function myreloadPage() { </div> <div class="col-md-12"> <div> - <i class="fa fa-pencil-square-o"></i> {% trans "Last update" %}: {{route.last_updated}} {% trans "by" %} {{route.applier}} + <i class="fa fa-pencil-square-o"></i> {% trans "Last rule edit" %}: {{route.last_updated}} {% trans "by" %} {{route.applier}} </div> <div> <h2>{% trans 'About' %}</h2> @@ -81,7 +81,7 @@ function myreloadPage() { </div> <div> <h2>Statistics</h2> - <div>(current System time: {{ mytime|date:'Y-m-d H:i' }}, active rules will be updated every 5 minutes)</div> + <div>(all times are in {{ tz }}; current System time: {{ mytime|date:'Y-m-d H:i' }}, active rules will be updated every 5 minutes)</div> <div><span id="traffic-plot-loading">(Loading data...)</span> <h3>Number of packets (absolute)</h3> <div><canvas id="traffic-plot-pkts-abs" width=200 height=200></canvas></div> -- GitLab