promethee 4.1.2 → 4.1.7

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: 1bc4afceb6c4315b9d5728d0c3e1b2d2ed3f800a28ac60aac2cc13754316db5b
4
- data.tar.gz: b5e05bc16cd784f62be3b04750f7c5cf01e77fd083c2f2ffa38b8d9afe2cd421
3
+ metadata.gz: 273ea8989bee7c01520af11dcedbf568122937eac2c54f57ee493394604f69cf
4
+ data.tar.gz: 001cfbf000acf02f23daeba707d03156f2bb45eafe9317c355cc54df463460b1
5
5
  SHA512:
6
- metadata.gz: 2e1dfc1eea044db0d8d4ab9d6da90012ef45ece957a48479e7514698e2c6683ea124611d5fc6b6d9f8df3cea435564a92ec5af5dabe7cdcbfa0be50f11a5b44f
7
- data.tar.gz: c31ddf29e3aad80ca4066ea2427c375c401b9169ded619450fbfd3e7bd8794eef47eb050f1b7c77780a832bca14448d12c276d0524b029c3ca9294741b2fe356
6
+ metadata.gz: e8d5b0383e16473baf45140e8907275e5831fd994c0b6c02127234fa3cb27b991376ec632b53eb556673b6ac96e8a1a504f7c989be802579cf1e99b6355a6eda
7
+ data.tar.gz: 9e43292b6a4d035c6a6b0a54fd17f115eb63bcc245ff3d561744702e0b5cf22353bed3495b7048471679ab41a198b4456fee21180b82c4f92841ce19a5f3d596
@@ -6,10 +6,12 @@
6
6
  line-height: 100%
7
7
  &__inner
8
8
  border: 1px solid #CCCCCC
9
- min-height: 50px
9
+ display: flex
10
+ flex-direction: column
11
+ justify-content: center
12
+ min-height: 70px
10
13
  position: relative
11
14
  p.text-empty
12
- line-height: 50px
13
15
  margin-bottom: 0
14
16
  &--selected
15
17
  > .promethee-edit__component__inner
@@ -164,20 +164,26 @@ $black: #000000 !default
164
164
  // component direct in root
165
165
  &__page > &__blockquote,
166
166
  &__page > &__cover
167
- .promethee__component__content
168
- @extend .col-md-8
169
- @extend .offset-md-2 !optional
170
- @extend .col-md-offset-2 !optional
167
+ .promethee__component
168
+ &__row
169
+ @extend .row
170
+ &__content
171
+ @extend .col-md-8
172
+ @extend .offset-md-2 !optional
173
+ @extend .col-md-offset-2 !optional
171
174
 
172
175
  &__page > &__aside,
173
176
  &__page > &__faq,
174
177
  &__page > &__image,
175
178
  &__page > &__text,
176
179
  &__page > &__video
177
- .promethee__component__content
178
- @extend .col-md-10
179
- @extend .offset-md-1 !optional
180
- @extend .col-md-offset-1 !optional
180
+ .promethee__component
181
+ &__row
182
+ @extend .row
183
+ &__content
184
+ @extend .col-md-10
185
+ @extend .offset-md-1 !optional
186
+ @extend .col-md-offset-1 !optional
181
187
 
182
188
 
183
189
  @media screen and (max-width: 767.98px)
@@ -187,6 +193,9 @@ $black: #000000 !default
187
193
  &__page > &__video
188
194
  padding-left: 0
189
195
  padding-right: 0
196
+ .promethee__component__row
197
+ margin-left: 0
198
+ margin-right: 0
190
199
  .promethee__component__content
191
200
  padding-left: 0
192
201
  padding-right: 0
@@ -17,9 +17,9 @@
17
17
  <div class="form-group">
18
18
  <label class="label-control">Button label position</label>
19
19
  <div>
