From 8b2700c3c4c5a2371314e96f2148d313313d0870 Mon Sep 17 00:00:00 2001 From: Morten Brekkevold Date: Thu, 3 Oct 2019 09:59:54 +0200 Subject: [PATCH] Highlight usages of unsupported alert addresses Because when NAV is upgraded: - Users who have registered Jabber alert addresses need to be made aware that these are now unsupported - User with subscriptions that dispatch to Jabber addresses must be made aware that these subscriptions will no longer work as intended. --- .../web/templates/alertprofiles/address_list.html | 14 ++++++++++++-- .../templates/alertprofiles/subscription_form.html | 6 +++++- .../web/templates/alertprofiles/timeperiods.html | 5 ++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/python/nav/web/templates/alertprofiles/address_list.html b/python/nav/web/templates/alertprofiles/address_list.html index 4b166aa3a8..dc4b7f62cf 100644 --- a/python/nav/web/templates/alertprofiles/address_list.html +++ b/python/nav/web/templates/alertprofiles/address_list.html @@ -51,10 +51,20 @@ - {{ a.address }} + + {% if not a.type.supported %} + {{ a.address }} + {% else %} + {{ a.address }} + {% endif %} + - {{ a.type.name }} + {% if not a.type.supported %} +
{{ a.type.name }}: No longer supported
+ {% else %} + {{ a.type.name }} + {% endif %} {% endfor %} diff --git a/python/nav/web/templates/alertprofiles/subscription_form.html b/python/nav/web/templates/alertprofiles/subscription_form.html index b6b4f6fedb..dd6ba3d899 100644 --- a/python/nav/web/templates/alertprofiles/subscription_form.html +++ b/python/nav/web/templates/alertprofiles/subscription_form.html @@ -42,7 +42,11 @@

{{ s.filter_group.name }} - {{ s.alert_address }} + + {% if not s.alert_address.type.supported %}
{% endif %} + {{ s.alert_address }} + {% if not s.alert_address.type.supported %}
{% endif %} + {{ s.get_type_display|capfirst }} {{ s.ignore_resolved_alerts|yesno:"Yes,No" }} diff --git a/python/nav/web/templates/alertprofiles/timeperiods.html b/python/nav/web/templates/alertprofiles/timeperiods.html index 552038d4a5..12fd461c03 100644 --- a/python/nav/web/templates/alertprofiles/timeperiods.html +++ b/python/nav/web/templates/alertprofiles/timeperiods.html @@ -48,7 +48,10 @@ {% for b in a.alert_subscriptions %}
  • Watch {{ b.filter_group.name }}, - send to {{ b.alert_address.address }}, + send to + {% if not b.alert_address.type.supported %}
    {% endif %} + {{ b.alert_address.address }} + {% if not b.alert_address.type.supported %}
    {% endif %}, {{ b.get_type_display }}.
  • {% endfor %}