aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/_events_calendar_day.haml13
-rw-r--r--views/events_calendar.haml5
2 files changed, 9 insertions, 9 deletions
diff --git a/views/_events_calendar_day.haml b/views/_events_calendar_day.haml
index 1b42520..fa0c517 100644
--- a/views/_events_calendar_day.haml
+++ b/views/_events_calendar_day.haml
@@ -1,14 +1,15 @@
%td{:class => (@today.month % 2 == 0 ? "even" : "odd")}
%p.event_date
%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))
+ = @today.strftime(((@today - 1).month != @today.month) ? "%d %b" : "%d")
+ =partial("history", :collection => events_calendar_day.last(10).to_a.reverse)
%p
- - if events_calendar_day.length > 10
+ - n_events = events_calendar_day.count
+ - if n_events > 10
There are
- = events_calendar_day.length - 10
+ = n_events - 10
more events to display.
- - if events_calendar_day.length > 0
+ - if n_events > 0
%a{:href => "/events/list/#{@today.strftime("%F")}?#{request.query_string}"}
Show the whole day.
- - @today += 1.day
+ - @today += 1
diff --git a/views/events_calendar.haml b/views/events_calendar.haml
index e3cec5e..0ff4e17 100644
--- a/views/events_calendar.haml
+++ b/views/events_calendar.haml
@@ -1,11 +1,10 @@
%h2
Events Calendar
-
%p
- %a{:href => "/events/calendar/#{(@month-31.days).strftime("%Y-%m")}?"+request.query_string}
+ %a{:href => "/events/calendar/#{(@month << 1).strftime("%Y-%m")}?"+request.query_string}
&larr; Previous Month
= @month.strftime("%b %Y")
- %a{:href => "/events/calendar/#{(@month+31.days).strftime("%Y-%m")}?"+request.query_string}
+ %a{:href => "/events/calendar/#{(@month >> 1).strftime("%Y-%m")}?"+request.query_string}
Next month &rarr;
= partial('events_form')
= partial('events_calendar')