aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-24 12:27:20 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-24 12:27:20 +0100
commite99647bf05482e2eecca254fac1c87c9cbe82864 (patch)
tree03e760d600d4764a2e072f4bd2e5c3856120dc8b
parent71f395243d5cb7e2de918908f5c80b4ece37f58f (diff)
Added missing views
-rw-r--r--views/_alert_history.haml7
-rw-r--r--views/_history.haml10
-rw-r--r--views/_history_brief.haml6
-rw-r--r--views/events_daily.html18
4 files changed, 41 insertions, 0 deletions
diff --git a/views/_alert_history.haml b/views/_alert_history.haml
new file mode 100644
index 0000000..fbacda6
--- /dev/null
+++ b/views/_alert_history.haml
@@ -0,0 +1,7 @@
+%p
+ = history.created_at.strftime("%R")
+ - these_alerts = (@alerts.nil? ? history.alerts : @alerts.select{|a| history.alert_ids.include?(a.id)})
+ - these_alerts.each do |alert|
+ = alert.subject
+ = alert.summary
+ = history.event
diff --git a/views/_history.haml b/views/_history.haml
new file mode 100644
index 0000000..61bcf59
--- /dev/null
+++ b/views/_history.haml
@@ -0,0 +1,10 @@
+- if @today.nil? or %w(day month year).any?{|s| @today.send(s) != history.created_at.send(s)}
+ %h2
+ = history.created_at.strftime("%a %d %b %Y")
+%p
+ = history.created_at.strftime("%R")
+ - history.alerts.each do |alert|
+ = alert.subject
+ = alert.summary
+ = history.event
+ - @today = history.created_at
diff --git a/views/_history_brief.haml b/views/_history_brief.haml
new file mode 100644
index 0000000..8532991
--- /dev/null
+++ b/views/_history_brief.haml
@@ -0,0 +1,6 @@
+%p
+ = history.created_at.strftime("%R")
+ - history.alerts.each do |alert|
+ = alert.subject
+ = alert.summary
+ = history.event
diff --git a/views/events_daily.html b/views/events_daily.html
new file mode 100644
index 0000000..008b667
--- /dev/null
+++ b/views/events_daily.html
@@ -0,0 +1,18 @@
+%h2
+ Events List
+%p
+ %a{:href => "/events/list/#{(@start-1.day-10).strftime("%Y-%m-%d")}?"+request.query_string}
+ &larr; Previous day
+ = @start.strftime("%Y-%m-%d")
+ %a{:href => "/events/list/#{(@start+1.day+10).strftime("%Y-%m-%d")}?"+request.query_string}
+ Next day &rarr;
+ |
+ %a{:href => "/events/calendar/#{@start.strftime("%Y-%m")}?"+request.query_string}
+ Calendar view
+= partial('events_form')
+- if @events.length > 0
+ = partial('history', :collection => @events)
+- else
+ %p
+ %strong
+ No events for today.