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 |args| # view: :core, mod: Type::Pointer::HtmlFormat
%(
#{render_pointer_items args}
)
end
view :core do |args|
if card.content == "_left"
core_inherit_content args
else
render :pointer_core, args
end
end
view :closed_content do |args|
args[:item] ||= :link
render_core args
end
view :editor do |args|
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|
card_link Card[card_id].name, target: args[:target]
end * ", "
"Inherit ( #{links} )"
rescue
"Inherit"
end
end