scrivito_icon_box_widget 1.1.9 → 1.1.10

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: 1a0952f6ddd8a3a553e8ad7b0b82171f641e91ce
4
- data.tar.gz: 8e75d4f137769f0fb297e4a5f6c5d11ecc0727ca
3
+ metadata.gz: 7ddc0eb20a5de97b103b7e533562806c4fc5bea9
4
+ data.tar.gz: db179fb44f157e290c2e048b215c7cf5c6595b6e
5
5
  SHA512:
6
- metadata.gz: ed7fd535f48d4a4338a6299ab30658a844ee6f81c9d0122f74ccd53ed8b204f7ea78fca47e366f8cc01bbd067183ed07536fb7817ef6b388fdcda0f9f0e61c35
7
- data.tar.gz: 1af74c4af2d52f5ce4e4f57c7267d120a403229941f1c6e1489165fff266c310dc4beb5e3244684aa5938749fb1ff47d867e0f2138aa99b9edcf544da4571ab6
6
+ metadata.gz: 578c25c3afd8e626e19c77716fb1e7efe71e9efa47f17fb5b3c9b921b6b2a5f094fa2250ea5045384ee96d9a61d231d712e9f83e0b32445439a18109677d5055
7
+ data.tar.gz: e4cff782d8c8ea74d38568c40e1398633d0efed9bf05ce1ecb085e242d39ddef71776b3abf1e406881c4cf2bcffb2c4af5d986680a3ac2071788f83464223c3b
@@ -0,0 +1,31 @@
1
+ .scrivito-icon-box {
2
+ overflow: hidden;
3
+ margin: 10px auto;
4
+ padding: 10px;
5
+ width: 70px;
6
+ height: 70px;
7
+ box-sizing: initial;
8
+ -webkit-box-sizing: initial;
9
+ -moz-box-sizing: initial;
10
+ }
11
+
12
+ .scrivito-icon-box i {
13
+ margin: 10px 0;
14
+ font-size: 50px;
15
+ line-height: 50px;
16
+ width: 100%;
17
+ text-align: center;
18
+ }
19
+
20
+ .scrivito_dialog .button_list button[data-editor="scrivito-toggle-button"].icon-select {
21
+ padding: 6px 18px;
22
+ font-size: 10px;
23
+ line-height: 10px;
24
+ width: 81px;
25
+ height: 51px;
26
+ .fa {
27
+ font-size: 20px;
28
+ display: block;
29
+ margin-bottom: 4px;
30
+ }
31
+ }
@@ -15,7 +15,7 @@
15
15
 
16
16
  .scrivito-icon-box.circle,
17
17
  .scrivito-icon-box.filled-circle {
18
- border-radius: 70px;
18
+ border-radius: 50%;
19
19
  text-align: center;
20
20
  }
21
21
 
@@ -29,21 +29,18 @@
29
29
  .scrivito-icon-box.small i {
30
30
  font-size: 30px;
31
31
  height: 30px;
32
- width: 30px;
33
32
  line-height: 30px;
34
33
  }
35
34
 
36
35
  .scrivito-icon-box.medium i {
37
36
  font-size: 50px;
38
37
  height: 50px;
39
- width: 50px;
40
38
  line-height: 50px;
41
39
  }
42
40
 
43
41
  .scrivito-icon-box.large i {
44
42
  font-size: 70px;
45
43
  height: 70px;
46
- width: 70px;
47
44
  line-height: 70px;
48
45
  }
49
46
 
@@ -1,9 +1,9 @@
1
1
  class IconBoxWidget < Widget
2
- attribute :icon, :string
2
+ attribute :icon, :string, default: 'leaf'
3
3
  attribute :color, :string
4
4
  attribute :background_color, :string
5
- attribute :size, :enum, values: ["small","medium","large"]
6
- attribute :style, :enum, values: ["circle","square","filled-circle","filled-square"]
5
+ attribute :size, :enum, values: ["small","medium","large"], default: 'large'
6
+ attribute :style, :enum, values: ["circle","square","filled-circle","filled-square"], default: 'circle'
7
7
 
8
8
  def selectable_color_classes(class_name, attribute)
9
9
  if Obj.respond_to?('selectable_color_classes')
@@ -14,15 +14,26 @@ class IconBoxWidget < Widget
14
14
  end
15
15
 
16
16
  def self.icons
17
- ["none", "plus","minus","warning","paw","send","car","sliders","tree","bell","certificate","cloud","comment","dashboard","female","male","flag","globe","heart","leaf","plane","refresh","rocket","question","star","unlock"]
17
+ IconBoxWidget.icon_list.map do |icon|
18
+ {
19
+ content: icon,
20
+ caption: "<i class='fa fa-#{icon}'></i>#{icon.present? ? icon : 'none'}".html_safe,
21
+ style: '',
22
+ css: 'icon-select'
23
+ }
24
+ end
18
25
  end
