You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1018 B
29 lines
1018 B
12 years ago
|
module Users::DomainsHelper
|
||
13 years ago
|
def domain_list_row_class(record)
|
||
|
cannot?(:crud_permissions, record) ? "shared-domain" : ''
|
||
|
end
|
||
|
|
||
|
# Indents and dedents to create a tree structure,
|
||
|
# assuming that the records are sorted in preorder.
|
||
|
# Adds a visual cue if the record is shared via permissions feature.
|
||
12 years ago
|
def domain_name_column(record, column)
|
||
13 years ago
|
elements = []
|
||
13 years ago
|
depth = record.depth
|
||
13 years ago
|
if depth > 1
|
||
13 years ago
|
(depth - 2).times do # indent
|
||
13 years ago
|
elements << '<span class="ui-icon ui-icon-blank"></span>'
|
||
|
end
|
||
|
elements << '<span class="ui-icon ui-icon-carat-1-sw"></span>'
|
||
|
end
|
||
13 years ago
|
elements << record.name
|
||
13 years ago
|
unless can?(:crud_permissions, record)
|
||
|
who = "<strong>#{record.user.name}</strong> #{mail_to(record.user.email)}"
|
||
|
elements << <<-HTM
|
||
|
<i class="icon-share" rel="popover" data-original-title="Shared domain"
|
||
|
data-content="This domain was shared with you by #{h who}"></i>
|
||
|
HTM
|
||
|
end
|
||
13 years ago
|
@previous_record = record
|
||
13 years ago
|
elements.join.html_safe
|
||
|
end
|
||
13 years ago
|
end
|