promethee 1.4.1 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3977c58139169819464ec50d1e2350fce2269254
4
- data.tar.gz: 25dd886efeabf6883ab05a93ac28edc930ad3e90
3
+ metadata.gz: 0e9310c26b839c49494d9aceffa60d8b46e37281
4
+ data.tar.gz: ac9017a60e6e5a019af5a7426575cbb0befb38a8
5
5
  SHA512:
6
- metadata.gz: 608d2eedee387ea5e7e7dc2228030851dabb07b1623010aa28ba66fd0a3764cfffcfdba17c25ec2554435984037d6275ed20b14c72e7dadf7f1dfafc9dca1933
7
- data.tar.gz: b4572f476050c5d1502c0e768b9e23ae0b0b21107b43b7866bc17463c0e0c9360db1978f0cc6a13134602afb469b34aac74080697e86145d06ca0afb0fb3096a
6
+ metadata.gz: 6cf9bbb70156397ace563ea34180c012b37ca8155b0d1f55cb367f362b05ea1eed917b983aa3d873a03ee83a2976f4c6813271a0c3ff14d48c4566a6fff78e0d
7
+ data.tar.gz: f2fc6e21b5635adb1c66a271f576c95976a1c8ae65e95327f6606dd989a448026789493e052ea333f17f3de4dac2b362fabad66493b5baa68127968716b755f6
@@ -10,12 +10,20 @@
10
10
  </div>
11
11
 
12
12
  <div class="form-group">
13
- <label class="label-control">Alt</label>
14
- <input class="form-control" ng-model="promethee.inspected.attributes.alt">
13
+ <label class="label-control">Caption</label>
14
+ <input class="form-control" ng-model="promethee.inspected.attributes.caption">
15
15
  </div>
16
16
 
17
- <div class="form-group">
18
- <label class="label-control">Caption</label>
19
- <summernote config="summernoteConfig" ng-model="promethee.inspected.attributes.caption"></summernote>
17
+ <div class="panel panel-default" ng-init="advancedConfigurationOpen = false">
18
+ <div class="panel-heading" ng-click="advancedConfigurationOpen = !advancedConfigurationOpen">
19
+ Advanced configuration
20
+ <%= fa_icon 'angle-down', class: 'fa-pull-right', 'ng-class': "{'fa-rotate-180': advancedConfigurationOpen}", style: 'font-size: 18px' %>
21
+ </div>
22
+ <div class="panel-body" ng-show="advancedConfigurationOpen">
23
+ <div class="form-group">
24
+ <label class="label-control">Alt</label>
25
+ <input class="form-control" ng-model="promethee.inspected.attributes.alt">
26
+ </div>
27
+ </div>
20
28
  </div>
21
29
  </script>
@@ -4,9 +4,9 @@
4
4
  <img ng-src="/promethee/blob/{{component.attributes.blob.id}}"
5
5
  class="img-responsive">
6
6
  <figcaption ng-show="component.attributes.caption"
7
- ng-bind-html="component.attributes.caption | htmlSafe"></figcaption>
7
+ ng-bind-html="component.attributes.caption"></figcaption>
8
8
  </figure>
9
- <div ng-hide="component.attributes.blob.id">
9
+ <div ng-hide="component.attributes.blob_id">
10
10
  <p ng-hide="editing"
11
11
  class="text-center">Click to set the image</p>
12
12
  </div>
@@ -7,8 +7,6 @@ caption = component[:attributes][:caption].to_s
7
7
  <figure class="<%= promethee_class_for component %>">
8
8
  <%= image_tag url_for(blob.variant(resize: '1920')), class: 'img-responsive', alt: alt if blob %>
9
9
  <% if caption.present? %>
10
- <figcaption>
11
- <%= caption.html_safe %>
12
- </figcaption>
10
+ <figcaption><%= caption %></figcaption>
13
11
  <% end %>
14
12
  </figure>