19
26
 
20
27
  def background_class
21
28
  self.background_color
22
29
  end
23
30
 
24
- private
31
+ private
25
32
  def self.fallback_colors
26
33
  %w(transparent black gray light-gray red green blue yellow)
27
34
  end
35
+
36
+ def self.icon_list
37
+ ["none", "plus","minus","warning","paw","send","car","sliders","tree","bell","certificate","cloud","comment","dashboard","female","male","flag","globe","heart","leaf","plane","refresh","rocket","question","star","unlock"]
38
+ end
28
39
  end
@@ -11,9 +11,9 @@
11
11
  <% end %>
12
12
 
13
13
  <%= scrivito_details_for 'Icon Color' do %>
14
- <%= render 'icon_box_widget/partials/color_picker', widget: widget, attribute: :color %>
14
+ <%= render 'scrivito_advanced_editors/color_picker', widget: widget, attribute: :background_color %>
15
15
  <% end %>
16
16
 
17
17
  <%= scrivito_details_for 'Background Color' do %>
18
- <%= render 'icon_box_widget/partials/color_picker', widget: widget, attribute: :background_color %>
18
+ <%= render 'scrivito_advanced_editors/color_picker', widget: widget, attribute: :background_color %>
19
19
  <% end %>
@@ -1,8 +1,4 @@
1
- <%= scrivito_toggle_button_editor(widget, attribute, IconBoxWidget.icons) do |elem|
2
- scrivito_tag(:button, widget, attribute, class: elem == widget.send(attribute) ? 'active' : '', data: {editor: 'scrivito-toggle-button', content: elem}) do
3
- content_tag(:i, '', :class => "fa fa-#{elem}") + " " + elem
4
- end
5
- end %>
1
+ <%= scrivito_toggle_button_editor(widget, attribute, IconBoxWidget.icons) %>
6
2
  <hr />
7
3
  <h4>Icon not in List</h4>
8
4
  <div class="alert alert-info">
@@ -1,3 +1,3 @@
1
1
  module ScrivitoIconBoxWidget
2
- VERSION = "1.1.9"
2
+ VERSION = "1.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_icon_box_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.9
4
+ version: 1.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,12 +92,11 @@ files:
92
92
  - app/assets/images/widget_preview_icon.png
93
93
  - app/assets/javascripts/scrivito_icon_box_widget.js
94
94
  - app/assets/stylesheets/scrivito_icon_box_widget.css
95
- - app/assets/stylesheets/scrivito_icon_box_widget/base.css
95
+ - app/assets/stylesheets/scrivito_icon_box_widget/base.css.scss
96
96
  - app/assets/stylesheets/scrivito_icon_box_widget/colors.css
97
97
  - app/assets/stylesheets/scrivito_icon_box_widget/widget.css
98
98
  - app/models/icon_box_widget.rb
99
99
  - app/views/icon_box_widget/details.html.erb
100
- - app/views/icon_box_widget/partials/_color_picker.html.erb
101
100
  - app/views/icon_box_widget/partials/_icons_picker.html.erb
102
101
  - app/views/icon_box_widget/show.html.erb
103
102
  - app/views/icon_box_widget/thumbnail.html.erb
@@ -126,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
125
  version: '0'
127
126
  requirements: []
128
127
  rubyforge_project:
129
- rubygems_version: 2.2.2
128
+ rubygems_version: 2.4.5
130
129
  signing_key:
131
130
  specification_version: 4
132
131
  summary: Widget for scrivito to display an icon in a box.
@@ -1,17 +0,0 @@
1
- .scrivito-icon-box {
2
- overflow: hidden;
3
- margin: 10px auto;
4
- padding: 10px;
5
- width: 70px;
6
- height: 70px;
7
- box-sizing: initial;
8
- -webkit-box-sizing: initial;
9
- -moz-box-sizing: initial;
10
- }
11
-
12
- .scrivito-icon-box i {
13
- margin: 10px;
14
- font-size: 50px;
15
- line-height: 50px;
16
- text-align: center;
17
- }
@@ -1,5 +0,0 @@
1
- <%= scrivito_toggle_button_editor(widget, attribute, widget.selectable_color_classes(widget.class.to_s, attribute)) do |elem|
2
- scrivito_tag(:button, widget, attribute, class: "#{elem == widget.send(attribute) ? 'active' : ''} #{elem}", data: {editor: 'scrivito-toggle-button', content: elem}) do
3
- elem
4
- end
5
- end %>