Module: Card::Set::All::HtmlTitle::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod008-card-mod-format/all/html_title.rb,
card/tmpsets/set/mod007-card-mod-format/all/html_title.rb

Instance Method Summary collapse

Instance Method Details

#safe_nameObject



35
36
37
# File 'card/tmpsets/set/mod008-card-mod-format/all/html_title.rb', line 35

def safe_name
  h super
end

#title_in_context(title = nil) ⇒ Object



39
40
41
42
43
# File 'card/tmpsets/set/mod008-card-mod-format/all/html_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 'card/tmpsets/set/mod008-card-mod-format/all/html_title.rb', line 31

def title_with_link link_text
  link_to_card card.name, link_text
end

#view: titleObject



19
20
21
# File 'card/tmpsets/set/mod008-card-mod-format/all/html_title.rb', line 19

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


23
24
25
# File 'card/tmpsets/set/mod008-card-mod-format/all/html_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 'card/tmpsets/set/mod008-card-mod-format/all/html_title.rb', line 27

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

#wrapped_jointObject



51
52
53
# File 'card/tmpsets/set/mod008-card-mod-format/all/html_title.rb', line 51

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

#wrapped_title(title) ⇒ Object



45
46
47
48
49
# File 'card/tmpsets/set/mod008-card-mod-format/all/html_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