20
- <label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position.value" type="radio" value="left" />Left </label>
21
- <label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position.value" type="radio" value="center" />Center </label>
22
- <label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position.value" type="radio" value="right" />Right </label>
20
+ <label class="radio-inline form-check form-check-inline"> <input ng-model="promethee.inspected.attributes.open_label_position.value" type="radio" value="left" class="form-check-input" />Left </label>
21
+ <label class="radio-inline form-check form-check-inline"> <input ng-model="promethee.inspected.attributes.open_label_position.value" type="radio" value="center" class="form-check-input" />Center </label>
22
+ <label class="radio-inline form-check form-check-inline"> <input ng-model="promethee.inspected.attributes.open_label_position.value" type="radio" value="right" class="form-check-input" />Right </label>
23
23
  </div>
24
24
  </div>
25
25
  </script>
@@ -16,7 +16,7 @@
16
16
  },
17
17
  author: {
18
18
  searchable: true,
19
- translatable: false,
19
+ translatable: true,
20
20
  type: 'string',
21
21
  value: ''
22
22
  }
@@ -3,16 +3,16 @@
3
3
  <label class="label-control">Items per line (on desktop):</label>
4
4
  <div class="row">
5
5
  <div class="col-xs-2 col-2">
6
- <input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="2"> 2
6
+ <label class="radio-inline form-check form-check-inline"><input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="2" class="form-check-input">2</label>
7
7
  </div>
8
8
  <div class="col-xs-2 col-2">
9
- <input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="3"> 3
9
+ <label class="radio-inline form-check form-check-inline"><input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="3" class="form-check-input">3</label>
10
10
  </div>
11
11
  <div class="col-xs-2 col-2">
12
- <input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="4"> 4
12
+ <label class="radio-inline form-check form-check-inline"><input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="4" class="form-check-input">4</label>
13
13
  </div>
14
14
  <div class="col-xs-2 col-2">
15
- <input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="6"> 6
15
+ <label class="radio-inline form-check form-check-inline"><input ng-model="promethee.inspected.attributes.items_per_line.value" type="radio" ng-value="6" class="form-check-input">6</label>
16
16
  </div>
17
17
  </div>
18
18
  </div>
@@ -2,8 +2,8 @@
2
2
  <div class="form-group">
3
3
  <label class="label-control">Media type</label>
4
4
  <div>
5
- <label class="radio-inline"> <input ng-model="promethee.inspected.attributes.media_type.value" type="radio" value="image" />Image </label>
6
- <label class="radio-inline"> <input ng-model="promethee.inspected.attributes.media_type.value" type="radio" value="video" />Video </label>
5
+ <label class="radio-inline form-check form-check-inline"> <input ng-model="promethee.inspected.attributes.media_type.value" type="radio" value="image" class="form-check-input" />Image </label>
6
+ <label class="radio-inline form-check form-check-inline"> <input ng-model="promethee.inspected.attributes.media_type.value" type="radio" value="video" class="form-check-input" />Video </label>
7
7
  </div>
8
8
  </div>
9
9
 
@@ -2,7 +2,7 @@
2
2
  <label class="label-control"><%= label %></label>
3
3
  <div style="margin-left: 2px">
4
4
  <% values.each do |value| %>
5
- <label class="radio-inline"> <input ng-model="<%= model %>" type="radio" value="<%= value %>" /><%= value.humanize %> </label>
5
+ <label class="radio-inline form-check form-check-inline"> <input ng-model="<%= model %>" type="radio" value="<%= value %>" class="form-check-input" /><%= value.humanize %> </label>
6
6
  <% end %>
7
7
  </div>
8
8
  </div>
@@ -3,7 +3,7 @@
3
3
  <% image_width = blob.metadata.has_key?(:width) ? blob.metadata[:width] : ActiveStorage::Analyzer::ImageAnalyzer.new(blob).metadata[:width] %>
4
4
 
5
5
  <% if image_zoomable %>
6
- <a data-fancybox title="<%= strip_tags(caption) %>" href="<%= fullsize_url %>">
6
+ <a data-fancybox="gallery" title="<%= strip_tags(caption) %>" href="<%= fullsize_url %>">
7
7
  <% end %>
8
8
  <img src="<%= fullsize_url %>"
