promethee 4.1.8 → 4.1.13

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: 90a33ce9e6312e37485cedecf012ec40d94192351e6e401167e32422eef6e190
4
- data.tar.gz: 9dd9dd15ca827d6b5ddca45fe561b97b9bd866160c0e2ae2e159ba12fe0bf71d
3
+ metadata.gz: 5995134837ab9a1ecff1e378a5cd6c2c773661bba57fb3a5a4a312421b689ac6
4
+ data.tar.gz: 3a832f11734ccbcbddd6f725d4842b71ab924a2ea882481028b43d0feec3ff2f
5
5
  SHA512:
6
- metadata.gz: 392c05d4d2adafd32d51056c221d3a8c9f690e2a7c46c1b57ebdae481667dce00cf0790841a9db746ec3bec9c4be2200e81720d592b3aa5ac753480b358c761f
7
- data.tar.gz: 65c267a80b55d9dd606f49d4980f38ea875c13a2d69e92587407093b40e399d8d87857e01e9ec972ec1db343ad7c4e1891c53e08ed1c3e895fb6588ef0d08045
6
+ metadata.gz: 79e066c623432ba0eaefab072649c311fa0d6ca72f329f6813b55db52e0b19b44feff6961420c894c14ee656825e926e636b4ad4deed735eec6cca5f4b589d68
7
+ data.tar.gz: e392f5c4b4a3c56b0f19d896ab287e0624a24c2db5429d7bfa8d2e117415e94b950846a040fe477a92e53457156604cc8c69735fb72064cd274929c826e1436e
@@ -160,6 +160,14 @@ $black: #000000 !default
160
160
  .fontawesome-carousel-control .fa
161
161
  font-size: 30px
162
162
 
163
+ &__table
164
+ tr.empty
165
+ background-color: #EEEEEE
166
+ td
167
+ line-height: 1px
168
+ padding-bottom: 1px
169
+ padding-top: 1px
170
+
163
171
 
164
172
  // component direct in root
165
173
  &__page > &__blockquote,
@@ -5,7 +5,8 @@
5
5
  open_label_position = component[:attributes].dig(:open_label_position, :value)&.to_s
6
6
  %>
7
7
 
8
- <aside class="<%= promethee_class_for component %> aside">
8
+ <aside class="<%= promethee_class_for component %> aside"
9
+ id="<%= promethee_id_for component %>">
9
10
  <div class="promethee__component__row">
10
11
  <div class="promethee__component__content">
11
12
  <div class="aside__content">
@@ -3,7 +3,8 @@
3
3
  author = component[:attributes].dig(:author, :value)&.to_s
4
4
  %>
5
5
 
6
- <div class="<%= promethee_class_for(component) %>">
6
+ <div class="<%= promethee_class_for(component) %>"
7
+ id="<%= promethee_id_for component %>">
7
8
  <div class="promethee__component__row">
8
9
  <div class="promethee__component__content">
9
10
  <blockquote class="blockquote">
@@ -12,7 +12,8 @@
12
12
  end
13
13
  %>
14
14
 
15
- <div class="row <%= promethee_class_for component %>">
15
+ <div class="row <%= promethee_class_for component %>"
16
+ id="<%= promethee_id_for component %>">
16
17
  <% component[:children].each.with_index do |child, n| %>
17
18
  <div class="<%= col_classes %>">
18
19
  <%= render 'promethee/show/component', component: child %>
@@ -17,8 +17,8 @@ when 'video'
17
17
  end
18
18
  end
19
19
  %>
20
- <div class="collection-item__content">
21
-
20
+ <div class="<%= promethee_class_for component %> collection-item__content"
21
+ id="<%= promethee_id_for component %>">
22
22
  <% if iframe_src.present? %>
23
23
  <div class="embed-responsive embed-responsive-16by9">
24
24
  <iframe frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" src="<%= iframe_src %>"></iframe>
@@ -26,5 +26,7 @@ end
26
26
  <% elsif image_blob.present? %>
