@@ -12,12 +12,7 module CalendarsHelper | |||
|
12 | 12 | "#{month_name(target_month)}" |
|
13 | 13 | end |
|
14 | 14 | |
|
15 | project_id = options[:project].present? ? options[:project].to_param : nil | |
|
16 | link_target = calendar_path(:year => target_year, :month => target_month, :project_id => project_id) | |
|
17 | ||
|
18 | link_to_remote(('« ' + name), | |
|
19 | {:update => "content", :url => link_target, :method => :put}, | |
|
20 | {:href => link_target}) | |
|
15 | link_to_month(('« ' + name), target_year, target_month, options) | |
|
21 | 16 | end |
|
22 | 17 | |
|
23 | 18 | def link_to_next_month(year, month, options={}) |
@@ -33,12 +28,18 module CalendarsHelper | |||
|
33 | 28 | "#{month_name(target_month)}" |
|
34 | 29 | end |
|
35 | 30 | |
|
31 | link_to_month((name + ' »'), target_year, target_month, options) | |
|
32 | end | |
|
33 | ||
|
34 | def link_to_month(link_name, year, month, options={}) | |
|
36 | 35 | project_id = options[:project].present? ? options[:project].to_param : nil |
|
37 | link_target = calendar_path(:year => target_year, :month => target_month, :project_id => project_id) | |
|
38 | 36 | |
|
39 | link_to_remote((name + ' »'), | |
|
37 | link_target = calendar_path(:year => year, :month => month, :project_id => project_id) | |
|
38 | ||
|
39 | link_to_remote(link_name, | |
|
40 | 40 | {:update => "content", :url => link_target, :method => :put}, |
|
41 | 41 | {:href => link_target}) |
|
42 | 42 | |
|
43 | 43 | end |
|
44 | ||
|
44 | 45 | end |
General Comments 0
You need to be logged in to leave comments.
Login now