Module: Card::Set::All::Title::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod004-format/all/title.rb

Instance Method Summary collapse

Instance Method Details

#safe_nameObject



35
36
37
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 35

def safe_name
  h super
end

#title_in_context(title = nil) ⇒ Object



39
40
41
42
43
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 39

def title_in_context title=nil
  title = title&.html_safe
  # escape titles generated from card names, but not those set explicitly
  h super(title)
end


31
32
33
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 31

def title_with_link link_text
  link_to_card card.name, link_text
end

#view: titleObject



19
20
21
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 19

view :title do
  show_view?(:title_link, :hide) ? render_title_link : render_title_no_link
end


23
24
25
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 23

view :title_link, compact: true, perms: :none do
  link_to_card card.name, render_title_no_link
end


27
28
29
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 27

view :title_no_link, compact: true, perms: :none do
  wrapped_title standard_title
end

#wrapped_jointObject



51
52
53
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 51

def wrapped_joint
  wrap_with :span, "+", classy("joint")
end

#wrapped_title(title) ⇒ Object



45
46
47
48
49
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/title.rb', line 45

def wrapped_title title
  wrap_with :span, class: classy("card-title"), title: title do
    title.to_name.parts.join wrapped_joint
  end
end