aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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}
+ ← Previous day
+ = @start.strftime("%Y-%m-%d")
+ %a{:href => "/events/list/#{(@start+1.day+10).strftime("%Y-%m-%d")}?"+request.query_string}
+ Next day →
+ |
+ %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.