bootstrap4_helper 1.0.4 → 1.1.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee687f2e080142b08272e0132e25676dfecaa1daa36e1a293482c47df8160cf3
|
4
|
+
data.tar.gz: a0d6ec5eed3e32a77c26460943a7084168d8d9a188a8bcc4ce6592ba9e199024
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37aebfa8013178b03e3f3132ffe509f3679276db1bf70be19672f09ddca399ac6c738b4216c2d38566b0a5b00ec4fb9dbb1156e80cdff6a225b75cdac5d048e1
|
7
|
+
data.tar.gz: 37fc165ef7ea6caf3c23ae87a8607ea0b134c2358718239185ac4707a5a7b1d031650f255cb91413a2a835bb25d0001f0fb263281e45da7ed94850c629dee6d2
|
data/lib/bootstrap4_helper.rb
CHANGED
@@ -448,6 +448,15 @@ module Bootstrap4Helper
|
|
448
448
|
Nav.new(self, opts, &block)
|
449
449
|
end
|
450
450
|
|
451
|
+
# Generates a page header, similiar to bootstrap 3
|
452
|
+
#
|
453
|
+
# @param [Hash] opts
|
454
|
+
# @return [String]
|
455
|
+
#
|
456
|
+
def page_header_helper(opts = {}, &block)
|
457
|
+
PageHeader.new(self, opts, &block)
|
458
|
+
end
|
459
|
+
|
451
460
|
# Generates a Tab component.
|
452
461
|
#
|
453
462
|
# ```erb
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Bootstrap4Helper
|
2
|
+
# Builds a simple CSS spinner component.
|
3
|
+
#
|
4
|
+
#
|
5
|
+
class PageHeader < Component
|
6
|
+
# Class constructor
|
7
|
+
#
|
8
|
+
# @param [ActionView] template
|
9
|
+
# @param [Hash] opts
|
10
|
+
# @option opts [String] :id
|
11
|
+
# @option opts [String] :class
|
12
|
+
# @option opts [Hash] :data
|
13
|
+
#
|
14
|
+
def initialize(template, opts = {}, &block)
|
15
|
+
super(template)
|
16
|
+
|
17
|
+
@id = opts.fetch(:id, uuid)
|
18
|
+
@class = opts.fetch(:class, '')
|
19
|
+
@data = opts.fetch(:data, {})
|
20
|
+
@content = block || proc { '' }
|
21
|
+
end
|
22
|
+
|
23
|
+
# String representation of the object.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
#
|
27
|
+
def to_s
|
28
|
+
content_tag(
|
29
|
+
config(:page_header, :h1),
|
30
|
+
id: @id,
|
31
|
+
class: "pb-2 mt-4 mb-2 border-bottom #{@class}",
|
32
|
+
data: @data
|
33
|
+
) do
|
34
|
+
@content.call(self)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap4_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert David
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/bootstrap4_helper/initialize.rb
|
157
157
|
- lib/bootstrap4_helper/modal.rb
|
158
158
|
- lib/bootstrap4_helper/nav.rb
|
159
|
+
- lib/bootstrap4_helper/page_header.rb
|
159
160
|
- lib/bootstrap4_helper/railtie.rb
|
160
161
|
- lib/bootstrap4_helper/spinner.rb
|
161
162
|
- lib/bootstrap4_helper/tab.rb
|