aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notifiers/templates
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/notifiers/templates')
-rw-r--r--lib/mauve/notifiers/templates/email.html.erb4
-rw-r--r--lib/mauve/notifiers/templates/email.txt.erb2
-rw-r--r--lib/mauve/notifiers/templates/xmpp.html.erb21
-rw-r--r--lib/mauve/notifiers/templates/xmpp.txt.erb8
4 files changed, 28 insertions, 7 deletions
diff --git a/lib/mauve/notifiers/templates/email.html.erb b/lib/mauve/notifiers/templates/email.html.erb
index f0ce1be..24b5e7b 100644
--- a/lib/mauve/notifiers/templates/email.html.erb
+++ b/lib/mauve/notifiers/templates/email.html.erb
@@ -1,12 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body>
-<p><strong><%= alert.update_type.upcase %>:</strong> <%
+<p><a href="<%= WebInterface.url_for(alert) %>"><%= alert.update_type.upcase %></a>:<%
case alert.update_type
when "cleared"
%><%= alert.cleared_at.to_s_relative %><%
when "acknowledged"
-%><%= alert.acknowledged_at.to_s_relative %> by <%= alert.acknowledged_by%><%
+%><%= alert.acknowledged_at.to_s_relative %> by <%= alert.acknowledged_by%> until <%= alert.will_unacknowledge_at.to_s_human %><%
else
%><%= alert.raised_at.to_s_relative %><%
end
diff --git a/lib/mauve/notifiers/templates/email.txt.erb b/lib/mauve/notifiers/templates/email.txt.erb
index dc5762b..aab44a8 100644
--- a/lib/mauve/notifiers/templates/email.txt.erb
+++ b/lib/mauve/notifiers/templates/email.txt.erb
@@ -3,7 +3,7 @@ case alert.update_type
when "cleared"
%><%= alert.cleared_at.to_s_relative %><%
when "acknowledged"
-%><%= alert.acknowledged_at.to_s_relative %> by <%= alert.acknowledged_by %><%
+%><%= alert.acknowledged_at.to_s_relative %> by <%= alert.acknowledged_by %> until <%= alert.will_unacknowledge_at.to_s_human %><%
else
%><%= alert.raised_at.to_s_relative %><%
end
diff --git a/lib/mauve/notifiers/templates/xmpp.html.erb b/lib/mauve/notifiers/templates/xmpp.html.erb
new file mode 100644
index 0000000..c6bfaed
--- /dev/null
+++ b/lib/mauve/notifiers/templates/xmpp.html.erb
@@ -0,0 +1,21 @@
+ <html xmlns="http://jabber.org/protocol/xhtml-im"><body xmlns="OAhttp://www.w3.org/1999/xhtml">
+<a href="<%=WebInterface.url_for(alert)%>"><%= alert.update_type.upcase %></a>: <%
+case alert.update_type
+when "cleared"
+%><%= alert.cleared_at.to_s_relative %><%
+when "acknowledged"
+%><%= alert.acknowledged_at.to_s_relative %> by <%= alert.acknowledged_by %> until <%= alert.will_unacknowledge_at.to_s_human %><%
+else
+%><%= alert.raised_at.to_s_relative %><%
+end
+%>: <%= alert.subject %>: <%= alert.summary %><%
+if alert.source != alert.subject
+%> -- from <%= alert.source %><%
+end
+%>.<%
+if was_suppressed and not is_suppressed
+%><em> Normal service has resumed.</em><%
+elsif is_suppressed and not was_suppressed
+%><em> Further alerts suppressed until things calm down.</em><%
+end
+%></body></html>
diff --git a/lib/mauve/notifiers/templates/xmpp.txt.erb b/lib/mauve/notifiers/templates/xmpp.txt.erb
index 837fd67..a73f41f 100644
--- a/lib/mauve/notifiers/templates/xmpp.txt.erb
+++ b/lib/mauve/notifiers/templates/xmpp.txt.erb
@@ -3,7 +3,7 @@ case alert.update_type
when "cleared"
%><%= alert.cleared_at.to_s_relative %><%
when "acknowledged"
-%><%= alert.acknowledged_at.to_s_relative %> by <%= alert.acknowledged_by %><%
+%><%= alert.acknowledged_at.to_s_relative %> by <%= alert.acknowledged_by %> until <%= alert.will_unacknowledge_at.to_s_human %><%
else
%><%= alert.raised_at.to_s_relative %><%
end
@@ -11,10 +11,10 @@ end
if alert.source != alert.subject
%> -- from <%= alert.source %><%
end
-%>.<%
+%>. <%=WebInterface.url_for(alert)%><%
if was_suppressed and not is_suppressed
-%> Normal service has resumed.<%
+%> (Normal service has resumed.)<%
elsif is_suppressed and not was_suppressed
-%> Further alerts suppressed until things calm down.<%
+%> (Further alerts suppressed until things calm down.)<%
end
%>