mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 15:31:12 +00:00
Use radio buttons to choose display type (#29482).
git-svn-id: http://svn.redmine.org/redmine/trunk@18767 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
95188f26c3
commit
49b96a935b
@ -121,11 +121,12 @@ module QueriesHelper
|
||||
end
|
||||
|
||||
def available_display_types_tags(query)
|
||||
available_display_types = []
|
||||
tags = ''.html_safe
|
||||
query.available_display_types.each do |t|
|
||||
available_display_types << [l(:"label_display_type_#{t}"), t]
|
||||
tags << radio_button_tag('display_type', t, @query.display_type == t, :id => "display_type_#{t}") +
|
||||
content_tag('label', l(:"label_display_type_#{t}"), :for => "display_type_#{t}")
|
||||
end
|
||||
select_tag('display_type', options_for_select(available_display_types, @query.display_type), :id => 'display_type')
|
||||
tags
|
||||
end
|
||||
|
||||
def grouped_query_results(items, query, &block)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
<%= available_display_types_tags(@query) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<table id="list" class="<%= 'hidden' if (@query.display_type == 'board') %>">
|
||||
<table id="list-definition" class="<%= 'hidden' if (@query.display_type != 'list') %>">
|
||||
<% if @query.available_columns.any? %>
|
||||
<tr>
|
||||
<td class="field"><%= l(:field_column_names) %></td>
|
||||
@ -74,12 +74,11 @@
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(function ($) {
|
||||
$('#display_type').change(function (e) {
|
||||
var option = $(e.target).val()
|
||||
if (option == 'board') {
|
||||
$('table#list').hide();
|
||||
$('input[name=display_type]').change(function (e) {
|
||||
if ($("#display_type_list").is(':checked')) {
|
||||
$('table#list-definition').show();
|
||||
} else {
|
||||
$('table#list').show();
|
||||
$('table#list-definition').hide();
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user