Module: Card::Set::All::Bootstrap::Helper::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod026-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_tag(content_or_options = nil, options = {}) ⇒ Object
- #popover_link(text, title = nil) ⇒ Object
- #separator ⇒ Object
Instance Method Details
#badge_tag(content, options = {}) ⇒ Object
44 45 46 47 |
# File 'tmpsets/set/mod026-bootstrap/all/bootstrap/helper.rb', line 44 def badge_tag content, ={} add_class , "badge" wrap_with :span, content, end |
#button_link(link_text, opts = {}) ⇒ Object
9 10 11 12 13 |
# File 'tmpsets/set/mod026-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 26 27 |
# File 'tmpsets/set/mod026-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_class , "list-group" [:items] ||= {} add_class [:items], "list-group-item" list_tag content, end |
#list_tag(content_or_options = nil, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'tmpsets/set/mod026-bootstrap/all/bootstrap/helper.rb', line 29 def list_tag =nil, ={} = if block_given? content = block_given? ? yield : content = Array(content) = .delete(:items) || {} tag = [:ordered] ? :ol : :ul wrap_with tag, do content.map do |item| i_content, i_opts = item i_opts ||= wrap_with :li, i_content, i_opts end end end |
#popover_link(text, title = nil) ⇒ Object
49 50 51 52 53 54 |
# File 'tmpsets/set/mod026-bootstrap/all/bootstrap/helper.rb', line 49 def popover_link text, title=nil opts = { class: "pl-1 text-muted-link", path: "#", "data-toggle": "popover", "data-trigger": :focus, "data-content": text } opts["data-title"] = title if title link_to fa_icon("question-circle"), opts end |
#separator ⇒ Object
15 16 17 |
# File 'tmpsets/set/mod026-bootstrap/all/bootstrap/helper.rb', line 15 def separator '<li role="separator" class="divider"></li>' end |