promethee 1.2.31 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/promethee-edit.sass +10 -44
  3. data/app/assets/stylesheets/promethee-edit/_move.sass +95 -46
  4. data/app/views/promethee/_edit.html.erb +26 -24
  5. data/app/views/promethee/components/aside/_edit.define.html.erb +152 -11
  6. data/app/views/promethee/components/aside/_edit.move.html.erb +11 -12
  7. data/app/views/promethee/components/column/_edit.define.html.erb +32 -0
  8. data/app/views/promethee/components/column/_edit.inspect.html.erb +5 -4
  9. data/app/views/promethee/components/column/_edit.move.html.erb +21 -11
  10. data/app/views/promethee/components/cover/_edit.define.html.erb +151 -12
  11. data/app/views/promethee/components/cover/_edit.move.html.erb +7 -4
  12. data/app/views/promethee/components/cover/_localize.html.erb +1 -1
  13. data/app/views/promethee/components/image/_edit.define.html.erb +149 -13
  14. data/app/views/promethee/components/image/_edit.move.html.erb +13 -4
  15. data/app/views/promethee/components/image/_localize.html.erb +1 -1
  16. data/app/views/promethee/components/row/_edit.define.html.erb +151 -11
  17. data/app/views/promethee/components/row/_edit.move.html.erb +6 -3
  18. data/app/views/promethee/components/slider/_edit.define.html.erb +151 -11
  19. data/app/views/promethee/components/slider/_edit.move.html.erb +5 -3
  20. data/app/views/promethee/components/text/_edit.define.html.erb +150 -11
  21. data/app/views/promethee/components/text/_edit.move.html.erb +4 -1
  22. data/app/views/promethee/components/text/_localize.html.erb +1 -1
  23. data/app/views/promethee/components/video/_edit.define.html.erb +30 -11
  24. data/app/views/promethee/components/video/_edit.move.html.erb +30 -4
  25. data/app/views/promethee/edit/_move.close.html.erb +4 -0
  26. data/app/views/promethee/edit/_move.header.html.erb +7 -0
  27. data/app/views/promethee/edit/_move.html.erb +107 -15
  28. data/lib/promethee/rails/version.rb +1 -1
  29. metadata +5 -13
  30. data/app/assets/stylesheets/promethee-edit/_write.sass +0 -94
  31. data/app/views/promethee/components/aside/_edit.write.html.erb +0 -14
  32. data/app/views/promethee/components/column/_edit.write.html.erb +0 -17
  33. data/app/views/promethee/components/cover/_edit.write.html.erb +0 -23
  34. data/app/views/promethee/components/image/_edit.write.html.erb +0 -25
  35. data/app/views/promethee/components/row/_edit.write.html.erb +0 -34
  36. data/app/views/promethee/components/slider/_edit.write.html.erb +0 -47
  37. data/app/views/promethee/components/text/_edit.write.html.erb +0 -20
  38. data/app/views/promethee/components/video/_edit.write.html.erb +0 -39
  39. data/app/views/promethee/edit/_write.html.erb +0 -98
