Feature #35616 » 35616-WIP.patch
| app/controllers/context_menus_controller.rb | ||
|---|---|---|
|
@priorities = IssuePriority.active.reverse
|
||
|
@back = back_url
|
||
|
begin
|
||
|
# Recognize the controller and action from the back_url to determine
|
||
|
# which view triggered the context menu.
|
||
|
# @route => {:controller=>"issues", :action=>"show", :id=>"2"}
|
||
|
@route = Rails.application.routes.recognize_path(@back)
|
||
|
rescue ActionController::RoutingError
|
||
|
@route = {}
|
||
|
end
|
||
|
@columns = params[:c]
|
||
| app/views/context_menus/issues.html.erb | ||
|---|---|---|
|
<li><%= context_menu_link sprite_icon('copy', l(:button_copy)), bulk_edit_issues_path(:ids => @issue_ids, :copy => '1'),
|
||
|
:class => 'icon icon-copy', :disabled => !@can[:copy] %></li>
|
||
|
<% end %>
|
||
|
<li><%= context_menu_link sprite_icon('del', l(:button_delete_object, object_name: (@issue_ids.size > 1 ? l(:label_issue_plural) : l(:label_issue))).capitalize), issues_path(:ids => @issue_ids, :back_url => @back),
|
||
|
:method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon icon-del', :disabled => !@can[:delete] %></li>
|
||
|
<% if @route[:controller] == 'issues' && @route[:action] == 'index' %>
|
||
|
<li><%= context_menu_link sprite_icon('del', l(:button_delete_object, object_name: (@issue_ids.size > 1 ? l(:label_issue_plural) : l(:label_issue))).capitalize), issues_path(:ids => @issue_ids, :back_url => @back),
|
||
|
:method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon icon-del', :disabled => !@can[:delete] %></li>
|
||
|
<% end %>
|
||
|
<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
|
||
|
</ul>
|
||