effective_bootstrap 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2469342de9d3e1a00a7bbda6ec5867dfcc246c3
4
- data.tar.gz: 9f7a28c645d1ca83eb8ea50afe62f1fcb34948b9
3
+ metadata.gz: 001fe5fbf1a05352d82ae59be2b0181078e391f2
4
+ data.tar.gz: 24d5ec77cc725518659bcde94d09e80a37209395
5
5
  SHA512:
6
- metadata.gz: 03514b33df32c0cb77d801e4f24e93f327723271554329b4fe7a08a2cf43d6fd871ec75b44a8af7998d13dbc402e323d33bf2ef0a03832c930442e9c9a51d5cb
7
- data.tar.gz: 09e81df8639a8e1933be6237e60cd74ea030164255bcb116f24105716628e5d4efb4bca3ab731fe1096c5c68bebe0d87259e2ff24762887829030ef8e2da1f8c
6
+ metadata.gz: 95d57accc1d088e060bfb7c1d66deb5625dca51f627e1c0f7cdb7d68f80589d68f192cc22bbd33efe6c17b9260e045d3c14bbd3e72b27bfbe44df30a1a9a81d6
7
+ data.tar.gz: 5ab5aa1dfd214b0ff47935425f9839ab55c888f8c9a6beb072845bee00c5a586261d7df3e8da7db9d05d1dcdb6c224dda15406ef0a073cff88ca0e3bf80766d5
@@ -1,6 +1,28 @@
1
1
  # Boostrap4 Helpers
2
2
 
3
3
  module EffectiveBootstrapHelper
4
+ # https://getbootstrap.com/docs/4.0/components/collapse/
5
+
6
+ # = collapse('toggle visibility') do
7
+ # %p Something
8
+ # %p Collapsed
9
+
10
+ # collapse(items.length, class: 'btn btn-primary') do
11
+ # items.map { |item| content_tag(:div, item.to_s) }.join.html_safe
12
+ # end
13
+ def collapse(label, opts = {}, &block)
14
+ raise 'expected a block' unless block_given?
15
+
16
+ id = "collapse-#{''.object_id}"
17
+
18
+ link_opts = { 'data-toggle': 'collapse', role: 'button', href: "##{id}", 'aria-controls': "##{id}", 'aria-expanded': false }
19
+
20
+ content_tag(:a, label, link_opts.merge(opts)) +
21
+ content_tag(:div, class: 'collapse', id: id) do
22
+ content_tag(:div, capture(&block), class: 'card card-body mt-2')
23
+ end
24
+ end
25
+
4
26
  # Button Dropdowns
5
27
  # https://getbootstrap.com/docs/4.0/components/dropdowns/
6
28
  #
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.4.5'.freeze
2
+ VERSION = '0.4.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect