diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-14 18:18:19 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-14 18:18:19 +0000 |
commit | 8c7898bb5db0d29cd418eac3c6e27191cf3571ed (patch) | |
tree | aae5c57d61644de3c1d3786192ce7e2069c23e13 /app/views/queries/_columns.html.erb | |
parent | b878a427f2928e600ca51d03fc47637fa85cf859 (diff) | |
download | redmine-8c7898bb5db0d29cd418eac3c6e27191cf3571ed.tar.gz redmine-8c7898bb5db0d29cd418eac3c6e27191cf3571ed.zip |
Let user choose columns and sort order of issue lists on "My page" (#1565).
git-svn-id: http://svn.redmine.org/redmine/trunk@16400 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/queries/_columns.html.erb')
-rw-r--r-- | app/views/queries/_columns.html.erb | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/app/views/queries/_columns.html.erb b/app/views/queries/_columns.html.erb index d102341c1..26a460780 100644 --- a/app/views/queries/_columns.html.erb +++ b/app/views/queries/_columns.html.erb @@ -1,32 +1,38 @@ +<% tag_id = tag_name.gsub(/[\[\]]+/, '_').sub(/_+$/, '') %> +<% available_tag_id = "available_#{tag_id}" %> +<% selected_tag_id = "selected_#{tag_id}" %> + <table class="query-columns"> <tr> <td style="padding-left:0"> - <%= label_tag "available_columns", l(:description_available_columns) %> + <%= label_tag available_tag_id, l(:description_available_columns) %> <br /> <%= select_tag 'available_columns', options_for_select(query_available_inline_columns_options(query)), + :id => available_tag_id, :multiple => true, :size => 10, :style => "width:150px", - :ondblclick => "moveOptions(this.form.available_columns, this.form.selected_columns);" %> + :ondblclick => "moveOptions(this.form.#{available_tag_id}, this.form.#{selected_tag_id});" %> </td> <td class="buttons"> <input type="button" value="→" - onclick="moveOptions(this.form.available_columns, this.form.selected_columns);" /><br /> + onclick="moveOptions(this.form.<%= available_tag_id %>, this.form.<%= selected_tag_id %>);" /><br /> <input type="button" value="←" - onclick="moveOptions(this.form.selected_columns, this.form.available_columns);" /> + onclick="moveOptions(this.form.<%= selected_tag_id %>, this.form.<%= available_tag_id %>);" /> </td> <td> - <%= label_tag "selected_columns", l(:description_selected_columns) %> + <%= label_tag selected_tag_id, l(:description_selected_columns) %> <br /> <%= select_tag tag_name, options_for_select(query_selected_inline_columns_options(query)), - :id => 'selected_columns', :multiple => true, :size => 10, :style => "width:150px", - :ondblclick => "moveOptions(this.form.selected_columns, this.form.available_columns);" %> + :id => selected_tag_id, + :multiple => true, :size => 10, :style => "width:150px", + :ondblclick => "moveOptions(this.form.#{selected_tag_id}, this.form.#{available_tag_id});" %> </td> <td class="buttons"> - <input type="button" value="⇈" onclick="moveOptionTop(this.form.selected_columns);" /><br /> - <input type="button" value="↑" onclick="moveOptionUp(this.form.selected_columns);" /><br /> - <input type="button" value="↓" onclick="moveOptionDown(this.form.selected_columns);" /><br /> - <input type="button" value="⇊" onclick="moveOptionBottom(this.form.selected_columns);" /> + <input type="button" value="⇈" onclick="moveOptionTop(this.form.<%= selected_tag_id %>);" /><br /> + <input type="button" value="↑" onclick="moveOptionUp(this.form.<%= selected_tag_id %>);" /><br /> + <input type="button" value="↓" onclick="moveOptionDown(this.form.<%= selected_tag_id %>);" /><br /> + <input type="button" value="⇊" onclick="moveOptionBottom(this.form.<%= selected_tag_id %>);" /> </td> </tr> </table> @@ -34,7 +40,7 @@ <%= javascript_tag do %> $(document).ready(function(){ $('.query-columns').closest('form').submit(function(){ - $('#selected_columns option').prop('selected', true); + $('#<%= selected_tag_id %> option').prop('selected', true); }); }); <% end %> |