Sha256: f481f795c5d4dfdc617aebeae1152ec57f077c4db7bc361a1fbbb93a54aff11b

Contents?: true

Size: 614 Bytes

Versions: 29

Compression:

Stored size: 614 Bytes

Contents

format :html do
  def labeled_badge count, label, opts={}
    haml :labeled_badge, badge_haml_opts(count, label, opts)
  end

  def tab_badge count, label, opts={}
    haml :tab_badge, badge_haml_opts(count, label, opts)
  end

  def badge_haml_opts count, label, opts
    process_badge_opts count, opts
    { count: count, label: label, klass: opts[:klass], color: opts[:color],
      title: opts[:title] }
  end

  def process_badge_opts count, opts
    if count.try(:zero?) && !opts[:zero_ok]
      opts[:klass] = [opts[:klass], "disabled-o"].compact.join " "
    end
    opts[:color] ||= "secondary"
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
card-mod-bootstrap-0.14.2 set/abstract/bs_badge.rb
card-mod-bootstrap-0.14.1 set/abstract/bs_badge.rb
card-mod-bootstrap-0.14.0 set/abstract/bs_badge.rb
card-mod-bootstrap-0.13.4 set/abstract/bs_badge.rb
card-mod-bootstrap-0.13.3 set/abstract/bs_badge.rb
card-mod-bootstrap-0.13.2 set/abstract/bs_badge.rb
card-mod-bootstrap-0.13.1 set/abstract/bs_badge.rb
card-mod-bootstrap-0.13.0 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.7 set/abstract/bs_badge.rb
card-mod-bootstrap-0.12.0 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.6 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.5 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.4 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.3 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.2 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.1 set/abstract/bs_badge.rb
card-mod-bootstrap-0.11.0 set/abstract/bs_badge.rb
card-1.100.0 mod/utility/set/abstract/bs_badge.rb
card-1.99.6 mod/utility/set/abstract/bs_badge.rb
card-1.99.5 mod/utility/set/abstract/bs_badge.rb