From eaba39d99bfdab25c2ca01fb8f998d5f4b2e6fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Tue, 27 Nov 2018 18:37:53 +0200 Subject: [PATCH] Tweak HTML markup in alert emails for Gmail --- templates/emails/alert-body-html.html | 2 +- templates/emails/base.html | 49 +-------------------------- templates/emails/summary-html.html | 30 +++++++++------- 3 files changed, 19 insertions(+), 62 deletions(-) diff --git a/templates/emails/alert-body-html.html b/templates/emails/alert-body-html.html index ce5b0a51..1066880c 100644 --- a/templates/emails/alert-body-html.html +++ b/templates/emails/alert-body-html.html @@ -6,7 +6,7 @@ Hello,
This is a notification sent by {% site_name %}.
-The check {{ check.name_then_code }} +The check {{ check.name_then_code|mangle_link }} has gone {{ check.status|upper }}.

diff --git a/templates/emails/base.html b/templates/emails/base.html index 8d15e929..abe5f484 100644 --- a/templates/emails/base.html +++ b/templates/emails/base.html @@ -89,51 +89,6 @@ } - .new, .paused { - background: #AAA; - font-family: Helvetica, Arial, sans-serif; - font-weight: bold; - font-size: 10px; - line-height: 10px; - color: white; - padding: 6px; - margin: 0; - border-radius: 3px; - } - - .grace { - background: #f0ad4e; - font-family: Helvetica, Arial, sans-serif; - font-weight: bold; - font-size: 10px; - line-height: 10px; - color: white; - padding: 6px; - border-radius: 3px; - } - - .up { - background: #5cb85c; - font-family: Helvetica, Arial, sans-serif; - font-weight: bold; - font-size: 10px; - line-height: 10px; - color: white; - padding: 6px; - border-radius: 3px; - } - - .down { - background: #d9534f; - font-family: Helvetica, Arial, sans-serif; - font-weight: bold; - font-size: 10px; - line-height: 10px; - color: white; - padding: 6px; - border-radius: 3px; - } - /* ANDROID CENTER FIX */ div[style*="margin: 16px 0;"] { margin: 0 !important; } @@ -150,9 +105,7 @@
diff --git a/templates/emails/summary-html.html b/templates/emails/summary-html.html index 36928703..205aade6 100644 --- a/templates/emails/summary-html.html +++ b/templates/emails/summary-html.html @@ -6,29 +6,33 @@ {{ group.grouper.profile|mangle_link }} - Last Ping + Last Ping {% for check in group.list|sortchecks:sort %} - + {% if check.get_status == "new" %} + + {% elif check.get_status == "paused" %} + + {% elif check.get_status == "grace" %} + + {% elif check.get_status == "up" %} + + {% elif check.get_status == "down" %} + + {% endif %}
- {% if check.get_status == "grace" %} - LATE - {% else %} - {{ check.get_status|upper }} - {% endif %} - NEWPAUSEDLATEUPDOWN
{% if check.name %} {% if check.name|length > 20 %} - {{ check.name }} + {{ check.name|mangle_link }} {% else %} - {{ check.name }} + {{ check.name|mangle_link }} {% endif %} {% else %} unnamed @@ -42,7 +46,7 @@
- {{ tag }} + {{ tag|mangle_link }}
@@ -52,14 +56,14 @@ {% endif %} - + {% if check.last_ping %} {{ check.last_ping|naturaltime }} {% else %} Never {% endif %}
- Details… + Details… {% endfor %}