27
27
  <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', caption: caption %>
28
28
  <% end %>
29
- <%= caption %>
29
+ <div class="collection-item__content__caption">
30
+ <%= caption %>
31
+ </div>
30
32
  </div>
@@ -41,6 +41,7 @@ if component[:attributes].dig(:mobile, :value, :enabled, :value)
41
41
  classes += " col-xs-#{size} col-xs-offset-#{offset}" # BS3, does nothing for BS4
42
42
  end
43
43
  %>
44
- <div class="<%= classes %> <%= promethee_class_for component %>">
44
+ <div class="<%= classes %> <%= promethee_class_for component %>"
45
+ id="<%= promethee_id_for component %>">
45
46
  <%= render 'promethee/show/components', components: component[:children] %>
46
47
  </div>
@@ -5,7 +5,9 @@ surtitle = component[:attributes].dig(:surtitle, :value)&.to_s
5
5
  title = component[:attributes].dig(:title, :value)&.to_s
6
6
  subtitle = component[:attributes].dig(:subtitle, :value)&.to_s
7
7
  %>
8
- <div id="component-<%= component[:id] %>" class="<%= promethee_class_for(component) %>" style="background-image: url(<%= url_for(blob.variant(resize: '1920>', quality: 95)) if blob %>)">
8
+ <div class="<%= promethee_class_for(component) %>"
9
+ id="<%= promethee_id_for component %>"
10
+ style="background-image: url(<%= url_for(blob.variant(resize: '1920>', quality: 95)) if blob %>)">
9
11
  <div class="container">
10
12
  <div class="promethee__component__row">
11
13
  <div class="promethee__component__content">
@@ -1,4 +1,5 @@
1
- <div class="<%= promethee_class_for component %>">
1
+ <div class="<%= promethee_class_for component %>"
2
+ id="<%= promethee_id_for component %>">
2
3
  <div class="promethee__component__row">
3
4
  <div class="promethee__component__content">
4
5
  <% component[:children].each do |child| %>
@@ -6,7 +6,8 @@ special_question = component[:attributes].dig(:special_question, :value)
6
6
  image_blob = blob_from_data component[:attributes].dig(:image, :value)
7
7
  %>
8
8
 
9
- <div class="<%= promethee_class_for component %> <%= 'promethee__component__faq_item--special' if special_question %>">
9
+ <div class="<%= promethee_class_for component %> <%= 'promethee__component__faq_item--special' if special_question %>"
10
+ id="<%= promethee_id_for component %>">
10
11
  <h4 data-toggle="collapse"
11
12
  data-target="#collapse-faq-<%= component[:id] %>"
12
13
  aria-expanded="false"
@@ -4,7 +4,8 @@ blob = blob_from_data component[:attributes].dig(:image, :value)
4
4
  alt = component[:attributes].dig(:alt, :value)&.to_s
5
5
  caption = component[:attributes].dig(:caption, :value)&.to_s
6
6
  %>
7
- <figure class="<%= promethee_class_for component %>">
7
+ <figure class="<%= promethee_class_for component %>"
8
+ id="<%= promethee_id_for component %>">
8
9
  <div class="promethee__component__row">
9
10
  <div class="promethee__component__content">
10
11
  <%= render 'promethee/show/image.srcset', blob: blob, alt: alt, caption: caption if blob %>
@@ -11,6 +11,7 @@
11
11
  <script><%= javascripts %></script>
12
12
  <% end %>
13
13
 
14
- <div class="<%= promethee_class_for component %>">
14
+ <div class="<%= promethee_class_for component %>"
15
+ id="<%= promethee_id_for component %>">
15
16
  <%= render 'promethee/show/components', components: component[:children] %>
16
17
  </div>
@@ -22,6 +22,7 @@ end
22
22
  %>
23
23
 
24
24
  <div class="row <%= promethee_class_for component %><%= ' promethee__component__row--background' if has_background %>"
