promethee 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/promethee/_edit.html.erb +3 -2
- data/lib/promethee/data.rb +10 -13
- data/lib/promethee/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0446ad6a008e7f126a6bd3e691f2d9fb1cdf1164
|
4
|
+
data.tar.gz: faffb9120096340ab927218699794449beeb1b08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f428c8ae156ddb16051a183f7b4e5b721891baa1b2cf1501bb219954d4b6e2756e794a9d60bf2d45a666ace2ccbe43956f32e7b2dadfa823271c575a06eb13d7
|
7
|
+
data.tar.gz: fea5fa53d6f350df3666b5eb656ff0ffb75e5209227a663236a3038a4705a68968b6242463e9a410220466b68e3fa8c4f141e1b6ff7d1b4ac63bc9b9c1170793
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%
|
2
|
+
master_data ||= {}
|
2
3
|
promethee_data = Promethee::Data.new master_data
|
3
4
|
%>
|
4
5
|
|
@@ -25,12 +26,12 @@ promethee_data = Promethee::Data.new master_data
|
|
25
26
|
});
|
26
27
|
|
27
28
|
promethee.controller('PrometheeController', ['data', '$scope', 'definitions', '$http', function(data, $scope, definitions, $http) {
|
28
|
-
|
29
|
+
|
29
30
|
// Data (TODO use Adder and probably page definition to init)
|
30
31
|
if (data === null || data === '') {
|
31
32
|
data = {
|
32
33
|
id: '',
|
33
|
-
type: 'page',
|
34
|
+
type: 'page',
|
34
35
|
version: 1,
|
35
36
|
children: []
|
36
37
|
};
|
data/lib/promethee/data.rb
CHANGED
@@ -73,19 +73,17 @@ module Promethee
|
|
73
73
|
@master_data[:children]
|
74
74
|
end
|
75
75
|
|
76
|
+
def flat_children
|
77
|
+
self.class.flatten_components @master_data_unlocalized[:children]
|
78
|
+
end
|
79
|
+
|
76
80
|
def prepare_localization
|
77
81
|
# TODO extract localizable components from master data, in the correct order, merged with existing ones
|
78
82
|
# TODO update master_version
|
79
83
|
|
80
|
-
#
|
81
|
-
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
# We add master reference
|
86
|
-
flat_master_data.each do |data|
|
87
|
-
data[:master] = data.clone
|
88
|
-
end
|
84
|
+
# Selects only text components within the children components flat array
|
85
|
+
# TODO think about a better way to handle localized attributes among all the components (not only text type)
|
86
|
+
flat_master_data = flat_children.select { |component| component[:type].to_sym === :text }
|
89
87
|
|
90
88
|
if @localization_data
|
91
89
|
# If localization_data has been provided, we merge flat_master_data components with its components
|
@@ -94,10 +92,9 @@ module Promethee
|
|
94
92
|
localized_component[:id] == component[:id]
|
95
93
|
end
|
96
94
|
|
97
|
-
#
|
98
|
-
|
99
|
-
|
100
|
-
localized_component || component
|
95
|
+
# If the localized_component isn't found, we create it with the master (component)
|
96
|
+
# Eventually, we add a reference to the master in the localized component
|
97
|
+
(localized_component || component).merge master: component.deep_dup
|
101
98
|
end
|
102
99
|
else
|
103
100
|
# In the other case, localization_data components are flat_master_data components
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Dargelos
|
@@ -345,7 +345,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
345
345
|
version: '0'
|
346
346
|
requirements: []
|
347
347
|
rubyforge_project:
|
348
|
-
rubygems_version: 2.6.
|
348
|
+
rubygems_version: 2.6.12
|
349
349
|
signing_key:
|
350
350
|
specification_version: 4
|
351
351
|
summary: Bring fire to your page
|