@@ -1,14 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/aside/edit/write">
2
- <aside ng-click="inspect(component, $event)"
3
- class=" promethee-edit__component
4
- promethee-edit__component--aside">
5
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
6
- <div class="promethee-edit__toolbar">
7
- Aside
8
- <ng-include src="'promethee/write/toolbar'"></ng-include>
9
- </div>
10
- <ng-include src="'promethee/write/components'"></ng-include>
11
- <ng-include src="'promethee/write/add_button'"></ng-include>
12
- </div>
13
- </div>
14
- </script>
@@ -1,17 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/column/edit/write">
2
- <div ng-click="inspect(component, $event)"
3
- class=" col
4
- col-md-{{component.attributes.size}}
5
- col-md-offset-{{component.attributes.offset}}
6
- promethee-edit__component
7
- promethee-edit__component--column">
8
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
9
- <div class="promethee-edit__toolbar">
10
- Column
11
- <ng-include src="'promethee/write/toolbar'"></ng-include>
12
- </div>
13
- <ng-include src="'promethee/write/components'"></ng-include>
14
- <ng-include src="'promethee/write/add_button'"></ng-include>
15
- </div>
16
- </div>
17
- </script>
@@ -1,23 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/cover/edit/write">
2
- <div ng-controller="CoverController"
3
- ng-click="inspect(component, $event)"
4
- class=" promethee-edit__component
5
- promethee-edit__component--cover">
6
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
7
- <div class="promethee-edit__toolbar promethee-edit__toolbar--transparent">
8
- <ng-include src="'promethee/write/toolbar'"></ng-include>
9
- </div>
10
- <div class=" promethee-edit__wrapper
11
- promethee-edit__cover-content"
12
- ng-bind-html="component.attributes.body | htmlSafe"
13
- style="background-image: url('{{component.attributes.src}}')">
14
- </div>
15
- </div>
16
- </div>
17
- </script>
18
-
19
- <script>
20
- promethee.controller('CoverController', ['$scope', function($scope) {
21
-
22
- }]);
23
- </script>
@@ -1,25 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/image/edit/write">
2
- <div ng-controller="ImageController"
3
- ng-click="inspect(component, $event)"
4
- class=" promethee-edit__component
5
- promethee-edit__component--image">
6
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
7
- <div class="promethee-edit__toolbar promethee-edit__toolbar--transparent">
8
- <ng-include src="'promethee/write/toolbar'"></ng-include>
9
- </div>
10
- <figure ng-show="component.attributes.src">
11
- <img ng-src="{{component.attributes.src}}" class="img-responsive">
12
- <figcaption ng-show="component.attributes.caption" ng-bind-html="component.attributes.caption | htmlSafe"></figcaption>
13
- </figure>
14
- <div ng-hide="component.attributes.src">
15
- <p ng-hide="editing" class="text-center">Click to set the image</p>
16
- </div>
17
- </div>
18
- </div>
19
- </script>
20
-
21
- <script>
22
- promethee.controller('ImageController', ['$scope', function($scope) {
23
-
24
- }]);
25
- </script>
@@ -1,34 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/row/edit/write">
2
- <div ng-controller="RowController"
3
- ng-click="inspect(component, $event)"
4
- class=" row
5
- promethee-edit__component
6
- promethee-edit__component--row">
7
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
8
- <div class="promethee-edit__toolbar">
9
- Row
10
- <ng-include src="'promethee/write/toolbar'"></ng-include>
11
- </div>
12
- <ng-include src="'promethee/write/components'"></ng-include>
13
- <div class="clearfix"></div>
14
- <a ng-click="addColumn()" class="promethee-edit__adder__button"><%= fa_icon :columns, class: "fa-2x" %></a>
15
- </div>
16
- </div>
17
- </script>
18
-
19
- <script>
20
- promethee.controller('RowController', ['$scope', 'identifier', function($scope, identifier) {
21
- $scope.addColumn = function() {
22
- this.component.children.push({
23
- type: 'column',
24
- id: identifier.generate(),
25
- attributes: {
26
- size: 4,
27
- offset: 0
28
- },
29
- children: []
30
- })
31
- }
32
- }]);
33
- </script>
34
-
@@ -1,47 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/slider/edit/write">
2
- <div ng-controller="SliderController"
3
- ng-click="inspect(component, $event)"
4
- class=" row
5
- promethee-edit__component
6
- promethee-edit__component--slider">
7
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
8
- <div class="promethee-edit__toolbar promethee-edit__toolbar--transparent">
9
- <ng-include src="'promethee/write/toolbar'"></ng-include>
10
- </div>
11
-
12
- <div class="row">
13
- <div ng-init="components = component.children">
14
- <div ng-repeat="component in components track by $index">
15
- <div class="col-md-{{itemColSize}}">
16
- <ng-include src="'promethee/write/component'"></ng-include>
17
- </div>
18
- <div ng-if="($index + 1)%itemsPerLine === 0" class="clearfix"></div>
19
- </div>
20
- </div>
21
- </div>
22
- <div class="clearfix"></div>
23
-
24
- <span type="button"
25
- class=" btn
26
- btn-default
27
- btn-block"
28
- ng-click="addComponentTo(component.children);">
29
- Add item
30
- </span>
31
- </div>
32
- </div>
33
- </script>
34
-
35
- <script>
36
- promethee.controller('SliderController', ['$scope', '$element', function($scope, $element) {
37
- $scope.itemsPerLine = 4;
38
-
39
- Object.defineProperties($scope, {
40
- itemColSize: {
41
- get: function() {
42
- return Math.floor(12/$scope.itemsPerLine);
43
- }
44
- }
45
- });
46
- }]);
47
- </script>
@@ -1,20 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/text/edit/write">
2
- <div ng-controller="TextController"
3
- ng-click="inspect(component, $event)"
4
- class=" promethee-edit__component
5
- promethee-edit__component--text">
6
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
7
- <div class="promethee-edit__toolbar promethee-edit__toolbar--transparent">
8
- <ng-include src="'promethee/write/toolbar'"></ng-include>
9
- </div>
10
-
11
- <div class="promethee-edit__wrapper" ng-bind-html="component.attributes.body | htmlSafe"></div>
12
- </div>
13
- </div>
14
- </script>
15
-
16
- <script>
17
- promethee.controller('TextController', ['$scope', function($scope) {
18
-
19
- }]);
20
- </script>
@@ -1,39 +0,0 @@
1
- <script type="text/ng-template" id="promethee/components/video/edit/write">
2
- <div ng-controller="VideoController"
3
- ng-click="inspect(component, $event)"
4
- class=" promethee-edit__component
5
- promethee-edit__component--video">
6
- <div class="promethee-edit__component-selected" ng-class="{'promethee-edit__component-selected--visible': promethee.inspected === component}">
7
- <div class="promethee-edit__toolbar promethee-edit__toolbar--transparent">
8
- <ng-include src="'promethee/write/toolbar'"></ng-include>
9
- </div>
10
- <div class="embed-responsive embed-responsive-16by9">
11
- <iframe ng-if="embed" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" ng-src="{{embed | urlSafe}}"></iframe>
12
- <div class="video-neutralizing-overlay"></div>
13
- </div>
14
- </div>
15
- </div>
16
- </script>
17
-
18
- <script>
19
- promethee.controller('VideoController', ['$scope', function($scope) {
20
- Object.defineProperty($scope, 'embed', {
21
- get: function() {
22
- var embed = null;
23
- var url = this.component.attributes.url + '';
24
-
25
- if(url.includes('vimeo')) {
26
- var id = url.replace(/^(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?$/, '$1');
27
- embed = 'https://player.vimeo.com/video/' + id + '?color=ffffff&title=0&byline=0&portrait=0';
28
- }
29
- else if(url.includes('youtube')) {
30
- var parts = url.split('watch?v=');
31
- var id = parts[parts.length - 1];
32
- embed = 'http://www.youtube.com/embed/' + id;
33
- }
34
-
35
- return embed;
36
- }
37
- })
38
- }]);
39
- </script>
@@ -1,98 +0,0 @@
1
- <script type="text/javascript">
2
- promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions', 'identifier', function($scope, $rootScope, definitions, identifier) {
3
-
4
- $scope.adding = false;
5
- $scope.childrenToAddTo = null;
6
- $scope.definitions = definitions;
7
-
8
- $scope.close = function() {
9
- $scope.adding = false;
10
- $scope.addingToChildren = null;
11
- };
12
-
13
- $scope.pushComponent = function(definition) {
14
- var definition = angular.copy(definition.data);
15
- definition.id = identifier.generate();
16
- $scope.childrenToAddTo.push(definition);
17
- $scope.close();
18
- };
19
-
20
- $rootScope.addComponentTo = function(components) {
21
- $scope.adding = true;
22
- $scope.childrenToAddTo = components;
23
- };
24
-
25
- }])
26
- </script>
27
-
28
- <div class="promethee-edit__write" ng-show="promethee.mode == 'write'">
29
- <div ng-class="{ 'container-fluid': promethee.fullscreen }">
30
- <div ng-init="component = promethee.data"
31
- class=" promethee-edit__component
32
- promethee-edit__component--page">
33
- <ng-include src="'promethee/write/components'"></ng-include>
34
- </div>
35
- </div>
36
- <ng-include src="'promethee/write/add_button'"></ng-include>
37
- <div class="promethee-edit__inspect" ng-show="promethee.inspected">
38
- <div class="promethee-edit__inspect-header">
39
- <div class="pull-right">
40
- <span class="promethee-edit__button promethee-edit__button--squared" ng-click="promethee.inspected = null"><%= fa_icon :times %></span>
41
- </div>
42
- {{promethee.inspected.type}}
43
- </div>
44
- <div class="promethee-edit__inspect-content">
45
- <ng-include ng-if="promethee.inspected" src="'promethee/components/' + promethee.inspected.type + '/edit/inspect'"></ng-include>
46
- </div>
47
- </div>
48
- </div>
49
-
50
- <script type="text/ng-template" id="promethee/write/components">
51
- <div ng-init="components = component.children">
52
- <div ng-repeat="component in components">
53
- <ng-include src="'promethee/write/component'"></ng-include>
54
- </div>
55
- </div>
56
- </script>
57
-
58
- <script type="text/ng-template" id="promethee/write/component">
59
- <ng-include src="'promethee/components/' + component.type + '/edit/write'"></ng-include>
60
- </script>
61
-
62
- <script type="text/ng-template" id="promethee/write/toolbar">
63
- <div class="promethee-edit__toolbar-buttons pull-right">
64
- <span ng-click="remove(component, components)" class="promethee-edit__button promethee-edit__button--squared promethee-edit__button--bordered"><%= fa_icon :times %></span>
65
- </div>
66
- </script>
67
-
68
- <script type="text/ng-template" id="promethee/write/add_button">
69
- <a ng-click="addComponentTo(component.children)" class="promethee-edit__adder__button"><%= fa_icon 'plus-circle', class: "fa-3x" %></a>
70
- </script>
71
-
72
- <div class="promethee-edit__adder" ng-controller="AdderController">
73
- <% # FIXME le style comme ça ce n'est pas propre, sortir de la modal bootstrap et utiliser ng-show %>
74
- <div class="modal fade in" tabindex="-1" role="dialog" style="display: {{adding ? 'block' : 'none'}}">
75
- <div class="modal-dialog modal-lg" role="document">
76
- <div class="modal-content">
77
- <div class="modal-header">
78
- <button type="button" class="close" ng-click="close()"><span aria-hidden="true">&times;</span></button>
79
- <h4 class="modal-title">Select component</h4>
80
- </div>
81
- <div class="modal-body">
82
- <div class="row">
83
- <div
84
- ng-repeat="definition in definitions"
85
- ng-click="pushComponent(definition)"
86
- class="col-md-3">
87
- <div class="thumbnail">
88
- <img ng-src="{{definition.thumb}}" class="img-responsive">
89
- <h4>{{definition.name}}</h4>
90
- <p>{{definition.description}}</p>
91
- </div>
92
- </div>
93
- </div>
94
- </div>
95
- </div>
96
- </div>
97
- </div>
98
- </div>