@@ -0,0 +1,14 | |||
|
1 | module CalendarsHelper | |
|
2 | def link_to_previous_month(year, month) | |
|
3 | link_to_remote ('« ' + (month==1 ? "#{month_name(12)} #{year-1}" : "#{month_name(month-1)}")), | |
|
4 | {:update => "content", :url => { :year => (month==1 ? year-1 : year), :month =>(month==1 ? 12 : month-1) }}, | |
|
5 | {:href => url_for(:action => 'show', :year => (month==1 ? year-1 : year), :month =>(month==1 ? 12 : month-1))} | |
|
6 | end | |
|
7 | ||
|
8 | def link_to_next_month(year, month) | |
|
9 | link_to_remote ((month==12 ? "#{month_name(1)} #{year+1}" : "#{month_name(month+1)}") + ' »'), | |
|
10 | {:update => "content", :url => { :year => (month==12 ? year+1 : year), :month =>(month==12 ? 1 : month+1) }}, | |
|
11 | {:href => url_for(:action => 'show', :year => (month==12 ? year+1 : year), :month =>(month==12 ? 1 : month+1))} | |
|
12 | ||
|
13 | end | |
|
14 | end |
@@ -1,56 +1,49 | |||
|
1 | 1 | <h2><%= l(:label_calendar) %></h2> |
|
2 | 2 | |
|
3 | 3 | <% form_tag({}, :id => 'query_form') do %> |
|
4 | 4 | <fieldset id="filters" class="collapsible"> |
|
5 | 5 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
6 | 6 | <div> |
|
7 | 7 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
8 | 8 | </div> |
|
9 | 9 | </fieldset> |
|
10 | 10 | |
|
11 | 11 | <p style="float:right;"> |
|
12 | <%= link_to_remote ('« ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")), | |
|
13 | {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }}, | |
|
14 | {:href => url_for(:action => 'show', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))} | |
|
15 | %> | | |
|
16 | <%= link_to_remote ((@month==12 ? "#{month_name(1)} #{@year+1}" : "#{month_name(@month+1)}") + ' »'), | |
|
17 | {:update => "content", :url => { :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1) }}, | |
|
18 | {:href => url_for(:action => 'show', :year => (@month==12 ? @year+1 : @year), :month =>(@month==12 ? 1 : @month+1))} | |
|
19 | %> | |
|
12 | <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %> | |
|
20 | 13 | </p> |
|
21 | 14 | |
|
22 | 15 | <p class="buttons"> |
|
23 | 16 | <%= label_tag('month', l(:label_month)) %> |
|
24 | 17 | <%= select_month(@month, :prefix => "month", :discard_type => true) %> |
|
25 | 18 | <%= label_tag('year', l(:label_year)) %> |
|
26 | 19 | <%= select_year(@year, :prefix => "year", :discard_type => true) %> |
|
27 | 20 | |
|
28 | 21 | <%= link_to_remote l(:button_apply), |
|
29 | 22 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, |
|
30 | 23 | :update => "content", |
|
31 | 24 | :with => "Form.serialize('query_form')" |
|
32 | 25 | }, :class => 'icon icon-checked' %> |
|
33 | 26 | |
|
34 | 27 | <%= link_to_remote l(:button_clear), |
|
35 | 28 | { :url => { :set_filter => (@query.new_record? ? 1 : nil) }, |
|
36 | 29 | :update => "content", |
|
37 | 30 | }, :class => 'icon icon-reload' if @query.new_record? %> |
|
38 | 31 | </p> |
|
39 | 32 | <% end %> |
|
40 | 33 | |
|
41 | 34 | <%= error_messages_for 'query' %> |
|
42 | 35 | <% if @query.valid? %> |
|
43 | 36 | <%= render :partial => 'common/calendar', :locals => {:calendar => @calendar} %> |
|
44 | 37 | |
|
45 | 38 | <p class="legend cal"> |
|
46 | 39 | <span class="starting"><%= l(:text_tip_task_begin_day) %></span> |
|
47 | 40 | <span class="ending"><%= l(:text_tip_task_end_day) %></span> |
|
48 | 41 | <span class="starting ending"><%= l(:text_tip_task_begin_end_day) %></span> |
|
49 | 42 | </p> |
|
50 | 43 | <% end %> |
|
51 | 44 | |
|
52 | 45 | <% content_for :sidebar do %> |
|
53 | 46 | <%= render :partial => 'issues/sidebar' %> |
|
54 | 47 | <% end %> |
|
55 | 48 | |
|
56 | 49 | <% html_title(l(:label_calendar)) -%> |
General Comments 0
You need to be logged in to leave comments.
Login now