Module: Card::Set::All::RichHtml::Content::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod021-standard/all/rich_html/content.rb
Instance Method Summary collapse
- #count ⇒ Object
- #current_set_card ⇒ Object
- #labeled(label, content) ⇒ Object
- #prepare_content_slot ⇒ Object
-
#short_content ⇒ Object
LOCALIZE.
- #short_content_fields ⇒ Object
- #short_content_from_core ⇒ Object
- #short_content_items ⇒ Object
- #toggle_logic ⇒ Object
Instance Method Details
#count ⇒ Object
139 140 141 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 139 def count @count ||= card.count end |
#current_set_card ⇒ Object
102 103 104 105 106 107 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 102 def current_set_card set_name = params[:current_set] set_name ||= "#{card.name}+*type" if card.known? && card.type_id == Card::CardtypeID set_name ||= "#{card.name}+*self" Card.fetch(set_name) end |
#labeled(label, content) ⇒ Object
74 75 76 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 74 def labeled label, content haml :labeled, label: label, content: content end |
#prepare_content_slot ⇒ Object
19 20 21 22 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 19 def prepare_content_slot class_up "card-slot", "d0-card-content" voo.hide :menu end |
#short_content ⇒ Object
LOCALIZE
110 111 112 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 110 def short_content short_content_items || short_content_fields || short_content_from_core end |
#short_content_fields ⇒ Object
119 120 121 122 123 124 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 119 def short_content_fields return unless voo.structure || card.structure fields = nested_fields.size return if fields.zero? "#{fields} #{'field'.pluralize fields}" end |
#short_content_from_core ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 126 def short_content_from_core content = render_core if content.blank? "empty" elsif content.size <= 5 content elsif content.count("\n") < 2 "#{content.size} characters" else "#{content.count("\n") + 1} lines" end end |
#short_content_items ⇒ Object
114 115 116 117 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 114 def short_content_items return unless card.respond_to? :count "#{count} #{'item'.pluralize count}" end |
#toggle_logic ⇒ Object
98 99 100 |
# File 'tmpsets/set/mod021-standard/all/rich_html/content.rb', line 98 def toggle_logic show_view?(:title_link, :hide) ? voo.show(:icon_toggle) : voo.show(:title_toggle) end |