promethee 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/app/models/concerns/promethee_data.rb +23 -12
 - data/app/views/promethee/components/collection_item/_edit.move.html.erb +2 -2
 - data/app/views/promethee/components/faq_item/_localize.html.erb +1 -1
 - data/lib/promethee/data/master_localized.rb +4 -8
 - data/lib/promethee/rails/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 830a5df82ba3d7061fbb76916d8ebf5775c0d930c42ab1fb9b7a767276709e32
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 73587510af2189dd522402903a7e6168fdd8c79c165e0ddb04cf1419cb725483
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 3f20fce51ba8489ce01f449c04381566df8a82d724192acf061d2fb43c66fd0b10fc3cd1da69545babdca27ec4df5b164295f7fb371d6237975f11433e9b2512
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a40324a77abf49e3a66ec40f63d375ace44b002ca1ce1819f945a1445bb829b6f891a40d4cd21d502a8f16e2414f5a45f39b7dceba1e2cf9dfa8f043dba891c3
         
     | 
| 
         @@ -11,7 +11,7 @@ module PrometheeData 
     | 
|
| 
       11 
11 
     | 
    
         
             
              def promethee_data_page_title
         
     | 
| 
       12 
12 
     | 
    
         
             
                data['attributes']['searchable_title']
         
     | 
| 
       13 
13 
     | 
    
         
             
              rescue
         
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
      
 14 
     | 
    
         
            +
                ''
         
     | 
| 
       15 
15 
     | 
    
         
             
              end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
              def promethee_data_page_title=(value)
         
     | 
| 
         @@ -21,7 +21,7 @@ module PrometheeData 
     | 
|
| 
       21 
21 
     | 
    
         
             
              def promethee_data_page_description
         
     | 
| 
       22 
22 
     | 
    
         
             
                data['attributes']['searchable_description']
         
     | 
| 
       23 
23 
     | 
    
         
             
              rescue
         
     | 
| 
       24 
     | 
    
         
            -
                 
     | 
| 
      
 24 
     | 
    
         
            +
                ''
         
     | 
| 
       25 
25 
     | 
    
         
             
              end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         
             
              def promethee_data_page_description=(value)
         
     | 
| 
         @@ -32,13 +32,13 @@ module PrometheeData 
     | 
|
| 
       32 
32 
     | 
    
         
             
              def promethee_data_translation_title
         
     | 
| 
       33 
33 
     | 
    
         
             
                data['components'].first['attributes']['searchable_title']
         
     | 
| 
       34 
34 
     | 
    
         
             
              rescue
         
     | 
| 
       35 
     | 
    
         
            -
                 
     | 
| 
      
 35 
     | 
    
         
            +
                ''
         
     | 
| 
       36 
36 
     | 
    
         
             
              end
         
     | 
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
              def promethee_data_translation_description
         
     | 
| 
       39 
39 
     | 
    
         
             
                data['components'].first['attributes']['searchable_description']
         
     | 
| 
       40 
40 
     | 
    
         
             
              rescue
         
     | 
| 
       41 
     | 
    
         
            -
                 
     | 
| 
      
 41 
     | 
    
         
            +
                ''
         
     | 
| 
       42 
42 
     | 
    
         
             
              end
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         | 
| 
         @@ -52,19 +52,30 @@ module PrometheeData 
     | 
|
| 
       52 
52 
     | 
    
         
             
              def promethee_extract_searchable(component)
         
     | 
| 
       53 
53 
     | 
    
         
             
                return '' if component.blank?
         
     | 
| 
       54 
54 
     | 
    
         
             
                searchable = ' '
         
     | 
| 
       55 
     | 
    
         
            -
                component['attributes'] 
     | 
| 
      
 55 
     | 
    
         
            +
                searchable += promethee_extract_searchable_attributes component['attributes'] if component.include?('attributes')
         
     | 
| 
      
 56 
     | 
    
         
            +
                # For masters, contents are in children
         
     | 
| 
      
 57 
     | 
    
         
            +
                searchable += promethee_extract_searchable_children component['children'] if component.include? 'children'
         
     | 
| 
      
 58 
     | 
    
         
            +
                # For translations, contents are in components, not children
         
     | 
| 
      
 59 
     | 
    
         
            +
                searchable += promethee_extract_searchable_children component['components'] if component.include? 'components'
         
     | 
| 
      
 60 
     | 
    
         
            +
                searchable
         
     | 
| 
      
 61 
     | 
    
         
            +
              end
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
              def promethee_extract_searchable_attributes(attributes)
         
     | 
| 
      
 64 
     | 
    
         
            +
                searchable = ' '
         
     | 
| 
      
 65 
     | 
    
         
            +
                attributes.each do |key, value|
         
     | 
| 
       56 
66 
     | 
    
         
             
                  if key.starts_with? 'searchable_'
         
     | 
| 
       57 
67 
     | 
    
         
             
                    clean_value = strip_tags value
         
     | 
| 
       58 
68 
     | 
    
         
             
                    searchable += "#{clean_value} "
         
     | 
| 
       59 
69 
     | 
    
         
             
                  end
         
     | 
| 
       60 
     | 
    
         
            -
                end 
     | 
| 
       61 
     | 
    
         
            -
                 
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
                 
     | 
