##// END OF EJS Templates
tagged version 2.6.2...
tagged version 2.6.2 git-svn-id: http://svn.redmine.org/redmine/tags/2.6.2@14041 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r13491:3ba5e24a91ef
r13659:f6182db7de03 2.6.2
Show More
context_menus_helper.rb
50 lines | 1.9 KiB | text/x-ruby | RubyLexer
/ app / helpers / context_menus_helper.rb
Jean-Philippe Lang
Moved #context_menu_link to a new helper....
r8703 # encoding: utf-8
#
# Redmine - project management software
Jean-Philippe Lang
Copyright update in 2.6-stable....
r13491 # Copyright (C) 2006-2015 Jean-Philippe Lang
Jean-Philippe Lang
Moved #context_menu_link to a new helper....
r8703 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module ContextMenusHelper
def context_menu_link(name, url, options={})
options[:class] ||= ''
if options.delete(:selected)
options[:class] << ' icon-checked disabled'
options[:disabled] = true
end
if options.delete(:disabled)
options.delete(:method)
Jean-Philippe Lang
Don't show confirmation message when disabled delete link in the context menu (#12199)....
r10503 options.delete(:data)
options[:onclick] = 'return false;'
Jean-Philippe Lang
Moved #context_menu_link to a new helper....
r8703 options[:class] << ' disabled'
url = '#'
end
link_to h(name), url, options
end
Jean-Philippe Lang
Bulk-edit custom fields through context menu (#6296)....
r8704
def bulk_update_custom_field_context_menu_link(field, text, value)
context_menu_link h(text),
Jean-Philippe Lang
Code cleanup, use named routes....
r10837 bulk_update_issues_path(:ids => @issue_ids, :issue => {'custom_field_values' => {field.id => value}}, :back_url => @back),
Jean-Philippe Lang
Bulk-edit custom fields through context menu (#6296)....
r8704 :method => :post,
:selected => (@issue && @issue.custom_field_value(field) == value)
end
Jean-Philippe Lang
Add time entries custom fields to the context menu for quick bulk edit (#17484)....
r12981
def bulk_update_time_entry_custom_field_context_menu_link(field, text, value)
context_menu_link h(text),
Toshi MARUYAMA
fix test failure on Ruby 1.8.7 PostgreSQL (#17484)...
r12984 bulk_update_time_entries_path(:ids => @time_entries.map(&:id).sort, :time_entry => {'custom_field_values' => {field.id => value}}, :back_url => @back),
Jean-Philippe Lang
Add time entries custom fields to the context menu for quick bulk edit (#17484)....
r12981 :method => :post,
:selected => (@time_entry && @time_entry.custom_field_value(field) == value)
end
Jean-Philippe Lang
Moved #context_menu_link to a new helper....
r8703 end