Project

General

Profile

Feature #13849 » grouped-filter-trunk-r13207.diff

Go MAEDA, 2014-07-03 05:46

View differences:

app/helpers/queries_helper.rb (working copy)
end
end
def grouped_filters_options_for_select(query)
option_hash = ActiveSupport::OrderedHash.new
query.available_filters.each do |field, field_options|
if field_options[:type] == :relation
label = :label_related_issues
elsif field_options[:type] == :date_past || field_options[:type] == :date
label = :label_grouped_filter_date
else
label = :label_grouped_filter_non_date
end
(option_hash[label] ||= []) << [field_options[:name], field]
end
options = []
option_hash.each do |k, v|
options << [l(k), v]
end
grouped_options_for_select(options)
end
def query_filters_hidden_tags(query)
tags = ''.html_safe
query.filters.each do |field, options|
app/views/queries/_filters.html.erb (working copy)
</td>
<td class="add-filter">
<%= label_tag('add_filter_select', l(:label_filter_add)) %>
<%= select_tag 'add_filter_select', filters_options_for_select(query), :name => nil %>
<%= select_tag('add_filter_select',
content_tag(:option) +
grouped_filters_options_for_select(query),
:name => nil) %>
</td>
</tr>
</table>
config/locales/en.yml (working copy)
label_check_for_updates: Check for updates
label_latest_compatible_version: Latest compatible version
label_unknown_plugin: Unknown plugin
label_grouped_filter_non_date: Filters
label_grouped_filter_date: Date filters
button_login: Login
button_submit: Submit
public/javascripts/application.js (working copy)
}
$('#cb_'+fieldId).attr('checked', true);
toggleFilter(field);
$('#add_filter_select').val('').children('option').each(function() {
$('#add_filter_select').val('').children('optgroup').children('option').each(function() {
if ($(this).attr('value') == field) {
$(this).attr('disabled', true);
}
(8-8/9)