| 
      
 70 
     | 
    
         
            +
                end
         
     | 
| 
      
 71 
     | 
    
         
            +
                searchable
         
     | 
| 
      
 72 
     | 
    
         
            +
              end
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
              def promethee_extract_searchable_children(components)
         
     | 
| 
      
 75 
     | 
    
         
            +
                searchable = ' '
         
     | 
| 
      
 76 
     | 
    
         
            +
                components.each do |child|
         
     | 
| 
       66 
77 
     | 
    
         
             
                  searchable += promethee_extract_searchable child
         
     | 
| 
       67 
     | 
    
         
            -
                end 
     | 
| 
      
 78 
     | 
    
         
            +
                end
         
     | 
| 
       68 
79 
     | 
    
         
             
                searchable
         
     | 
| 
       69 
80 
     | 
    
         
             
              end
         
     | 
| 
       70 
81 
     | 
    
         
             
            end
         
     | 
| 
         @@ -13,7 +13,7 @@ 
     | 
|
| 
       13 
13 
     | 
    
         
             
                    </div>
         
     | 
| 
       14 
14 
     | 
    
         
             
                  </div>
         
     | 
| 
       15 
15 
     | 
    
         
             
                  <div class="row">
         
     | 
| 
       16 
     | 
    
         
            -
                    <div class="col-xs-12 collection-item-caption" ng-show="component.attributes.searchable_caption  
     | 
| 
      
 16 
     | 
    
         
            +
                    <div class="col-xs-12 collection-item-caption" ng-show="component.attributes.searchable_caption" ng-bind-html="component.attributes.searchable_caption | htmlSafe"></div>
         
     | 
| 
       17 
17 
     | 
    
         
             
                  </div>
         
     | 
| 
       18 
18 
     | 
    
         
             
                </div>
         
     | 
| 
       19 
19 
     | 
    
         
             
              </div>
         
     | 
| 
         @@ -43,4 +43,4 @@ 
     | 
|
| 
       43 
43 
     | 
    
         
             
                  }
         
     | 
| 
       44 
44 
     | 
    
         
             
                })
         
     | 
| 
       45 
45 
     | 
    
         
             
              }]);
         
     | 
| 
       46 
     | 
    
         
            -
            </script>
         
     | 
| 
      
 46 
     | 
    
         
            +
            </script>
         
     | 
| 
         @@ -11,26 +11,22 @@ class Promethee::Data::MasterLocalized < Promethee::Data 
     | 
|
| 
       11 
11 
     | 
    
         
             
              protected
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
              def localize_component(component)
         
     | 
| 
       14 
     | 
    
         
            -
                localize_component_attributes component
         
     | 
| 
       15 
     | 
    
         
            -
                localize_component_children component
         
     | 
| 
      
 14 
     | 
    
         
            +
                localize_component_attributes component if component.include?(:attributes)
         
     | 
| 
      
 15 
     | 
    
         
            +
                localize_component_children component if component.include?(:children)
         
     | 
| 
       16 
16 
     | 
    
         
             
              end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
              def localize_component_attributes(component)
         
     | 
| 
       19 
     | 
    
         
            -
                return unless component.include? :attributes
         
     | 
| 
       20 
19 
     | 
    
         
             
                localized_component = find_localized_component component[:id]
         
     | 
| 
       21 
     | 
    
         
            -
                return  
     | 
| 
       22 
     | 
    
         
            -
                return unless localized_component.include? :attributes
         
     | 
| 
      
 20 
     | 
    
         
            +
                return if (localized_component.nil? || !localized_component.include?(:attributes))
         
     | 
| 
       23 
21 
     | 
    
         
             
                component[:attributes].merge! localized_component[:attributes]
         
     | 
| 
       24 
22 
     | 
    
         
             
              end
         
     | 
| 
       25 
23 
     | 
    
         | 
| 
       26 
24 
     | 
    
         
             
              def localize_component_children(component)
         
     | 
| 
       27 
     | 
    
         
            -
                return unless component.include? :children
         
     | 
| 
       28 
25 
     | 
    
         
             
                component[:children].each { |child| localize_component child }
         
     | 
| 
       29 
26 
     | 
    
         
             
              end
         
     | 
| 
       30 
27 
     | 
    
         | 
| 
       31 
28 
     | 
    
         
             
              def find_localized_component(id)
         
     | 
| 
       32 
     | 
    
         
            -
                return if @localization.nil?
         
     | 
| 
       33 
     | 
    
         
            -
                return unless @localization.include? :components
         
     | 
| 
      
 29 
     | 
    
         
            +
                return if @localization.nil? || !@localization.include?(:components)
         
     | 
| 
       34 
30 
     | 
    
         
             
                @localization[:components].find { |component| component[:id] == id }
         
     | 
| 
       35 
31 
     | 
    
         
             
              end
         
     | 
| 
       36 
32 
     | 
    
         
             
            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: 1.7. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.7.2
         
     | 
| 
       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: 2018-08- 
     | 
| 
      
 17 
     | 
    
         
            +
            date: 2018-08-02 00:00:00.000000000 Z
         
     | 
| 
       18 
18 
     | 
    
         
             
            dependencies:
         
     | 
| 
       19 
19 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       20 
20 
     | 
    
         
             
              name: rails
         
     |