def standardize_items
# noop to override default behavior, which wouldn't let '_left' through and
# would therefore break
end
format :html do
view :pointer_core do
wrap_with :div, pointer_items, class: "pointer-list"
end
view :core do
if card.content == "_left"
core_inherit_content
else
render :pointer_core
end
end
view :closed_content do
render_core items: { view: :link }
end
view :editor do
item_names = inheriting? ? [] : card.item_names
%(
#{hidden_field :content, class: 'card-content'}
HTML
end
def core_inherit_content args={}
sc = args[:set_context]
text = if sc && sc.tag_name.key == Card[:self].key
core_inherit_for_content_for_self_set sc
else
"Inherit from left card"
end
%(#{text})
end
def core_inherit_for_content_for_self_set set_context
task = card.tag.codename
ancestor = Card[set_context.trunk_name.trunk_name]
links = ancestor.who_can(task.to_sym).map do |card_id|
link_to_card card_id, nil, target: args[:target]
end * ", "
"Inherit ( #{links} )"
rescue
"Inherit"
end
end