##// END OF EJS Templates
Makes tickets and timelogs filters collapsible (UI)....
Jean-Philippe Lang -
r2777:3477ded32af3
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -1,20 +1,18
1 <% form_tag({}, :id => 'query_form') do %>
1 <% form_tag({}, :id => 'query_form') do %>
2 <% if @query.new_record? %>
2 <% if @query.new_record? %>
3 <h2><%= l(:label_calendar) %></h2>
3 <h2><%= l(:label_calendar) %></h2>
4 <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
4 <fieldset id="filters" class="collapsible">
5 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
6 <div>
5 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
7 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
6 </fieldset>
8 </div>
9 </fieldset>
7 <% else %>
10 <% else %>
8 <h2><%=h @query.name %></h2>
11 <h2><%=h @query.name %></h2>
9 <% html_title @query.name %>
12 <% html_title @query.name %>
10 <% end %>
13 <% end %>
11
14
12 <fieldset id="date-range"><legend><%= l(:label_date_range) %></legend>
15 <p style="float:right;">
13 <%= select_month(@month, :prefix => "month", :discard_type => true) %>
14 <%= select_year(@year, :prefix => "year", :discard_type => true) %>
15 </fieldset>
16
17 <p style="float:right; margin:0px;">
18 <%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
16 <%= link_to_remote ('&#171; ' + (@month==1 ? "#{month_name(12)} #{@year-1}" : "#{month_name(@month-1)}")),
19 {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
17 {:update => "content", :url => { :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) }},
20 {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
18 {:href => url_for(:action => 'calendar', :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1))}
@@ -26,6 +24,9
26 </p>
24 </p>
27
25
28 <p class="buttons">
26 <p class="buttons">
27 <%= select_month(@month, :prefix => "month", :discard_type => true) %>
28 <%= select_year(@year, :prefix => "year", :discard_type => true) %>
29
29 <%= link_to_remote l(:button_apply),
30 <%= link_to_remote l(:button_apply),
30 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
31 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
31 :update => "content",
32 :update => "content",
@@ -1,23 +1,18
1 <% form_tag(params.merge(:month => nil, :year => nil, :months => nil), :id => 'query_form') do %>
1 <% form_tag(params.merge(:month => nil, :year => nil, :months => nil), :id => 'query_form') do %>
2 <% if @query.new_record? %>
2 <% if @query.new_record? %>
3 <h2><%=l(:label_gantt)%></h2>
3 <h2><%=l(:label_gantt)%></h2>
4 <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
4 <fieldset id="filters" class="collapsible">
5 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
6 <div>
5 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
7 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
6 </fieldset>
8 </div>
9 </fieldset>
7 <% else %>
10 <% else %>
8 <h2><%=h @query.name %></h2>
11 <h2><%=h @query.name %></h2>
9 <% html_title @query.name %>
12 <% html_title @query.name %>
10 <% end %>
13 <% end %>
11
14
12 <fieldset id="date-range"><legend><%= l(:label_date_range) %></legend>
15 <p style="float:right;">
13 <%= text_field_tag 'months', @gantt.months, :size => 2 %>
14 <%= l(:label_months_from) %>
15 <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %>
16 <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %>
17 <%= hidden_field_tag 'zoom', @gantt.zoom %>
18 </fieldset>
19
20 <p style="float:right; margin:0px;">
21 <%= if @gantt.zoom < 4
16 <%= if @gantt.zoom < 4
22 link_to_remote image_tag('zoom_in.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom+1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom+1)))}
17 link_to_remote image_tag('zoom_in.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom+1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom+1)))}
23 else
18 else
@@ -31,6 +26,12
31 </p>
26 </p>
32
27
33 <p class="buttons">
28 <p class="buttons">
29 <%= text_field_tag 'months', @gantt.months, :size => 2 %>
30 <%= l(:label_months_from) %>
31 <%= select_month(@gantt.month_from, :prefix => "month", :discard_type => true) %>
32 <%= select_year(@gantt.year_from, :prefix => "year", :discard_type => true) %>
33 <%= hidden_field_tag 'zoom', @gantt.zoom %>
34
34 <%= link_to_remote l(:button_apply),
35 <%= link_to_remote l(:button_apply),
35 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
36 { :url => { :set_filter => (@query.new_record? ? 1 : nil) },
36 :update => "content",
37 :update => "content",
@@ -5,11 +5,19
5 <% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %>
5 <% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %>
6 <%= hidden_field_tag('project_id', @project.to_param) if @project %>
6 <%= hidden_field_tag('project_id', @project.to_param) if @project %>
7 <div id="query_form_content">
7 <div id="query_form_content">
8 <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
8 <fieldset id="filters" class="collapsible">
9 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
9 <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
10 <div>
11 <%= render :partial => 'queries/filters', :locals => {:query => @query} %>
12 </div>
10 </fieldset>
13 </fieldset>
11 <p><%= l(:field_group_by) %>
14 <fieldset class="collapsible collapsed">
12 <%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %></p>
15 <legend onclick="toggleFieldset(this);">Options</legend>
16 <div style="display: none;">
17 <%= l(:field_group_by) %>
18 <%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %></p>
19 </div>
20 </fieldset>
13 </div>
21 </div>
14 <p class="buttons">
22 <p class="buttons">
15
23
@@ -1,4 +1,6
1 <fieldset id="filters"><legend><%= l(:label_date_range) %></legend>
1 <fieldset id="date-range" class="collapsible">
2 <legend onclick="toggleFieldset(this);"><%= l(:label_date_range) %></legend>
3 <div>
2 <p>
4 <p>
3 <%= radio_button_tag 'period_type', '1', !@free_period %>
5 <%= radio_button_tag 'period_type', '1', !@free_period %>
4 <%= select_tag 'period', options_for_period_select(params[:period]),
6 <%= select_tag 'period', options_for_period_select(params[:period]),
@@ -11,9 +13,16
11 <%= l(:label_date_from_to, :start => (text_field_tag('from', @from, :size => 10) + calendar_for('from')),
13 <%= l(:label_date_from_to, :start => (text_field_tag('from', @from, :size => 10) + calendar_for('from')),
12 :end => (text_field_tag('to', @to, :size => 10) + calendar_for('to'))) %>
14 :end => (text_field_tag('to', @to, :size => 10) + calendar_for('to'))) %>
13 </span>
15 </span>
14 <%= submit_tag l(:button_apply), :name => nil %>
15 </p>
16 </p>
17 </div>
16 </fieldset>
18 </fieldset>
19 <p class="buttons">
20 <%= link_to_remote l(:button_apply),
21 { :url => { },
22 :update => "content",
23 :with => "Form.serialize('query_form')"
24 }, :class => 'icon icon-checked' %>
25 </p>
17
26
18 <div class="tabs">
27 <div class="tabs">
19 <% url_params = @free_period ? { :from => @from, :to => @to } : { :period => params[:period] } %>
28 <% url_params = @free_period ? { :from => @from, :to => @to } : { :period => params[:period] } %>
@@ -6,7 +6,7
6
6
7 <h2><%= l(:label_spent_time) %></h2>
7 <h2><%= l(:label_spent_time) %></h2>
8
8
9 <% form_remote_tag( :url => {}, :html => {:method => :get}, :method => :get, :update => 'content' ) do %>
9 <% form_remote_tag( :url => {}, :html => {:method => :get, :id => 'query_form'}, :method => :get, :update => 'content' ) do %>
10 <%# TOOD: remove the project_id and issue_id hidden fields, that information is
10 <%# TOOD: remove the project_id and issue_id hidden fields, that information is
11 already in the URI %>
11 already in the URI %>
12 <%= hidden_field_tag('project_id', params[:project_id]) if @project %>
12 <%= hidden_field_tag('project_id', params[:project_id]) if @project %>
@@ -6,7 +6,7
6
6
7 <h2><%= l(:label_spent_time) %></h2>
7 <h2><%= l(:label_spent_time) %></h2>
8
8
9 <% form_remote_tag(:url => {}, :html => {:method => :get}, :method => :get, :update => 'content') do %>
9 <% form_remote_tag(:url => {}, :html => {:method => :get, :id => 'query_form'}, :method => :get, :update => 'content') do %>
10 <% @criterias.each do |criteria| %>
10 <% @criterias.each do |criteria| %>
11 <%= hidden_field_tag 'criterias[]', criteria, :id => nil %>
11 <%= hidden_field_tag 'criterias[]', criteria, :id => nil %>
12 <% end %>
12 <% end %>
@@ -33,6 +33,12 function toggleRowGroup(el) {
33 }
33 }
34 }
34 }
35
35
36 function toggleFieldset(el) {
37 var fieldset = Element.up(el, 'fieldset');
38 fieldset.toggleClassName('collapsed');
39 Effect.toggle(fieldset.down('div'), 'slide', {duration:0.2});
40 }
41
36 var fileFieldCount = 1;
42 var fileFieldCount = 1;
37
43
38 function addFileField() {
44 function addFileField() {
@@ -200,17 +200,16 p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;}
200 p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; }
200 p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; }
201 p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; }
201 p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; }
202
202
203 #query_form_content { font-size: 0.9em; padding: 4px; background: #f6f6f6; border: 1px solid #e4e4e4; }
203 fieldset.collapsible { border-width: 1px 0 0 0; font-size: 0.9em; }
204 #query_form_content fieldset#filters { border-left: 0; border-right: 0; }
204 fieldset.collapsible legend { padding-left: 16px; background: url(../images/arrow_expanded.png) no-repeat 0% 40%; cursor:pointer; }
205 #query_form_content p { margin-top: 0.5em; margin-bottom: 0.5em; }
205 fieldset.collapsible.collapsed legend { background-image: url(../images/arrow_collapsed.png); }
206
206
207 fieldset#filters, fieldset#date-range { padding: 0.7em; margin-bottom: 8px; }
207 fieldset#date-range p { margin: 2px 0 2px 0; }
208 fieldset#filters p { margin: 1.2em 0 0.8em 2px; }
209 fieldset#filters table { border-collapse: collapse; }
208 fieldset#filters table { border-collapse: collapse; }
210 fieldset#filters table td { padding: 0; vertical-align: middle; }
209 fieldset#filters table td { padding: 0; vertical-align: middle; }
211 fieldset#filters tr.filter { height: 2em; }
210 fieldset#filters tr.filter { height: 2em; }
212 fieldset#filters td.add-filter { text-align: right; vertical-align: top; }
211 fieldset#filters td.add-filter { text-align: right; vertical-align: top; }
213 .buttons { font-size: 0.9em; margin-bottom: 1.4em; }
212 .buttons { font-size: 0.9em; margin-bottom: 1.4em; margin-top: 1em; }
214
213
215 div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;}
214 div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;}
216 div#issue-changesets .changeset { padding: 4px;}
215 div#issue-changesets .changeset { padding: 4px;}
General Comments 0
You need to be logged in to leave comments. Login now