Fix rubocop complains
This commit is contained in:
parent
8399e7ba7d
commit
484711d1ce
@ -100,12 +100,9 @@ module AdditionalsMenuHelper
|
||||
def additionals_custom_top_menu_item(item, user_roles)
|
||||
show_entry = false
|
||||
item[:roles].each do |role|
|
||||
if user_roles.empty? && role.to_i == Role::BUILTIN_ANONYMOUS
|
||||
show_entry = true
|
||||
break
|
||||
elsif User.current.logged? && role.to_i == Role::BUILTIN_NON_MEMBER
|
||||
# if user is logged in and non_member is active in item,
|
||||
# always show it
|
||||
if user_roles.empty? && role.to_i == Role::BUILTIN_ANONYMOUS ||
|
||||
# if user is logged in and non_member is active in item, always show it
|
||||
User.current.logged? && role.to_i == Role::BUILTIN_NON_MEMBER
|
||||
show_entry = true
|
||||
break
|
||||
end
|
||||
|
@ -224,13 +224,11 @@ module AdditionalsQueriesHelper
|
||||
|
||||
def xlsx_hyperlink_cell?(token)
|
||||
# Match http, https or ftp URL
|
||||
if %r{\A[fh]tt?ps?://}.match?(token)
|
||||
true
|
||||
# Match mailto:
|
||||
elsif token.present? && token.start_with?('mailto:')
|
||||
true
|
||||
# Match internal or external sheet link
|
||||
elsif /\A(?:in|ex)ternal:/.match?(token)
|
||||
if %r{\A[fh]tt?ps?://}.match?(token) ||
|
||||
# Match mailto:
|
||||
token.present? && token.start_with?('mailto:') ||
|
||||
# Match internal or external sheet link
|
||||
/\A(?:in|ex)ternal:/.match?(token)
|
||||
true
|
||||
end
|
||||
end
|
||||
|
@ -311,12 +311,10 @@ module Additionals
|
||||
return if user.nil?
|
||||
|
||||
if user.type == 'Group'
|
||||
if options[:no_link]
|
||||
if options[:no_link] || !Redmine::Plugin.installed?('redmine_hrm')
|
||||
user.name
|
||||
elsif Redmine::Plugin.installed? 'redmine_hrm'
|
||||
link_to_hrm_group user
|
||||
else
|
||||
user.name
|
||||
link_to_hrm_group user
|
||||
end
|
||||
else
|
||||
options[:size] = 14 if options[:size].nil?
|
||||
|
Loading…
x
Reference in New Issue
Block a user