diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/issues/_list.html.erb | 5 | ||||
-rw-r--r-- | app/views/my/blocks/_issues.erb | 42 | ||||
-rw-r--r-- | app/views/my/blocks/_issuesassignedtome.html.erb | 15 | ||||
-rw-r--r-- | app/views/my/blocks/_issuesreportedbyme.html.erb | 15 | ||||
-rw-r--r-- | app/views/my/blocks/_issueswatched.html.erb | 9 | ||||
-rw-r--r-- | app/views/my/page.html.erb | 1 | ||||
-rw-r--r-- | app/views/queries/_columns.html.erb | 30 |
7 files changed, 65 insertions, 52 deletions
diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index f9172143b..5488fb295 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -1,3 +1,6 @@ +<% query_options = nil unless defined?(query_options) %> +<% query_options ||= {} %> + <%= form_tag({}, :data => {:cm_url => issues_context_menu_path}) do -%> <%= hidden_field_tag 'back_url', url_for(:params => request.query_parameters), :id => nil %> <div class="autoscroll"> @@ -9,7 +12,7 @@ :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %> </th> <% query.inline_columns.each do |column| %> - <%= column_header(query, column) %> + <%= column_header(query, column, query_options) %> <% end %> </tr> </thead> diff --git a/app/views/my/blocks/_issues.erb b/app/views/my/blocks/_issues.erb new file mode 100644 index 000000000..bbd10af33 --- /dev/null +++ b/app/views/my/blocks/_issues.erb @@ -0,0 +1,42 @@ +<% issues, query = issues_items(block, settings) %> + +<div class="contextual"> + <%= link_to_function l(:label_options), "$('##{block}-settings').toggle();", :class => 'icon-only icon-settings' %> +</div> + +<h3> + <%= link_to query.name, issues_path(query.as_params) %> + (<%= query.issue_count %>) +</h3> + +<div id="<%= block %>-settings" style="display:none;"> + <%= form_tag(my_page_path, :remote => true) do %> + <div class="box"> + <%= render_query_columns_selection(query, :name => "settings[#{block}][columns]") %> + </div> + <p> + <%= submit_tag l(:button_save) %> + <%= link_to_function l(:button_cancel), "$('##{block}-settings').toggle();" %> + </p> + <% end %> +</div> + +<% if issues.any? %> + <%= render :partial => 'issues/list', + :locals => { + :issues => issues, + :query => query, + :query_options => { + :sort_param => "settings[#{block}][sort]", + :sort_link_options => {:method => :post, :remote => true} + } + } %> +<% else %> + <p class="nodata"><%= l(:label_no_data) %></p> +<% end %> + +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, + issues_path(query.as_params.merge(:format => 'atom', :key => User.current.rss_key)), + {:title => query.name}) %> +<% end %> diff --git a/app/views/my/blocks/_issuesassignedtome.html.erb b/app/views/my/blocks/_issuesassignedtome.html.erb deleted file mode 100644 index 94948b7aa..000000000 --- a/app/views/my/blocks/_issuesassignedtome.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% assigned_issues = issuesassignedtome_items %> -<h3> - <%= link_to l(:label_assigned_to_me_issues), - issues_path(:set_filter => 1, :assigned_to_id => 'me', :sort => 'priority:desc,updated_on:desc') %> - (<%= assigned_issues.limit(nil).count %>) -</h3> - -<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues.to_a } %> - -<% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, - {:controller => 'issues', :action => 'index', :set_filter => 1, - :assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key}, - {:title => l(:label_assigned_to_me_issues)}) %> -<% end %> diff --git a/app/views/my/blocks/_issuesreportedbyme.html.erb b/app/views/my/blocks/_issuesreportedbyme.html.erb deleted file mode 100644 index 91557c035..000000000 --- a/app/views/my/blocks/_issuesreportedbyme.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% reported_issues = issuesreportedbyme_items %> -<h3> - <%= link_to l(:label_reported_issues), - issues_path(:set_filter => 1, :status_id => 'o', :author_id => 'me', :sort => 'updated_on:desc') %> - (<%= reported_issues.limit(nil).count %>) -</h3> - -<%= render :partial => 'issues/list_simple', :locals => { :issues => reported_issues.to_a } %> - -<% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, - {:controller => 'issues', :action => 'index', :set_filter => 1, - :author_id => 'me', :format => 'atom', :key => User.current.rss_key}, - {:title => l(:label_reported_issues)}) %> -<% end %> diff --git a/app/views/my/blocks/_issueswatched.html.erb b/app/views/my/blocks/_issueswatched.html.erb deleted file mode 100644 index 512a52238..000000000 --- a/app/views/my/blocks/_issueswatched.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<% watched_issues = issueswatched_items %> -<h3> - <%= link_to l(:label_watched_issues), - issues_path(:set_filter => 1, :watcher_id => 'me', :sort => 'updated_on:desc') %> - (<%= watched_issues.limit(nil).count %>) -</h3> - - -<%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues.to_a } %> diff --git a/app/views/my/page.html.erb b/app/views/my/page.html.erb index 1210c471a..7f67d0a90 100644 --- a/app/views/my/page.html.erb +++ b/app/views/my/page.html.erb @@ -25,6 +25,7 @@ <%= javascript_tag do %> $(document).ready(function(){ + $('#block-select').val(''); $('#list-top, #list-left, #list-right').sortable({ connectWith: '.block-receiver', tolerance: 'pointer', 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 %> |