aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/_events_calendar_day.haml4
-rw-r--r--views/alert.haml5
-rw-r--r--views/events_list.haml23
3 files changed, 18 insertions, 14 deletions
diff --git a/views/_events_calendar_day.haml b/views/_events_calendar_day.haml
index 9682b56..1b42520 100644
--- a/views/_events_calendar_day.haml
+++ b/views/_events_calendar_day.haml
@@ -1,6 +1,6 @@
%td{:class => (@today.month % 2 == 0 ? "even" : "odd")}
%p.event_date
- %a{:href => "/events/list/#{@today.strftime("%Y-%m-%d")}?#{request.query_string}"}
+ %a{:href => "/events/list/#{@today.strftime("%F")}?#{request.query_string}"}
= @today.strftime(((@today - 1.day).month != @today.month) ? "%d %b" : "%d")
=partial("history", :collection => events_calendar_day.first(10))
%p
@@ -9,6 +9,6 @@
= events_calendar_day.length - 10
more events to display.
- if events_calendar_day.length > 0
- %a{:href => "/events/list/#{@today.strftime("%Y-%m-%d")}?#{request.query_string}"}
+ %a{:href => "/events/list/#{@today.strftime("%F")}?#{request.query_string}"}
Show the whole day.
- @today += 1.day
diff --git a/views/alert.haml b/views/alert.haml
index 30aeb86..220f871 100644
--- a/views/alert.haml
+++ b/views/alert.haml
@@ -47,11 +47,14 @@
%th History
%td
%ul#histories
- - @alert.histories.first(10).each do |history|
+ - @alert.histories.all(:created_at.gte => Time.now - 3.days).each do |history|
%li
= history.event
at
= (history.created_at.nil? ? "unkown" : history.created_at.to_s_human)
+ %p
+ %a{:href => "/events/alert/#{@alert.id}"}
+ View full event history
%h2 Actions
- if !@alert.acknowledged?
%form{:method => :post, :action => "/alert/#{@alert.id}/acknowledge"}
diff --git a/views/events_list.haml b/views/events_list.haml
index 008b667..ff56310 100644
--- a/views/events_list.haml
+++ b/views/events_list.haml
@@ -1,18 +1,19 @@
%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 @start
+ %p
+ %a{:href => "/events/list/#{(@start-1.day+1.hour).strftime("%F")}?"+request.query_string}
+ ← Previous day
+ = @start.strftime("%F")
+ %a{:href => "/events/list/#{(@start+1.day+1.hour).strftime("%F")}?"+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.
+ No events.