25
+ id="<%= promethee_id_for component %>"
25
26
  style="background-color: <%= background_color %>; <%= background_images.count > 0 ? "background-repeat: no-repeat; background-image: #{background_images.join(', ')}; background-position: #{background_positions.join(', ')}; background-size: #{background_sizes.join(', ')};" : '' %>">
26
27
  <%= render 'promethee/show/components', components: component[:children] %>
27
28
  </div>
@@ -1,4 +1,6 @@
1
- <div id="slider-<%= component[:id] %>" class="carousel slide <%= promethee_class_for component %>" data-ride="carousel">
1
+ <div class="carousel slide <%= promethee_class_for component %>"
2
+ id="<%= promethee_id_for component %>"
3
+ data-ride="carousel">
2
4
  <div class="carousel-inner">
3
5
  <% component[:children].each.with_index do |item, n| %>
4
6
  <div class="carousel-item item<%= ' active' if n.zero? %>">
@@ -7,10 +9,12 @@
7
9
  <% end %>
8
10
  </div>
9
11
 
10
- <a class="left carousel-control fontawesome-carousel-control carousel-control-prev" href="#slider-<%= component[:id] %>" data-slide="prev">
11
- <%= icon('fa', 'chevron-left') %>
12
- </a>
13
- <a class="right carousel-control fontawesome-carousel-control carousel-control-next" href="#slider-<%= component[:id] %>" data-slide="next">
14
- <%= icon('fa', 'chevron-right') %>
15
- </a>
12
+ <% if component[:children].many? %>
13
+ <a class="left carousel-control fontawesome-carousel-control carousel-control-prev" href="#<%= promethee_id_for component %>" data-slide="prev">
14
+ <%= icon('fa', 'chevron-left') %>
15
+ </a>
16
+ <a class="right carousel-control fontawesome-carousel-control carousel-control-next" href="#<%= promethee_id_for component %>" data-slide="next">
17
+ <%= icon('fa', 'chevron-right') %>
18
+ </a>
19
+ <% end %>
16
20
  </div>
@@ -17,13 +17,16 @@ when 'video'
17
17
  end
18
18
  end
19
19
  %>
20
- <div class="carousel-item__content">
20
+ <div class="<%= promethee_class_for component %> carousel-item__content"
21
+ id="<%= promethee_id_for component %>">
21
22
  <% if iframe_src.present? %>
22
23
  <div class="embed-responsive embed-responsive-16by9">
23
24
  <iframe frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" src="<%= iframe_src %>"></iframe>
24
25
  </div>
25
26
  <% elsif image_blob.present? %>
26
- <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', caption: caption %>
27
+ <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', caption: caption, image_zoomable: false %>
27
28
  <% end %>
28
- <%= caption %>
29
+ <div class="carousel-item__content__caption">
30
+ <%= caption %>
31
+ </div>
29
32
  </div>
@@ -12,7 +12,8 @@
12
12
  headerRow = rows.shift
13
13
  %>
14
14
 
15
- <div id="component-<%= component[:id] %>" class="<%= promethee_class_for(component) %>">
15
+ <div class="<%= promethee_class_for(component) %>"
16
+ id="<%= promethee_id_for component %>">
16
17
  <% unless headerRow.nil? %>
17
18
  <div class="table-responsive">
18
19
  <table class="table">
@@ -25,7 +26,13 @@
25
26
  </thead>
26
27
  <tbody>
27
28
  <% rows.each do |row| %>
28
- <tr>
29
+ <%
30
+ row_class = 'empty'
31
+ row.each do |cell|
32
+ row_class = '' unless cell[:text].blank?
33
+ end
34
+ %>
35
+ <tr class="<%= row_class %>">
29
36
  <% row.each do |cell| %>
30
37
  <td><%= cell[:text] %></td>
31
38
  <% end %>
@@ -1,7 +1,8 @@
1
1
  <%
2
2
  body = component[:attributes].dig(:body, :value)&.to_s&.html_safe
3
3
  %>
