promethee 4.1.12 → 4.1.17

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: 5c791f3fc87492c74cf0943f04ee9d7c65731ed6769688294dfbe45baee5d663
4
- data.tar.gz: e584208ada91f6c1d8e38f2f10d10e6605d3e44db13219c2dbb5f9300e235f43
3
+ metadata.gz: 0e6e42f0d4cb145f8b35d05d3f25bd1aa3a232893b582a33dd1b87f6ec12a043
4
+ data.tar.gz: bf7f8e5795187559af358cd49d9c765e410aba8636c3015e6b51f4f6b4dd11b6
5
5
  SHA512:
6
- metadata.gz: 3c1de9aed61106c72bc8db3e9dcd3fc2481edc42bddfc5ca8adc3015b5cb6620e84f0b991f61a3b7d58f7bbef4eb34eda76705d2265f1d9ce315aac05462d83a
7
- data.tar.gz: 0e829aabd72bd3e964cd6d0d8d0ce5872d05f69281e88f114e87d72aaae5268f44e50c4e4206f74331312f07eacf7949be2ff9cc11d70bcda565c9f4e35fb147
6
+ metadata.gz: 0b2631fe22a469a19b9e76dddb109c9b6829cffc46df68f123a4cc2fae106474c6927a93bcf2d6fd89af06a9f981dadf96683c74b365aabde8a2febfcb2ff3e9
7
+ data.tar.gz: 4f3b348bceb066ad90efecaf6b5bd7cc621cc57facab8cfba2de7c9a0917f02075e54a9c729bafe62eb106f49842ad57a2b24c7ba2be1794512fac3c00da113b
@@ -161,12 +161,16 @@ $black: #000000 !default
161
161
  font-size: 30px
162
162
 
163
163
  &__table
164
- tr.empty
165
- background-color: #EEEEEE
166
- td
167
- line-height: 1px
168
- padding-bottom: 1px
169
- padding-top: 1px
164
+ tr
165
+ p
166
+ line-height: $line-height-base
167
+ margin-bottom: 0
168
+ &.empty
169
+ background-color: #EEEEEE
170
+ td
171
+ line-height: 1px
172
+ padding-bottom: 1px
173
+ padding-top: 1px
170
174
 
171
175
 
172
176
  // component direct in root
@@ -24,7 +24,7 @@ end
24
24
  <iframe frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" src="<%= iframe_src %>"></iframe>
25
25
  </div>
26
26
  <% elsif image_blob.present? %>
27
- <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', caption: caption %>
27
+ <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', title: '', caption: caption %>
28
28
  <% end %>
29
29
  <div class="collection-item__content__caption">
30
30
  <%= caption %>
@@ -19,7 +19,7 @@ image_blob = blob_from_data component[:attributes].dig(:image, :value)
19
19
  <% if image_blob %>
20
20
  <div class="row ">
21
21
  <div class="col-3 col-xs-3">
22
- <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', caption: '' %>
22
+ <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', title: '', caption: '' %>
23
23
  </div>
24
24
  <div class="col-9 col-xs-9">
25
25
  <%= body %>
@@ -28,6 +28,12 @@
28
28
  translatable: true,
29
29
  type: 'string',
30
30
  value: ''
31
+ },
32
+ title: {
33
+ searchable: true,
34
+ translatable: true,
35
+ type: 'string',
36
+ value: ''
31
37
  }
32
38
  }
33
39
  }
@@ -12,5 +12,10 @@
12
12
  <label class="label-control">Alt</label>
13
13
  <input class="form-control" ng-model="promethee.inspected.attributes.alt.value">
14
14
  </div>
15
+
16
+ <div class="form-group">
17
+ <label class="label-control">Title</label>
18
+ <input class="form-control" ng-model="promethee.inspected.attributes.title.value">
19
+ </div>
15
20
  </div>
16
21
  </script>
@@ -37,4 +37,17 @@
37
37
  </div>
38
38
  </div>
39
39
  </div>
40
+
41
+ <div class="row" ng-show="master.attributes.title.value || frozen_component.attributes.title.value">
42
+ <div class="col-md-6">
43
+ <b>Title</b>
44
+ <p>{{master.attributes.title.value}}</p>
45
+ </div>
46
+ <div class="col-md-6">
47
+ <div class="form-group">
48
+ <b>Title</b>
49
+ <input class="form-control" ng-model="component.attributes.title.value" type="text">
50
+ </div>
51
+ </div>
52
+ </div>
40
53
  </script>
@@ -2,13 +2,14 @@
2
2
  blob = blob_from_data component[:attributes].dig(:image, :value)
3
3
 
4
4
  alt = component[:attributes].dig(:alt, :value)&.to_s
5
+ title = component[:attributes].dig(:title, :value)&.to_s
5
6
  caption = component[:attributes].dig(:caption, :value)&.to_s
6
7
  %>
7
8
  <figure class="<%= promethee_class_for component %>"
8
9
  id="<%= promethee_id_for component %>">
9
10
  <div class="promethee__component__row">
10
11
  <div class="promethee__component__content">
11
- <%= render 'promethee/show/image.srcset', blob: blob, alt: alt, caption: caption if blob %>
12
+ <%= render 'promethee/show/image.srcset', blob: blob, alt: alt, title: title, caption: caption if blob %>
12
13
  <% unless caption.blank? %>
13
14
  <figcaption>
14
15
  <%= caption %>
@@ -24,7 +24,7 @@ end
24
24
  <iframe frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" src="<%= iframe_src %>"></iframe>
25
25
  </div>
26
26
  <% elsif image_blob.present? %>
