Module: Card::Set::All::Bootstrap::Helper::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb
Instance Method Summary collapse
-
#badge_tag(content, options = {}) ⇒ Object
-
#button_link(link_text, opts = {}) ⇒ Object
-
#list_group(content_or_options = nil, options = {}) ⇒ Object
-
#list_item_tags(content, default_item_options) ⇒ Object
-
#list_tag(content_or_options = nil, options = {}, &block) ⇒ Object
-
#popover_link(text, title = nil, link_text = nil, opts = {}) ⇒ Object
-
#popover_opts(text, title, opts) ⇒ Object
-
#separator ⇒ Object
Instance Method Details
#badge_tag(content, options = {}) ⇒ Object
43 44 45 46 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 43 def badge_tag content, ={} add_class , "badge" wrap_with :span, content, end |
#button_link(link_text, opts = {}) ⇒ Object
9 10 11 12 13 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 9 def link_text, opts={} btn_type = opts.delete(:btn_type) || "primary" opts[:class] = [opts[:class], "btn btn-#{btn_type}"].compact.join " " smart_link_to link_text, opts end |
#list_group(content_or_options = nil, options = {}) ⇒ Object
19 20 21 22 23 24 25 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 19 def list_group =nil, ={} = if block_given? content = block_given? ? yield : content = Array(content).map(&:to_s) add_list_group_classes list_tag content, end |
#list_item_tags(content, default_item_options) ⇒ Object
35 36 37 38 39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 35 def content, content.map do |item| i_content, i_opts = item i_opts ||= wrap_with :li, i_content, i_opts end end |
#list_tag(content_or_options = nil, options = {}, &block) ⇒ Object
27 28 29 30 31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 27 def list_tag =nil, ={}, &block content, = , , &block = .delete(:items) || {} wrap_with ([:ordered] ? :ol : :ul), do content, end end |
#popover_link(text, title = nil, link_text = nil, opts = {}) ⇒ Object
48 49 50 51 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 48 def popover_link text, title=nil, link_text=nil, opts={} link_text ||= icon_tag :help link_to link_text, popover_opts(text, title, opts) end |
#popover_opts(text, title, opts) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 53 def popover_opts text, title, opts add_class opts, "ps-1 _popover_link" text = " " unless text.present? opts.reverse_merge! path: "#", tabindex: 0, data: { "bs-toggle": "popover", "bs-trigger": "hover focus", # "bs-container": ".modal.show", "bs-content": text } opts["data-bs-title"] = title if title opts end |
#separator ⇒ Object
15 16 17 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/all/bootstrap/helper.rb', line 15 def separator '<li role="separator" class="divider"></li>' end |