def standardize_items
super unless content == "_left"
end
def options_rule_card
Card[:cards_with_account]
end
format :html do
view :pointer_core do
wrap_with :div, pointer_items, class: "pointer-list"
end
view :core, cache: :never do
if card.content == "_left"
core_inherit_content
else
render! :pointer_core
end
end
view :one_line_content, cache: :never do
render_core items: { view: :link }
end
view :input do
item_names = inheriting? ? [] : card.item_names
%(
#{_render_hidden_content_field}
HTML
end
def core_inherit_content
text = if in_context_of_self_set?
core_inherit_for_content_for_self_set
else
"Inherit from left card"
end
%(#{text})
end
def in_context_of_self_set?
return false unless @set_context
@set_context.to_name.tag_name.key == Card[:self].key
end
def core_inherit_for_content_for_self_set
task = card.tag.codename
ancestor = Card[@set_context.trunk_name.trunk_name]
links = ancestor.who_can(task).map do |card_id|
link_to_card card_id, nil, target: args[:target]
end * ", "
"Inherit ( #{links} )"
rescue StandardError
"Inherit"
end
end