Module: Card::Set::All::Bridge::RelatedSection::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod012-card-mod-edit/all/bridge/related_section.rb,
card/tmpsets/set/mod011-card-mod-edit/all/bridge/related_section.rb

Constant Summary collapse

{
  "by name" => [["children", :children],
                ["mates", :mates]],
  # FIXME: optimize,
  "by content" => [["links out", :links_to],
                   ["links in", :linked_to_by],
                   ["nests", :nests],
                   ["nested by", :nested_by],
                   ["references out", :refers_to],
                   ["references in",  :referred_to_by]]
  # ["by edit", [["creator", :creator],
  #              ["editors", :editors],
  #              ["last edited", :last_edited]]]
}.freeze

Instance Method Summary collapse

Instance Method Details



34
35
36
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge/related_section.rb', line 34

def related_by_content_items
  RELATED_ITEMS["by content"]
end


25
26
27
28
29
30
31
32
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge/related_section.rb', line 25

def related_by_name_items
  pills = []
  if card.name.junction?
    pills += card.name.ancestors.map { |a| [a, a, { mark: :absolute }] }
  end
  pills += RELATED_ITEMS["by name"]
  pills
end


38
39
40
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge/related_section.rb', line 38

def related_by_type_items
  [["#{card.type} cards", [card.type, :type, :by_name], mark: :absolute]]
end