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