From e99647bf05482e2eecca254fac1c87c9cbe82864 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 24 Aug 2011 12:27:20 +0100 Subject: Added missing views --- views/_alert_history.haml | 7 +++++++ views/_history.haml | 10 ++++++++++ views/_history_brief.haml | 6 ++++++ views/events_daily.html | 18 ++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 views/_alert_history.haml create mode 100644 views/_history.haml create mode 100644 views/_history_brief.haml create mode 100644 views/events_daily.html (limited to 'views') 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. -- cgit v1.2.1