annotate .svn/pristine/3c/3c8754104d5e4e67df7c4def3f7671c87678a154.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +0100
parents 261b3d9a4903
children
rev   line source
Chris@1464 1 <%= error_messages_for 'query' %>
Chris@1464 2
Chris@1464 3 <div class="box">
Chris@1464 4 <div class="tabular">
Chris@1464 5 <%= hidden_field_tag 'gantt', '1' if params[:gantt] %>
Chris@1464 6
Chris@1464 7 <p><label for="query_name"><%=l(:field_name)%></label>
Chris@1464 8 <%= text_field 'query', 'name', :size => 80 %></p>
Chris@1464 9
Chris@1464 10 <% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @project) %>
Chris@1464 11 <p><label><%=l(:field_visible)%></label>
Chris@1464 12 <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PRIVATE %> <%= l(:label_visibility_private) %></label>
Chris@1464 13 <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_ROLES %> <%= l(:label_visibility_roles) %>:</label>
Chris@1464 14 <% Role.givable.sorted.each do |role| %>
Chris@1464 15 <label class="block role-visibility"><%= check_box_tag 'query[role_ids][]', role.id, @query.roles.include?(role), :id => nil %> <%= role.name %></label>
Chris@1464 16 <% end %>
Chris@1464 17 <label class="block"><%= radio_button 'query', 'visibility', Query::VISIBILITY_PUBLIC %> <%= l(:label_visibility_public) %></label>
Chris@1464 18 <%= hidden_field_tag 'query[role_ids][]', '' %>
Chris@1464 19 </p>
Chris@1464 20 <% end %>
Chris@1464 21
Chris@1464 22 <p><label for="query_is_for_all"><%=l(:field_is_for_all)%></label>
Chris@1464 23 <%= check_box_tag 'query_is_for_all', 1, @query.project.nil?,
Chris@1464 24 :disabled => (!@query.new_record? && (@query.project.nil? || (@query.is_public? && !User.current.admin?))) %></p>
Chris@1464 25
Chris@1464 26 <fieldset><legend><%= l(:label_options) %></legend>
Chris@1464 27 <p><label for="query_default_columns"><%=l(:label_default_columns)%></label>
Chris@1464 28 <%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns',
Chris@1464 29 :onclick => 'if (this.checked) {$("#columns").hide();} else {$("#columns").show();}' %></p>
Chris@1464 30
Chris@1464 31 <p><label for="query_group_by"><%= l(:field_group_by) %></label>
Chris@1464 32 <%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %></p>
Chris@1464 33
Chris@1464 34 <p><label><%= l(:button_show) %></label>
Chris@1464 35 <%= available_block_columns_tags(@query) %></p>
Chris@1464 36
Chris@1464 37 <% if params[:gantt] %>
Chris@1464 38 <p><label><%= l(:label_gantt) %></label>
Chris@1464 39 <label class="inline"><%= check_box_tag "query[draw_relations]", "1", @query.draw_relations %> <%= l(:label_related_issues) %></label>
Chris@1464 40 <label class="inline"><%= check_box_tag "query[draw_progress_line]", "1", @query.draw_progress_line %> <%= l(:label_gantt_progress_line) %></label>
Chris@1464 41 </p>
Chris@1464 42 <% end %>
Chris@1464 43 </fieldset>
Chris@1464 44 </div>
Chris@1464 45
Chris@1464 46 <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend>
Chris@1464 47 <%= render :partial => 'queries/filters', :locals => {:query => query}%>
Chris@1464 48 </fieldset>
Chris@1464 49
Chris@1464 50 <fieldset><legend><%= l(:label_sort) %></legend>
Chris@1464 51 <% 3.times do |i| %>
Chris@1464 52 <%= i+1 %>:
Chris@1464 53 <%= label_tag "query_sort_criteria_attribute_" + i.to_s,
Chris@1464 54 l(:description_query_sort_criteria_attribute), :class => "hidden-for-sighted" %>
Chris@1464 55 <%= select_tag("query[sort_criteria][#{i}][]",
Chris@1464 56 options_for_select([[]] + query.available_columns.select(&:sortable?).collect {|column| [column.caption, column.name.to_s]}, @query.sort_criteria_key(i)),
Chris@1464 57 :id => "query_sort_criteria_attribute_" + i.to_s)%>
Chris@1464 58 <%= label_tag "query_sort_criteria_direction_" + i.to_s,
Chris@1464 59 l(:description_query_sort_criteria_direction), :class => "hidden-for-sighted" %>
Chris@1464 60 <%= select_tag("query[sort_criteria][#{i}][]",
Chris@1464 61 options_for_select([[], [l(:label_ascending), 'asc'], [l(:label_descending), 'desc']], @query.sort_criteria_order(i)),
Chris@1464 62 :id => "query_sort_criteria_direction_" + i.to_s) %>
Chris@1464 63 <br />
Chris@1464 64 <% end %>
Chris@1464 65 </fieldset>
Chris@1464 66
Chris@1464 67 <%= content_tag 'fieldset', :id => 'columns', :style => (query.has_default_columns? ? 'display:none;' : nil) do %>
Chris@1464 68 <legend><%= l(:field_column_names) %></legend>
Chris@1464 69 <%= render_query_columns_selection(query) %>
Chris@1464 70 <% end %>
Chris@1464 71
Chris@1464 72 </div>
Chris@1464 73
Chris@1464 74 <%= javascript_tag do %>
Chris@1464 75 $(document).ready(function(){
Chris@1464 76 $("input[name='query[visibility]']").change(function(){
Chris@1464 77 var checked = $('#query_visibility_1').is(':checked');
Chris@1464 78 $("input[name='query[role_ids][]'][type=checkbox]").attr('disabled', !checked);
Chris@1464 79 }).trigger('change');
Chris@1464 80 });
Chris@1464 81 <% end %>