twitter-bootstrap-components-rails 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/twitter/bootstrap/components/v3/media_object.rb +9 -0
- data/app/components/twitter/bootstrap/components/v3/responsive_media_object.rb +14 -0
- data/app/components/twitter/bootstrap/components/v4/badge.rb +1 -1
- data/app/helpers/twitter/bootstrap/components/rails/v4/components_helper.rb +1 -1
- data/app/views/twitter/bootstrap/components/v3/_media_object.html.haml +1 -1
- data/app/views/twitter/bootstrap/components/v3/_responsive_media_object.html.haml +14 -13
- data/lib/twitter/bootstrap/components/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab91cf36f3a1102b09f44938b28f855f2642892a
|
4
|
+
data.tar.gz: b9e0e48b6457589d3252c2bb452fe5362222dc07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd419a150249dce16e6bb1f4a0ae3e886ee2ce9899b6ef75e997560017b6588a4e9da8bdf680a743142935c176fef088e3d99d2d41c2ed04daffb95e385c7a99
|
7
|
+
data.tar.gz: 73040eb841aaec2b082af74e4dafd35ee13533ee8f61c2e80527600cd3c4bc49c10c2b1da8c03d42739a1d8bfb6c0046a88319e93edb5b5c4a27c76e586c26ec
|
@@ -10,6 +10,7 @@ module Twitter
|
|
10
10
|
block_output: @block_output,
|
11
11
|
context: context,
|
12
12
|
div_media_object_classes: div_media_object_classes,
|
13
|
+
div_container_classes: div_container_classes,
|
13
14
|
image_options: image_options,
|
14
15
|
link_target: link_target,
|
15
16
|
horizontal_alignment: horizontal_alignment
|
@@ -20,6 +21,14 @@ module Twitter
|
|
20
21
|
["media-#{horizontal_alignment}", "media-#{vertical_alignment}"]
|
21
22
|
end
|
22
23
|
|
24
|
+
def div_container_classes
|
25
|
+
['media', additional_div_container_classes]
|
26
|
+
end
|
27
|
+
|
28
|
+
def additional_div_container_classes
|
29
|
+
@options[:additional_div_container_classes] || ''
|
30
|
+
end
|
31
|
+
|
23
32
|
def context
|
24
33
|
@options[:context]
|
25
34
|
end
|
@@ -3,9 +3,23 @@ module Twitter
|
|
3
3
|
module Components
|
4
4
|
module V3
|
5
5
|
class ResponsiveMediaObject < Twitter::Bootstrap::Components::V3::MediaObject
|
6
|
+
private
|
7
|
+
|
6
8
|
def div_media_object_classes
|
7
9
|
["responsive-media-#{horizontal_alignment}", "responsive-media-#{vertical_alignment}"]
|
8
10
|
end
|
11
|
+
|
12
|
+
def view_locals
|
13
|
+
super.merge(media_columns: media_columns)
|
14
|
+
end
|
15
|
+
|
16
|
+
def media_columns
|
17
|
+
@options[:media_columns] || 2
|
18
|
+
end
|
19
|
+
|
20
|
+
def div_container_classes
|
21
|
+
['responsive-media', 'col-lg-12', additional_div_container_classes]
|
22
|
+
end
|
9
23
|
end
|
10
24
|
end
|
11
25
|
end
|
@@ -8,7 +8,7 @@ module Twitter
|
|
8
8
|
Twitter::Bootstrap::Components::V4::Alert.new(self, options, &block).perform
|
9
9
|
end
|
10
10
|
|
11
|
-
def bootstrap_badge(options, &block)
|
11
|
+
def bootstrap_badge(options = {}, &block)
|
12
12
|
Twitter::Bootstrap::Components::V4::Badge.new(self, options, &block).perform
|
13
13
|
end
|
14
14
|
|
@@ -1,14 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
%div{ class: div_container_classes }
|
2
|
+
.row
|
3
|
+
- image_div_css_classes = ["col-lg-#{media_columns}", "responsive-media-#{horizontal_alignment}"]
|
4
|
+
- image_div_css_classes << "col-lg-push-#{12 - media_columns}" if horizontal_alignment == :right
|
5
|
+
- if image_options[:src].present?
|
6
|
+
%div{ class: image_div_css_classes }
|
7
|
+
-if link_target.present?
|
8
|
+
%a{ href: link_target }
|
9
|
+
%img.responsive-media-object{ image_options }/
|
10
|
+
-else
|
8
11
|
%img.responsive-media-object{ image_options }/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
%div{ class: content_div_css_classes }
|
14
|
-
= block_output
|
12
|
+
- content_div_css_classes = ["responsive-media-body", "responsive-media-body-#{horizontal_alignment}", "col-lg-#{12 - media_columns}"]
|
13
|
+
- content_div_css_classes << "col-lg-pull-#{media_columns}" if horizontal_alignment == :right
|
14
|
+
%div{ class: content_div_css_classes }
|
15
|
+
= block_output
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter-bootstrap-components-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|