4
- <div class="<%= promethee_class_for component %>">
4
+ <div class="<%= promethee_class_for component %>"
5
+ id="<%= promethee_id_for component %>">
5
6
  <div class="promethee__component__row">
6
7
  <div class="promethee__component__content">
7
8
  <%= body %>
@@ -14,7 +14,8 @@ else
14
14
  iframe_src = url
15
15
  end
16
16
  %>
17
- <div class="<%= promethee_class_for component %>">
17
+ <div class="<%= promethee_class_for component %>"
18
+ id="<%= promethee_id_for component %>">
18
19
  <div class="promethee__component__row">
19
20
  <div class="promethee__component__content">
20
21
  <div class="embed-responsive embed-responsive-16by9">
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  angular.injector(['ng', 'Promethee']).get('presets').push({
3
3
  name: 'Image with text',
4
- icon: <%= render('promethee/presets/icon.image-with-text').to_json.html_safe %>,
4
+ icon: <%= promethee_preset_render_icon 'image-with-text' %>,
5
5
  position: 1,
6
6
  components: [
7
7
  {
@@ -9,7 +9,8 @@ module ActionView
9
9
  @options[:master_data] = object.send @method_name unless object.nil?
10
10
  @options[:master_data] = @options[:value] if @options.key?(:value)
11
11
  @options[:disable_page_attributes] ||= false
12
- ApplicationController.renderer.render partial: 'promethee/edit', locals: @options
12
+
13
+ @template_object.render partial: 'promethee/edit', locals: @options
13
14
  end
14
15
  end
15
16
 
@@ -18,15 +19,16 @@ module ActionView
18
19
  localization_data = object.send @method_name unless object.nil?
19
20
  localization_data = @options[:value] if @options.include? :value
20
21
  @options[:disable_page_attributes] ||= false
21
- ApplicationController.renderer.render partial: 'promethee/localize',
22
- locals: {
23
- object_name: @object_name,
24
- method_name: @method_name,
25
- localization_data: localization_data,
26
- master_data: @options[:master],
27
- other_data: @options[:other],
28
- disable_page_attributes: @options[:disable_page_attributes]
29
- }
22
+
23
+ @template_object.render partial: 'promethee/localize',
24
+ locals: {
25
+ object_name: @object_name,
26
+ method_name: @method_name,
27
+ localization_data: localization_data,
28
+ master_data: @options[:master],
29
+ other_data: @options[:other],
30
+ disable_page_attributes: @options[:disable_page_attributes]
31
+ }
30
32
  end
31
33
  end
32
34
  end
@@ -3,7 +3,7 @@ module Promethee::Rails::Helper
3
3
  render partial: 'promethee/show', locals: { master_data: data, localization_data: options[:l] }
4
4
  end
5
5
 
6
- def promethee_class_for component, *modifiers
6
+ def promethee_class_for(component, *modifiers)
7
7
  base = "promethee__component"
8
8
  component_base = "#{base}__#{component[:type]}"
9
9
 
@@ -14,6 +14,10 @@ module Promethee::Rails::Helper
14
14
  ].flatten.select(&:present?).join ' '
15
15
  end
16
16
 
17
+ def promethee_id_for(component)
18
+ "promethee-component-#{component[:id]}"
19
+ end
20
+
17
21
  def promethee_component_partials
18
22
  promethee_partials_for 'components/*/_edit.*.html.erb'
19
23
  end
@@ -22,6 +26,10 @@ module Promethee::Rails::Helper
22
26
  render("promethee/components/#{icon}/icon.svg").to_json.html_safe
23
27
  end
24
28
 
29
+ def promethee_preset_render_icon(icon)
30
+ render("promethee/presets/icon.#{icon}.svg").to_json.html_safe
31
+ end
32
+
25
33
  def promethee_util_partials
26
34
  promethee_partials_for 'utils/_*.html.erb'
27
35
  end
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '4.1.8'
3
+ VERSION = '4.1.13'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promethee
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.8
4
+ version: 4.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Gaya
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-08-24 00:00:00.000000000 Z
17
+ date: 2020-09-10 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails