Feature #13849 » grouped-filter-trunk-r13551.diff
| 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_latest_compatible_version: Latest compatible version
|
||
|
label_unknown_plugin: Unknown plugin
|
||
|
label_add_projects: Add projects
|
||
|
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).prop('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);
|
||
|
}
|
||
- « Previous
- 1
- …
- 7
- 8
- 9
- Next »