@@ -5,7 +5,9 @@
5
5
  icon: #{render('promethee/components/slider/icon').to_json.html_safe},
6
6
  data: {
7
7
  type: 'slider',
8
- attributes: {},
8
+ attributes: {
9
+ contents: {}
10
+ },
9
11
  children: []
10
12
  }
11
13
  })
@@ -1,11 +1,11 @@
1
1
  <script type="text/ng-template" id="promethee/components/slider/edit/inspect">
2
- <div ui-sortable ng-model="promethee.inspected.children">
2
+ <div ui-sortable="{handle: '.handle'}" ng-model="promethee.inspected.children">
3
3
  <div
4
4
  class="panel panel-default"
5
5
  ng-repeat="component in promethee.inspected.children"
6
6
  >
7
7
  <div class="panel-body">
8
- <div class="row">
8
+ <div class="row handle">
9
9
  <div class="col-xs-9">
10
10
  <span class="label label-default">#{{$index + 1}}</span>
11
11
  <span class="label label-info">{{component.type}}</span>
@@ -14,6 +14,15 @@
14
14
  <ng-include src="'promethee/move/component'"></ng-include>
15
15
  </div>
16
16
  </div>
17
+
18
+ <div class="row">
19
+ <div class="col-xs-12">
20
+ <div class="form-group">
21
+ <label class="label-control">Text</label>
22
+ <summernote config="summernoteConfig" ng-model="promethee.inspected.attributes.contents['content-' + component.id]"></summernote>
23
+ </div>
24
+ </div>
25
+ </div>
17
26
  </div>
18
27
  </div>
19
28
  </div>
@@ -33,7 +42,7 @@
33
42
 
34
43
  var clone = function(object) {
35
44
  return JSON.parse(JSON.stringify(object));
36
- }
45
+ };
37
46
 
38
47
  $scope.addItem = function(definition) {
39
48
  var item = JSON.parse(JSON.stringify(definition.data));
@@ -16,5 +16,17 @@
16
16
  $scope.parent_id = $scope.component.id;
17
17
  $scope.parent_type = $scope.component.type;
18
18
  $scope.components = $scope.component.children;
19
+
20
+ $scope.$watch('component.children.length', function() {
21
+ console.log('watch');
22
+
23
+ var keys = $scope.component.children.map(function(component) {
24
+ return 'content-' + component.id;
25
+ });
26
+
27
+ for(var key in $scope.component.attributes.contents) {
28
+ if(!keys.includes(key)) delete $scope.component.attributes.contents[key];
29
+ }
30
+ });
19
31
  }]);
20
32
  </script>
@@ -1,3 +1,13 @@
1
1
  <script type="text/ng-template" id="promethee/components/slider/localize">
2
-
2
+ <div ng-repeat="key, content in component.master.attributes.contents">
3
+ <hr>
4
+ <div class="row">
5
+ <div class="col-md-6">
6
+ <div class="promethee-edit__wrapper" ng-bind-html="component.master.attributes.contents[key] | htmlSafe"></div>
7
+ </div>
8
+ <div class="col-md-6" ng-prevent-drag="true">
9
+ <summernote config="options" ng-model="component.attributes.contents[key]"></summernote>
10
+ </div>
11
+ </div>
12
+ </div>
3
13
  </script>
@@ -3,6 +3,7 @@
3
3
  <% component[:children].each.with_index do |child, n| %>
4
4
  <div class="item<%= ' active' if n.zero? %>">
5
5
  <%= render 'promethee/show/component', component: child %>
6
+ <%= component[:attributes].dig(:contents, :"content-#{child.id}").to_s.html_safe %>
6
7
  </div>
7
8
  <% end %>
8
9
  </div>
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '1.4.1'
3
+ VERSION = '1.4.2'
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: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Dargelos
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
341
  version: '0'
342
342
  requirements: []
343
343
  rubyforge_project:
344
- rubygems_version: 2.6.11
344
+ rubygems_version: 2.6.12
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: Bring fire to your page