9
9
  srcset="
@@ -11,11 +11,13 @@ class Promethee::Data::Localization < Promethee::Data
11
11
 
12
12
  # We want to be up to date with the master, so this method will:
13
13
  # 1.take the master's components flattened
14
- # 2 substitute what's already localized, based on the component id
14
+ # 2 substitute values of what's already localized, based on the component id
15
15
  # Consequences of step 1 are:
16
16
  # 1 it adds new components from the master
17
17
  # 2 it removes components not in the master anymore
18
18
  # 3 it takes the order from the master
19
+ # 4 use all translatable attributes from the master
20
+ # 5 merge them with translation values if they exist
19
21
  def merge
20
22
  @data_before_merge = @data.deep_dup
21
23
  @data = {
@@ -23,11 +25,10 @@ class Promethee::Data::Localization < Promethee::Data
23
25
  components: []
24
26
  }
25
27
  @master_data.flat.each do |master_component|
28
+ translatable_master_component = get_component_without_attributes_values(master_component)
26
29
  localized_component = find_localized_component master_component[:id]
27
- # We take the localized component if it exists, the master component otherwise
28
- component = localized_component || get_component_without_attributes_values(master_component)
29
- component[:attributes] ||= {}
30
- # We add it to the list of localized components
30
+
31
+ component = get_merged_translatable_component(translatable_master_component, localized_component)
31
32
  @data[:components] << component
32
33
  end
33
34
  end
@@ -43,6 +44,21 @@ class Promethee::Data::Localization < Promethee::Data
43
44
  clean_component
44
45
  end
45
46
 
47
+ def get_merged_translatable_component(master_component, localized_component)
48
+ # Not found in translation, we use the prepared master component
49
+ return master_component if localized_component.nil?
50
+
51
+ master_component[:attributes] ||= {}
52
+ localized_component[:attributes] ||= {}
53
+
54
+ # Merge values with the prepared master, allowing to add missing attributes from translation
55
+ master_component[:attributes].each do |attr_key, attr_value|
56
+ attr_value[:value] = localized_component.dig(:attributes, attr_key, :value) || ''
57
+ end
58
+
59
+ master_component
60
+ end
61
+
46
62
  def find_localized_component(id)
47
63
  return unless @data_before_merge
48
64
  return unless @data_before_merge.include? :components
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '4.1.2'
3
+ VERSION = '4.1.7'
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.2
4
+ version: 4.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Gaya
@@ -14,22 +14,28 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2020-03-09 00:00:00.000000000 Z
17
+ date: 2020-06-25 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: rails
21
21
  requirement: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: 5.2.0
26
+ - - "<"
27
+ - !ruby/object:Gem::Version
28
+ version: '6.1'
26
29
  type: :runtime
27
30
  prerelease: false
28
31
  version_requirements: !ruby/object:Gem::Requirement
29
32
  requirements:
30
- - - "~>"
33
+ - - ">="
31
34
  - !ruby/object:Gem::Version
32
35
  version: 5.2.0
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: '6.1'
33
39
  - !ruby/object:Gem::Dependency
34
40
  name: angularjs-rails
35
41
  requirement: !ruby/object:Gem::Requirement
@@ -118,16 +124,16 @@ dependencies:
118
124
  name: summernote-rails
119
125
  requirement: !ruby/object:Gem::Requirement
120
126
  requirements:
121
- - - "~>"
127
+ - - ">="
122
128
  - !ruby/object:Gem::Version
123
- version: 0.8.12.0
129
+ version: '0'
124
130
  type: :runtime
125
131
  prerelease: false
126
132
  version_requirements: !ruby/object:Gem::Requirement
127
133
  requirements:
128
- - - "~>"
134
+ - - ">="
129
135
  - !ruby/object:Gem::Version
130
- version: 0.8.12.0
136
+ version: '0'
131
137
  - !ruby/object:Gem::Dependency
132
138
  name: deep_merge_existing_keys
133
139
  requirement: !ruby/object:Gem::Requirement