maglove-widgets 1.0.8 → 1.1.3

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: f7db710a45299148112796c1a5b59df8edd93c4d
4
- data.tar.gz: c33fb44c51b38f26856ebdb2d0f937aaa79afaff
3
+ metadata.gz: 5dd44a759e79cf41bc4504dcae15e5ae6fec1ee4
4
+ data.tar.gz: f5054243b2298daa87c271d37cc9b8259c1ea80b
5
5
  SHA512:
6
- metadata.gz: ee5ae5b3a8a7a7a8a5df4f7946d53e0e9a44e95951732493c44237bf500730293fe5e41e57e52ea5d70d00be9c8a433c8430e3aba5801c3e21dd264ca6f4b49b
7
- data.tar.gz: acceb03e2e14401ec78d42b9979b84bcfc53796c39503056da18ba307b1a8540bfef4fffcef3f0bd4e9b1c1d6b3c7393e32cf4e9f5d878ba57bbb32b26405355
6
+ metadata.gz: b00d7207bb1b45734650985d93e4441b024dfb28f6936725098d7b0ec25d10e57c12ee8a87d7143fedbf191289616d336f3b74322c79f97698f2d958836d52f2
7
+ data.tar.gz: 0e2518a79589f9c47b580f7e789485526e74a1555670b7133d284699b876f872e8cc65dd8d106c6e83fe654d4fbac886a69c85e070bb8b0208dac41283b6498a
@@ -1,24 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maglove-widgets (1.0.8)
4
+ maglove-widgets (1.1.3)
5
5
  bundler (~> 1.14)
6
6
  hamloft (~> 0.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- haml (5.0.1)
11
+ haml (5.0.2)
12
12
  temple (>= 0.8.0)
13
13
  tilt
14
14
  hamloft (0.2.6)
15
15
  haml (~> 5.0)
16
16
  nokogiri (~> 1.8)
17
- mini_portile2 (2.2.0)
18
- nokogiri (1.8.0)
19
- mini_portile2 (~> 2.2.0)
17
+ mini_portile2 (2.3.0)
18
+ nokogiri (1.8.1)
19
+ mini_portile2 (~> 2.3.0)
20
20
  temple (0.8.0)
21
- tilt (2.0.7)
21
+ tilt (2.0.8)
22
22
 
23
23
  PLATFORMS
24
24
  ruby
@@ -6,6 +6,7 @@ require "maglove/widgets/container"
6
6
  require "maglove/widgets/heading"
7
7
  require "maglove/widgets/horizontal_rule"
8
8
  require "maglove/widgets/image"
9
+ require "maglove/widgets/listitem"
9
10
  require "maglove/widgets/paragraph"
10
11
  require "maglove/widgets/scrollable_image"
11
12
  require "maglove/widgets/slider"
@@ -22,6 +23,7 @@ module Maglove
22
23
  Hamloft.register_widget(Heading)
23
24
  Hamloft.register_widget(HorizontalRule)
24
25
  Hamloft.register_widget(Image)
26
+ Hamloft.register_widget(Listitem)
25
27
  Hamloft.register_widget(Paragraph)
26
28
  Hamloft.register_widget(ScrollableImage)
27
29
  Hamloft.register_widget(Slider)
@@ -59,6 +59,8 @@ module Maglove
59
59
  sb.add(:background_color, @options[:background_color] == "custom" ? @options[:bg_color] : nil)
60
60
  if @options[:background_color] == "overlay"
61
61
  sb.add(:background_image, @options[:image_source], "linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(<%= value %>)")
62
+ elsif
63
+ sb.add(:background_image, @options[:image_source], "url(<%= value %>)")
62
64
  end
63
65
  sb.add(:background_position, @options[:image_position], "<%= value.split('_').join(' ') %>")
64
66
  end
@@ -77,7 +79,7 @@ module Maglove
77
79
  end
78
80
 
79
81
  style_string @options, :min_height, :max_height, :max_width, :padding, :overflow_y, :margin_left, :margin_right do |sb|
80
- if @options[:background_color] != "overlay"
82
+ if @options[:parallax_effect] != "none"
81
83
  sb.add(:background_image, @options[:image_source], "url(<%= value %>)")
82
84
  end
83
85
  end
@@ -0,0 +1,62 @@
1
+ module Maglove
2
+ module Widgets
3
+ class Listitem < Base
4
+ def identifier
5
+ "listitem"
6
+ end
7
+
8
+ def defaults
9
+ {
10
+ background_color: "#18B545",
11
+ size: "md",
12
+ badge: nil,
13
+ title: "Title",
14
+ subtitle: nil,
15
+ image_source: nil
16
+ }
17
+ end
18
+
19
+ def styles
20
+ style_string @options, :border_color, :background_color
21
+ end
22
+
23
+ module Helpers
24
+ def listitem_widget(options = {})
25
+ widget_block(Widgets::Listitem.new(options)) do |widget|
26
+ haml_tag :a, { class: "list-item list-item-#{widget.options[:size]}", href: (widget.options[:href] or "#"), style: widget.styles } do
27
+ if widget.options[:icon]
28
+ haml_tag :i, { class: "list-item-icon fa fa-#{widget.options[:icon]}" }
29
+ end
30
+ if widget.options[:image_source]
31
+ image_style = style_string(widget.options) do |sb|
32
+ sb.add(:background_image, widget.options[:image_source], "url(<%= value %>)")
33
+ end
34
+ haml_tag :div, { class: "list-item-image", style: image_style }
35
+ end
36
+ haml_tag :div, { class: "list-item-main" } do
37
+ haml_tag :div, { class: "list-item-title" } do
38
+ haml_concat(widget.options[:title])
39
+ end
40
+ if widget.options[:subtitle]
41
+ haml_tag :div, { class: "list-item-subtitle" } do
42
+ haml_concat(widget.options[:subtitle])
43
+ end
44
+ end
45
+ end
46
+ if widget.options[:badge]
47
+ haml_tag :div, { class: "list-item-badge" } do
48
+ haml_tag :span do
49
+ haml_concat(widget.options[:badge])
50
+ end
51
+ end
52
+ end
53
+ if widget.options[:href]
54
+ haml_tag :i, { class: "list-item-arrow fa fa-angle-right" }
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "maglove-widgets"
6
- s.version = "1.0.8"
6
+ s.version = "1.1.3"
7
7
  s.licenses = ["BSD-3-Clause"]
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Tobias Strebitzer"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglove-widgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-22 00:00:00.000000000 Z
11
+ date: 2017-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -59,6 +59,7 @@ files:
59
59
  - lib/maglove/widgets/heading.rb
60
60
  - lib/maglove/widgets/horizontal_rule.rb
61
61
  - lib/maglove/widgets/image.rb
62
+ - lib/maglove/widgets/listitem.rb
62
63
  - lib/maglove/widgets/paragraph.rb
63
64
  - lib/maglove/widgets/scrollable_image.rb
64
65
  - lib/maglove/widgets/slider.rb
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  version: '0'
87
88
  requirements: []
88
89
  rubyforge_project:
89
- rubygems_version: 2.5.2
90
+ rubygems_version: 2.6.10
90
91
  signing_key:
91
92
  specification_version: 4
92
93
  summary: MagLove Widgets Repository