Sha256: ac287a8c69694b9ca5fa6f00591bf320859ab0d0debc46ddb0da89a7f02f0861

Contents?: true

Size: 1009 Bytes

Versions: 22

Compression:

Stored size: 1009 Bytes

Contents

format :html do
  RELATED_ITEMS =
    {
      "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

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

  def related_by_content_items
    RELATED_ITEMS["by content"]
  end

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

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
card-mod-edit-0.17.0 set/all/board/related_section.rb
card-mod-edit-0.16.0 set/all/board/related_section.rb
card-mod-edit-0.15.6 set/all/board/related_section.rb
card-mod-edit-0.15.5 set/all/board/related_section.rb
card-mod-edit-0.15.4 set/all/bridge/related_section.rb
card-mod-edit-0.15.3 set/all/bridge/related_section.rb
card-mod-edit-0.15.2.pre1 set/all/bridge/related_section.rb
card-mod-edit-0.15.1.1 set/all/bridge/related_section.rb
card-mod-edit-0.15.1 set/all/bridge/related_section.rb
card-mod-edit-0.15.0 set/all/bridge/related_section.rb
card-mod-edit-0.14.2 set/all/bridge/related_section.rb
card-mod-edit-0.14.1 set/all/bridge/related_section.rb
card-mod-edit-0.14.0 set/all/bridge/related_section.rb
card-mod-edit-0.13.4 set/all/bridge/related_section.rb
card-mod-edit-0.13.3 set/all/bridge/related_section.rb
card-mod-edit-0.13.2 set/all/bridge/related_section.rb
card-mod-edit-0.13.1 set/all/bridge/related_section.rb
card-mod-edit-0.13.0 set/all/bridge/related_section.rb
card-mod-edit-0.11.7 set/all/bridge/related_section.rb
card-mod-edit-0.12.0 set/all/bridge/related_section.rb