effective_bootstrap 0.9.16 → 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/effective_bootstrap_helper.rb +30 -0
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c76bc463f1c4a4b5c248ac9072bdb2cc971da468cf13292519e80f64d3ec693
|
4
|
+
data.tar.gz: 85349386858572224e4a1127d8afc3dbc98250751282f60e29678833eab0ee86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b788edfb7934ad72a406d79ceab25c813c27343a4cefb0f871bc4fb026110a0646eae6df0fbc663d14168644f91b421a381b326705582c8dfb2f259f3e909d
|
7
|
+
data.tar.gz: 6cc0cbc87baa14e033a480ce895be3c0570c78639a6891017e57cd9cf105027287c5b3ed83990f38024315d76a06f56cf734b7f87a01d4814fa8ff58b1a1b832
|
@@ -18,6 +18,36 @@ module EffectiveBootstrapHelper
|
|
18
18
|
content
|
19
19
|
end
|
20
20
|
|
21
|
+
# https://getbootstrap.com/docs/4.0/components/card/
|
22
|
+
# = card('title do')
|
23
|
+
# %p Stuff
|
24
|
+
# = card('Stuff', header: 'header title')
|
25
|
+
def card(value = nil, opts = {}, &block)
|
26
|
+
raise('expected a block') unless block_given?
|
27
|
+
|
28
|
+
if value.kind_of?(Hash)
|
29
|
+
opts = value; value = nil
|
30
|
+
end
|
31
|
+
|
32
|
+
header = opts.delete(:header)
|
33
|
+
title = opts.delete(:title) || value
|
34
|
+
|
35
|
+
content_tag(:div, merge_class_key(opts, 'card mb-4')) do
|
36
|
+
header = content_tag(:div, header, class: 'card-header') if header.present?
|
37
|
+
|
38
|
+
body = content_tag(:div, class: 'card-body') do
|
39
|
+
if title.present?
|
40
|
+
content_tag(:h5, title, class: 'card-title') + capture(&block)
|
41
|
+
else
|
42
|
+
capture(&block)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
header ? (header + body) : body
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
|
21
51
|
# https://getbootstrap.com/docs/4.0/components/collapse/
|
22
52
|
|
23
53
|
# = collapse('toggle visibility') do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|