27
- <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', caption: caption, image_zoomable: false %>
27
+ <%= render 'promethee/show/image.srcset', blob: image_blob, alt: '', title: '', caption: caption, image_zoomable: false %>
28
28
  <% end %>
29
29
  <div class="carousel-item__content__caption">
30
30
  <%= caption %>
@@ -48,9 +48,7 @@
48
48
  {{ getTableCell(getHeaderCellUids()[$index]).attributes.text.value }}
49
49
  </span>
50
50
  <br/>
51
- <input type="text"
52
- ng-model="getTableCell(cellUid).attributes.text.value"
53
- class="form-control" />
51
+ <summernote config="summernoteConfig" ng-model="getTableCell(cellUid).attributes.text.value"></summernote>
54
52
  </div>
55
53
  </div>
56
54
  <hr>
@@ -5,14 +5,14 @@
5
5
  <thead>
6
6
  <tr>
7
7
  <th ng-repeat="cellUid in component.attributes.structure.value[0]">
8
- {{getTableCell(cellUid).attributes.text.value}}
8
+ <div ng-bind-html="getTableCell(cellUid).attributes.text.value | htmlSafe"></div>
9
9
  </th>
10
10
  </tr>
11
11
  </thead>
12
12
  <tbody>
13
13
  <tr ng-repeat="row in component.attributes.structure.value" ng-if="$index > 0">
14
14
  <td ng-repeat="cellUid in row">
15
- {{getTableCell(cellUid).attributes.text.value}}
15
+ <div ng-bind-html="getTableCell(cellUid).attributes.text.value | htmlSafe"></div>
16
16
  </td>
17
17
  </tr>
18
18
  </tbody>
@@ -4,7 +4,7 @@
4
4
  row.map { |cellUid|
5
5
  {
6
6
  uid: cellUid,
7
- text: cells.find { |cell| cell[:id] == cellUid }.dig(:attributes, :text, :value)
7
+ text: cells.find { |cell| cell[:id] == cellUid }.dig(:attributes, :text, :value)&.html_safe
8
8
  }
9
9
  }
10
10
  }
@@ -11,7 +11,7 @@
11
11
  text: {
12
12
  searchable: true,
13
13
  translatable: true,
14
- type: 'string',
14
+ type: 'text',
15
15
  value: ''
16
16
  }
17
17
  }
@@ -0,0 +1 @@
1
+ <%# Defined in components/table/_edit.inspect.html.erb %>
@@ -0,0 +1 @@
1
+ <%# Defined in components/table/_edit.move.html.erb %>
@@ -2,11 +2,11 @@
2
2
  <div class="row mt-2" ng-show="master.attributes.text.value || frozen_component.attributes.text.value">
3
3
  <div class="col-md-6">
4
4
  <b>Text</b>
5
- <p>{{ master.attributes.text.value }}</p>
5
+ <div ng-bind-html="master.attributes.text.value | htmlSafe"></div>
6
6
  </div>
7
7
  <div class="col-md-6">
8
8
  <b>Text</b>
9
- <input class="form-control" ng-model="component.attributes.text.value" type="text">
9
+ <summernote config="summernoteConfig" ng-model="component.attributes.text.value"></summernote>
10
10
  </div>
11
11
  </div>
12
12
  </script>
@@ -0,0 +1 @@
1
+ <%# Defined in components/table/_show.html.erb %>
@@ -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
  {
@@ -1,6 +1,10 @@
1
- <% image_zoomable = true if image_zoomable.nil? # do not use ||= as image_zoomable may be "false" %>
2
- <% fullsize_url = url_for(blob) %>
3
- <% image_width = blob.metadata.has_key?(:width) ? blob.metadata[:width] : ActiveStorage::Analyzer::ImageAnalyzer.new(blob).metadata[:width] %>
1
+ <%
2
+ image_zoomable = true if image_zoomable.nil? # do not use ||= as image_zoomable may be "false"
3
+ fullsize_url = url_for(blob)
4
+ image_width = blob.metadata.has_key?(:width) ? blob.metadata[:width] : ActiveStorage::Analyzer::ImageAnalyzer.new(blob).metadata[:width]
5
+ alt ||= ''
6
+ title ||= ''
7
+ %>
4
8
 
5
9
  <% if image_zoomable %>
6
10
  <a data-fancybox="gallery" title="<%= strip_tags(caption) %>" href="<%= fullsize_url %>">
@@ -14,7 +18,8 @@
14
18
  "
15
19
  width="<%= image_width %>"
16
20
  sizes="100vw"
17
- alt="<%= alt.html_safe %>"
21
+ alt="<%= j alt %>"
22
+ title="<%= j title %>"
18
23
  class="img-fluid img-responsive"
19
24
  >
20
25
 
@@ -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
@@ -26,6 +26,10 @@ module Promethee::Rails::Helper
26
26
  render("promethee/components/#{icon}/icon.svg").to_json.html_safe
27
27
  end
28
28
 
29
+ def promethee_preset_render_icon(icon)
30
+ render("promethee/presets/icon.#{icon}.svg").to_json.html_safe
31
+ end
32
+
29
33
  def promethee_util_partials
30
34
  promethee_partials_for 'utils/_*.html.erb'
31
35
  end
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '4.1.12'
3
+ VERSION = '4.1.17'
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.12
4
+ version: 4.1.17
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-09-03 00:00:00.000000000 Z
17
+ date: 2020-11-06 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
@@ -504,7 +504,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
504
504
  - !ruby/object:Gem::Version
505
505
  version: '0'
506
506
  requirements: []
507
- rubygems_version: 3.0.3
507
+ rubygems_version: 3.1.4
508
508
  signing_key:
509
509
  specification_version: 4
510
510
  summary: Bring fire to your page