Skip to content

Commit

Permalink
Adding previous/next month capability to the group calendar.
Browse files Browse the repository at this point in the history
Signed-off-by: rick <technoweenie@gmail.com>
  • Loading branch information
jqr authored and technoweenie committed Apr 20, 2009
1 parent ee1af3b commit 56e3996
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion seinfeld_calendar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
show_group_calendar
end

get '/group/:names/:year/:month' do
show_group_calendar
end

post '/github' do
if params[:token] == Seinfeld::User.creation_token
Seinfeld::User.process_new_github_user(params[:subject])
Expand Down Expand Up @@ -138,7 +142,9 @@ def group_seinfeld
now = Date.new(params[:year], params[:month])
prev_month = now << 1
next_month = now >> 1
calendar :year => now.year, :month => now.month do |d|
calendar :year => now.year, :month => now.month,
:previous_month_text => %(<a href="/group/#{params[:names]}/#{prev_month.year}/#{prev_month.month}">Previous Month</a>),
:next_month_text => %(<a href="/group/#{params[:names]}/#{next_month.year}/#{next_month.month}" class="next">Next Month</a>) do |d|
if @progressions.include? d
[d.mday, {:class => "progressed"}]
else
Expand Down

0 comments on commit 56e3996

Please sign in to comment.