Revision acfbc458
Added by Marek Hulán about 10 years ago
app/helpers/ancestry_helper.rb | ||
---|---|---|
module AncestryHelper
|
||
|
||
# this helper is used for hostgroup names and location/organization names. Both have ancestry
|
||
def label_with_link(obj, max_length = 1000)
|
||
def label_with_link(obj, max_length = 1000, authorizer = nil)
|
||
return if obj.blank?
|
||
options = (obj.title.to_s.size > max_length) ? { :'data-original-title' => obj.title, :rel => 'twipsy' } : {}
|
||
nesting = obj.title.to_s.gsub(/[^\/]+\/?$/, '')
|
||
... | ... | |
link_to_if_authorized(
|
||
content_tag(:span,
|
||
content_tag(:span, nesting, :class => 'gray') + name, options),
|
||
send("hash_for_edit_#{obj.class.name.tableize.singularize}_path", obj))
|
||
send("hash_for_edit_#{obj.class.name.tableize.singularize}_path", obj).merge(:auth_object => obj, :authorizer => authorizer))
|
||
end
|
||
|
||
end
|
||
end
|
Also available in: Unified diff
fixes #812 - new permissions model, user group role and nest support, role filters for better granularity
Contributions from: