Sha256: e6eee2105c6631f677e1c762b93e926073d22a25af6570727632a378a1cd3148

Contents?: true

Size: 1.63 KB

Versions: 1

Compression:

Stored size: 1.63 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class All
# Set: All cards (Guide)
#
module Guide;
extend Card::Set
def self.source_location; "/Users/ezl5238/dev/decko/gem/mod/help/set/all/guide.rb"; end
def guide_card
  guide_card = rule_card(:guide)
  return unless guide_card

  guide_card = guide_card.first_card if guide_card.type_id == Card::PointerID
  guide_card if guide_card.ok?(:read)
end

module HtmlFormat; module_parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  view :guide, unknown: true, cache: :never, wrap: :slot do
    guide
  end

  def guide
    guide_text = rule_based_guide
    return "" unless guide_text.present?

    if (rule_card = card.help_rule_card)
      edit_link = with_nest_mode(:normal) { nest(rule_card, view: :edit_link) }
      guide_text = "<span class='d-none'>#{edit_link}</span>#{guide_text}"
    end
    wrap_with :div, guide_text, class: classy("guide-text")
  end

  def alert_guide
    guide_text = guide
    return "" unless guide_text.present?

    alert(:secondary, true, false, class: "guide") { guide_text }
  end

  def raw_guide_text
    false
  end

  def rule_based_guide
    if raw_guide_text
      with_nest_mode :normal do
        process_content raw_guide_text, chunk_list: :references
        # render guide text with current card's format
        # so current card's context is used in guide card nests
      end
    elsif card.guide_card
      with_nest_mode :normal do
        nest card.guide_card, view: :core
      end
    else
      ""
    end
  end
end
end;end;end;end;
# ~~ generated from /Users/ezl5238/dev/decko/gem/mod/help/set/all/guide.rb ~~

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
card-1.102.0 tmpsets/set/mod028-help/all/guide.rb