promethee 1.0.12 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/promethee-editor/_mover.sass +27 -20
- data/app/assets/stylesheets/promethee-editor/_preview.sass +23 -18
- data/app/views/promethee/_edit.html.erb +97 -65
- data/app/views/promethee/_localize.html.erb +8 -4
- data/app/views/promethee/_show.html.erb +2 -2
- data/app/views/promethee/{partials/_mover.html.erb → edit/_move.html.erb} +20 -18
- data/app/views/promethee/edit/_preview.html.erb +36 -0
- data/app/views/promethee/edit/_write.html.erb +21 -0
- data/app/views/promethee/edit/move/_component.html.erb +3 -0
- data/app/views/promethee/edit/move/_components.html.erb +20 -0
- data/app/views/promethee/edit/move/component/_column.html.erb +13 -0
- data/app/views/promethee/edit/move/component/_image.html.erb +3 -0
- data/app/views/promethee/edit/move/component/_row.html.erb +6 -0
- data/app/views/promethee/edit/move/component/_text.html.erb +3 -0
- data/app/views/promethee/edit/move/component/_video.html.erb +8 -0
- data/app/views/promethee/edit/shared/_navbar.html.erb +31 -0
- data/app/views/promethee/{partials/_adder.html.erb → edit/write/_add_button.html.erb} +32 -23
- data/app/views/promethee/edit/write/_component.html.erb +3 -0
- data/app/views/promethee/edit/write/_components.html.erb +7 -0
- data/app/views/promethee/edit/write/_toolbar.html.erb +6 -0
- data/app/views/promethee/edit/write/component/_column.html.erb +34 -0
- data/app/views/promethee/{components/_image_edit.html.erb → edit/write/component/_image.html.erb} +2 -6
- data/app/views/promethee/{components/_row_edit.html.erb → edit/write/component/_row.html.erb} +3 -10
- data/app/views/promethee/{components/_text_edit.html.erb → edit/write/component/_text.html.erb} +3 -19
- data/app/views/promethee/{components/_video_edit.html.erb → edit/write/component/_video.html.erb} +3 -12
- data/app/views/promethee/localize/component/_column.html.erb +11 -0
- data/app/views/promethee/localize/component/_image.html.erb +3 -0
- data/app/views/promethee/localize/component/_row.html.erb +3 -0
- data/app/views/promethee/localize/component/_text.html.erb +3 -0
- data/app/views/promethee/localize/component/_video.html.erb +3 -0
- data/app/views/promethee/show/_component.html.erb +1 -0
- data/app/views/promethee/show/_components.html.erb +3 -0
- data/app/views/promethee/{components → show/component}/_column.html.erb +1 -2
- data/app/views/promethee/{components → show/component}/_image.html.erb +0 -0
- data/app/views/promethee/show/component/_row.html.erb +3 -0
- data/app/views/promethee/{components → show/component}/_text.html.erb +0 -0
- data/app/views/promethee/{components → show/component}/_video.html.erb +0 -0
- data/lib/promethee/rails/version.rb +1 -1
- metadata +34 -23
- data/app/views/promethee/components/_children.html.erb +0 -4
- data/app/views/promethee/components/_children_edit.html.erb +0 -7
- data/app/views/promethee/components/_column_edit.html.erb +0 -42
- data/app/views/promethee/components/_page.html.erb +0 -1
- data/app/views/promethee/components/_page_edit.html.erb +0 -10
- data/app/views/promethee/components/_row.html.erb +0 -3
- data/app/views/promethee/partials/_include_components.html.erb +0 -9
- data/app/views/promethee/partials/_navbar.html.erb +0 -26
- data/app/views/promethee/partials/_page.html.erb +0 -6
- data/app/views/promethee/partials/_preview.html.erb +0 -12
- data/app/views/promethee/partials/_toolbar_buttons.html.erb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 015e43dd4219428e600f3d92561e7f3278337d69
|
4
|
+
data.tar.gz: 8ad05e21264ef4945f3a811cb620932fbeeb4b97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ecbd712471d0692f881983a089d3b9d11ab0d86c6defdaa457f0fa846d5770d276063e41bf4615f1663a6c4c65206b9f8a1852311b3968b96805703e9df435f
|
7
|
+
data.tar.gz: 1842b06180cb6df6c14e8e1a2e7bc145e1ffbdf46555f879960b704ffb867854ed2df8e3cc3a1578834c075bdfe89c50f98dcbbd284bd463562a9df08df0625d
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.
|
1
|
+
.promethee__move
|
2
2
|
transform-origin: top
|
3
3
|
transition: transform ease-out 0.5s
|
4
4
|
transform: scale(0.3)
|
@@ -17,46 +17,53 @@
|
|
17
17
|
&--row
|
18
18
|
padding-left: 10px
|
19
19
|
&--droppable
|
20
|
+
margin: 10px 0
|
20
21
|
position: relative
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
border-radius: 6px
|
23
|
+
border: 5px solid transparent
|
24
|
+
width: 400px
|
25
|
+
height: 40px
|
26
|
+
transition: .2s
|
24
27
|
&--hidden
|
25
28
|
visibility: hidden
|
29
|
+
pointer-events: none
|
30
|
+
|
26
31
|
&--row
|
27
|
-
|
32
|
+
&:not(&--first)
|
33
|
+
visibility: hidden
|
34
|
+
pointer-events: none
|
35
|
+
|
28
36
|
&--first
|
29
|
-
display: block
|
30
37
|
position: absolute
|
31
38
|
top: 0
|
32
39
|
left: -25px
|
33
|
-
width:
|
34
|
-
height:
|
40
|
+
width: 40px
|
41
|
+
height: 400px
|
35
42
|
&--inside-column
|
36
43
|
position: absolute
|
37
44
|
top: 0
|
38
45
|
right: -25px
|
39
|
-
width:
|
40
|
-
height:
|
46
|
+
width: 40px
|
47
|
+
height: 400px
|
41
48
|
&--dragged
|
42
49
|
opacity: 0.25
|
43
|
-
.ui-droppable-hover
|
44
|
-
opacity: 1 !important
|
45
|
-
margin-bottom: 0
|
46
50
|
.ui-droppable-active
|
47
|
-
|
48
|
-
|
51
|
+
border-color: $promethee-color
|
52
|
+
|
53
|
+
.ui-droppable-hover
|
54
|
+
background: transparentize($promethee-color, .6)
|
55
|
+
|
49
56
|
// By default, nothing is dropped in rows
|
50
57
|
&--dragging
|
51
|
-
.
|
58
|
+
.promethee__move--droppable.promethee__move--droppable--row
|
52
59
|
display: none
|
53
60
|
// Except for columns, which can be dropped only on rows
|
54
|
-
&--dragging.
|
55
|
-
.
|
61
|
+
&--dragging.promethee__move--dragging--column
|
62
|
+
.promethee__move--droppable
|
56
63
|
display: none
|
57
64
|
// It's a little specific, columns can be dropped on rows "first droppable", or on columns "inside droppables"
|
58
|
-
&.
|
59
|
-
&.
|
65
|
+
&.promethee__move--droppable.promethee__move--droppable--row--inside-column,
|
66
|
+
&.promethee__move--droppable.promethee__move--droppable--row--first
|
60
67
|
display: block
|
61
68
|
.video-neutralizing-overlay
|
62
69
|
background: transparent
|
@@ -1,25 +1,30 @@
|
|
1
1
|
.promethee-editor__preview
|
2
|
+
background: #000
|
2
3
|
position: relative
|
3
4
|
height: calc(100% - 52px)
|
4
5
|
min-height: 500px
|
5
|
-
background: black
|
6
6
|
margin-top: -20px
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
&-frame
|
9
|
+
top: 0
|
10
|
+
left: 50%
|
11
|
+
transition: width .7s
|
9
12
|
position: absolute
|
10
13
|
height: 100%
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
14
|
+
transform: translate3d(-50%, 0, 0)
|
15
|
+
|
16
|
+
&-loader
|
17
|
+
left: 50%
|
18
|
+
margin: 100px 0
|
19
|
+
position: absolute
|
20
|
+
color: #fff
|
21
|
+
transform: translateX(-50%)
|
22
|
+
|
23
|
+
&--mobile &-frame
|
24
|
+
width: 375px
|
25
|
+
|
26
|
+
&--tablet &-frame
|
27
|
+
width: 768px
|
28
|
+
|
29
|
+
&--desktop &-frame
|
30
|
+
width: 100%
|
@@ -8,6 +8,9 @@ promethee_data = Promethee::Data.new master_data
|
|
8
8
|
.module('Promethee', ['summernote', 'ngAnimate'])
|
9
9
|
.value('data', <%= promethee_data.to_json.html_safe %>)
|
10
10
|
.value('definitions', [])
|
11
|
+
.config(function($rootScopeProvider) {
|
12
|
+
$rootScopeProvider.digestTtl(20);
|
13
|
+
})
|
11
14
|
.filter('htmlSafe', ['$sce', function($sce) {
|
12
15
|
return function(val) {
|
13
16
|
return $sce.trustAsHtml(val);
|
@@ -28,7 +31,7 @@ promethee_data = Promethee::Data.new master_data
|
|
28
31
|
promethee.controller('PrometheeController', ['data', '$scope', 'definitions', '$http', function(data, $scope, definitions, $http) {
|
29
32
|
|
30
33
|
// Data (TODO use Adder and probably page definition to init)
|
31
|
-
if
|
34
|
+
if(data === null || data === '') {
|
32
35
|
data = {
|
33
36
|
id: '',
|
34
37
|
type: 'page',
|
@@ -36,66 +39,82 @@ promethee_data = Promethee::Data.new master_data
|
|
36
39
|
children: []
|
37
40
|
};
|
38
41
|
}
|
39
|
-
$scope.data = data;
|
40
42
|
|
41
|
-
|
42
|
-
$scope.fullscreen = false;
|
43
|
-
$scope.move = false;
|
44
|
-
$scope.preview = false;
|
45
|
-
$scope.pageHidden = false;
|
46
|
-
$scope.previewMode = 'desktop';
|
43
|
+
$scope.data = $scope.component = data;
|
47
44
|
|
48
|
-
var
|
49
|
-
|
50
|
-
$scope.enableMove = function() {
|
51
|
-
clearTimeout(moveTimeout);
|
52
|
-
this.move = true;
|
45
|
+
var State = function(value) {
|
46
|
+
this.default = this.current = value;
|
53
47
|
};
|
54
48
|
|
55
|
-
|
56
|
-
|
49
|
+
State.prototype = {
|
50
|
+
get enabled() {
|
51
|
+
return !!this.current;
|
52
|
+
},
|
57
53
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
self.pageHidden = false;
|
62
|
-
self.$apply();
|
63
|
-
}, 500);
|
64
|
-
};
|
54
|
+
get disabled() {
|
55
|
+
return !this.enabled;
|
56
|
+
},
|
65
57
|
|
66
|
-
|
67
|
-
|
68
|
-
|
58
|
+
enable: function() {
|
59
|
+
this.set(true);
|
60
|
+
},
|
69
61
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
var form = document.createElement('form');
|
75
|
-
document.body.appendChild(form);
|
76
|
-
form.method = 'POST';
|
77
|
-
form.action = <%= promethee_preview_path.to_json.html_safe %>;
|
78
|
-
form.target = 'preview';
|
79
|
-
var input = document.createElement('input');
|
80
|
-
input.type = 'text';
|
81
|
-
input.value = JSON.stringify(data);
|
82
|
-
input.name = 'data';
|
83
|
-
form.appendChild(input);
|
84
|
-
form.submit();
|
85
|
-
document.body.removeChild(form);
|
86
|
-
}
|
62
|
+
disable: function() {
|
63
|
+
this.set(false);
|
64
|
+
},
|
87
65
|
|
88
|
-
|
89
|
-
|
90
|
-
|
66
|
+
is: function(state) {
|
67
|
+
return this.current === state;
|
68
|
+
},
|
91
69
|
|
92
|
-
|
93
|
-
|
94
|
-
|
70
|
+
set: function(state) {
|
71
|
+
this.current = state
|
72
|
+
},
|
95
73
|
|
96
|
-
|
97
|
-
|
98
|
-
|
74
|
+
exit: function(state) {
|
75
|
+
if(this.is(state)) this.current = this.default;
|
76
|
+
},
|
77
|
+
|
78
|
+
toggle: function(state) {
|
79
|
+
if(arguments.length === 0) state = true;
|
80
|
+
this.is(state) ? this.exit(state) : this.set(state)
|
81
|
+
}
|
82
|
+
};
|
83
|
+
|
84
|
+
// Application states
|
85
|
+
$scope.action = new State('write');
|
86
|
+
$scope.preview = new State('desktop');
|
87
|
+
$scope.fullscreen = new State(false);
|
88
|
+
|
89
|
+
// $scope.enablePreview = function() {
|
90
|
+
// this.preview = true;
|
91
|
+
// this.move = false;
|
92
|
+
|
93
|
+
// var form = document.createElement('form');
|
94
|
+
// document.body.appendChild(form);
|
95
|
+
// form.method = 'POST';
|
96
|
+
// form.action = <%= promethee_preview_path.to_json.html_safe %>;
|
97
|
+
// form.target = 'preview';
|
98
|
+
// var input = document.createElement('input');
|
99
|
+
// input.type = 'text';
|
100
|
+
// input.value = JSON.stringify(data);
|
101
|
+
// input.name = 'data';
|
102
|
+
// form.appendChild(input);
|
103
|
+
// form.submit();
|
104
|
+
// document.body.removeChild(form);
|
105
|
+
// }
|
106
|
+
|
107
|
+
// $scope.disablePreview = function() {
|
108
|
+
// this.preview = false;
|
109
|
+
// }
|
110
|
+
|
111
|
+
// $scope.enableFullscreen = function() {
|
112
|
+
// this.fullscreen = true;
|
113
|
+
// }
|
114
|
+
|
115
|
+
// $scope.disableFullscreen = function() {
|
116
|
+
// this.fullscreen = false;
|
117
|
+
// }
|
99
118
|
|
100
119
|
$scope.remove = function(component, components) {
|
101
120
|
var index = components.indexOf(component);
|
@@ -106,20 +125,33 @@ promethee_data = Promethee::Data.new master_data
|
|
106
125
|
|
107
126
|
</script>
|
108
127
|
|
109
|
-
<div
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
128
|
+
<div
|
129
|
+
id="promethee"
|
130
|
+
ng-class="{
|
131
|
+
'promethee-editor': true,
|
132
|
+
'promethee-editor--fullscreen': fullscreen.enabled
|
133
|
+
}"
|
134
|
+
ng-app="Promethee"
|
135
|
+
ng-controller="PrometheeController as prometheeController"
|
136
|
+
>
|
137
|
+
<%= render 'promethee/edit/shared/navbar' %>
|
138
|
+
|
139
|
+
<%= render 'promethee/edit/write' %>
|
140
|
+
<%= render 'promethee/edit/move' %>
|
141
|
+
<%= render 'promethee/edit/preview' %>
|
142
|
+
|
118
143
|
<input type="hidden" name="page[data]" id="page_data" value="{{data}}" />
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
144
|
+
|
145
|
+
<div ng-show="action.is('write')" class="promethee__write">
|
146
|
+
<ng-include src="'promethee/write'"></ng-include>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div ng-show="action.is('move')" class="promethee__move">
|
150
|
+
<ng-include src="'promethee/move'"></ng-include>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<div ng-show="action.is('preview')" class="promethee__preview">
|
154
|
+
<ng-include src="'promethee/preview'"></ng-include>
|
155
|
+
</div>
|
124
156
|
</div>
|
125
157
|
|
@@ -14,7 +14,7 @@ promethee_data = Promethee::Data.new master_data, localization_data: localizatio
|
|
14
14
|
|
15
15
|
prometheeLocalizer.controller('PrometheeLocalizerController', ['$scope', 'data', function($scope, data) {
|
16
16
|
|
17
|
-
$scope.data = data;
|
17
|
+
$scope.data = $scope.component = data;
|
18
18
|
|
19
19
|
$scope.options = {
|
20
20
|
toolbar: [
|
@@ -37,8 +37,12 @@ promethee_data = Promethee::Data.new master_data, localization_data: localizatio
|
|
37
37
|
ng-app="PrometheeLocalizer"
|
38
38
|
ng-controller="PrometheeLocalizerController as prometheeLocalizerController">
|
39
39
|
<input type="hidden" name="page[data]" id="page_data" value="{{data}}" />
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
|
41
|
+
<% Dir[__dir__ + '/localize/component/*.html.erb'].map do |file| %>
|
42
|
+
<%= render "promethee/localize/component/#{File.basename(file, '.html.erb').sub(/\A_/, '')}" %>
|
43
|
+
<% end %>
|
44
|
+
|
45
|
+
<div ng-repeat="component in component.children">
|
46
|
+
<ng-include src="'promethee/localize/components'"></ng-include>
|
43
47
|
</div>
|
44
48
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%
|
2
|
-
promethee_data = Promethee::Data.new
|
2
|
+
promethee_data = Promethee::Data.new(master_data, localization_data: localization_data).to_h
|
3
3
|
%>
|
4
4
|
|
5
5
|
<div class="promethee">
|
6
|
-
<%= render 'promethee/components
|
6
|
+
<%= render 'promethee/show/components', components: promethee_data[:children] %>
|
7
7
|
</div>
|
@@ -1,19 +1,25 @@
|
|
1
|
-
|
1
|
+
<%= render 'promethee/edit/move/component' %>
|
2
|
+
<%= render 'promethee/edit/move/components' %>
|
3
|
+
<% Dir[__dir__ + '/move/component/*.html.erb'].map do |file| %>
|
4
|
+
<%= render "promethee/edit/move/component/#{File.basename(file, '.html.erb').sub(/\A_/, '')}" %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<script type="text/ng-template" id="promethee/move">
|
2
8
|
<div ng-init="components = component.children; type = component.type"
|
3
|
-
class="
|
4
|
-
<div class="
|
9
|
+
class="promethee__move--list">
|
10
|
+
<div class="promethee__move--droppable promethee__move--droppable--{{type}} promethee__move--droppable--{{type}}--first"
|
5
11
|
droppable
|
6
12
|
data-index="0"
|
7
13
|
>
|
8
14
|
</div>
|
9
15
|
<div ng-repeat="component in components"
|
10
|
-
class="
|
16
|
+
class="promethee__move--draggable promethee__move--draggable--{{type}}"
|
11
17
|
draggable
|
12
18
|
data-index="{{$index}}"
|
13
19
|
data-type="{{component.type}}"
|
14
20
|
>
|
15
|
-
<ng-include src="'promethee/
|
16
|
-
<div class="
|
21
|
+
<ng-include src="'promethee/move/component/' + component.type"></ng-include>
|
22
|
+
<div class="promethee__move--droppable promethee__move--droppable--{{type}}"
|
17
23
|
droppable
|
18
24
|
data-index="{{$index+1}}"
|
19
25
|
data-type="{{type}}"
|
@@ -23,10 +29,6 @@
|
|
23
29
|
</div>
|
24
30
|
</script>
|
25
31
|
|
26
|
-
<div class="promethee-editor__mover" ng-show="move || moverVisible" ng-init="component = data">
|
27
|
-
<ng-include src="'promethee/partials/mover'"></ng-include>
|
28
|
-
</div>
|
29
|
-
|
30
32
|
<script type="text/javascript">
|
31
33
|
promethee
|
32
34
|
.directive('draggable', function() {
|
@@ -40,25 +42,25 @@
|
|
40
42
|
refreshPositions: true,
|
41
43
|
start: function() {
|
42
44
|
var $elementDragged = $(element[0]);
|
43
|
-
$elementDragged.addClass('
|
45
|
+
$elementDragged.addClass('promethee__move--dragged');
|
44
46
|
var type = $elementDragged.data('type');
|
45
|
-
$('.
|
47
|
+
$('.promethee__move').addClass('promethee__move--dragging promethee__move--dragging--' + type);
|
46
48
|
|
47
49
|
// The droppable zone immediately before has no use, it would put the object at the same position
|
48
|
-
var $droppableBefore = $elementDragged.prev('.
|
50
|
+
var $droppableBefore = $elementDragged.prev('.promethee__move--draggable').find('.promethee__move--droppable').last();
|
49
51
|
if ($droppableBefore.length === 0) {
|
50
52
|
// For the first child, we look for the previous droppable zone
|
51
|
-
$droppableBefore = $elementDragged.prev('.
|
53
|
+
$droppableBefore = $elementDragged.prev('.promethee__move--droppable');
|
52
54
|
}
|
53
|
-
$droppableBefore.addClass('
|
55
|
+
$droppableBefore.addClass('promethee__move--droppable--hidden');
|
54
56
|
},
|
55
57
|
stop: function() {
|
56
58
|
var $elementDragged = $(element[0]);
|
57
|
-
$elementDragged.removeClass('
|
59
|
+
$elementDragged.removeClass('promethee__move--dragged');
|
58
60
|
var type = $elementDragged.data('type');
|
59
|
-
$('.
|
61
|
+
$('.promethee__move').removeClass('promethee__move--dragging promethee__move--dragging--' + type);
|
60
62
|
|
61
|
-
$('.
|
63
|
+
$('.promethee__move--droppable').removeClass('promethee__move--droppable--hidden');
|
62
64
|
},
|
63
65
|
helper: function( event ) {
|
64
66
|
return $( '<div></div>' );
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/preview">
|
2
|
+
<div ng-controller="PreviewController" class="promethee-editor__preview promethee-editor__preview--{{preview.current}}">
|
3
|
+
|
4
|
+
<i class="fa fa-refresh fa-spin fa-3x fa-fw promethee-editor__preview-loader"></i>
|
5
|
+
|
6
|
+
<iframe
|
7
|
+
class="promethee-editor__preview-frame"
|
8
|
+
name="preview"
|
9
|
+
sandbox="allow-scripts"
|
10
|
+
frameBorder="0"
|
11
|
+
>
|
12
|
+
</iframe>
|
13
|
+
</div>
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script>
|
17
|
+
promethee.controller('PreviewController', ['data', '$scope', function(data, $scope) {
|
18
|
+
var update = function() {
|
19
|
+
var form = document.createElement('form');
|
20
|
+
form.method = 'post';
|
21
|
+
form.action = <%= promethee_preview_path.to_json.html_safe %>;
|
22
|
+
form.target = 'preview';
|
23
|
+
|
24
|
+
var input = document.createElement('input');
|
25
|
+
input.name = 'data';
|
26
|
+
input.value = JSON.stringify($scope.data);
|
27
|
+
|
28
|
+
form.appendChild(input);
|
29
|
+
form.submit();
|
30
|
+
};
|
31
|
+
|
32
|
+
$scope.$watch('action.current', function(newValue, oldValue) {
|
33
|
+
if(newValue !== oldValue && newValue == 'preview') update();
|
34
|
+
});
|
35
|
+
}]);
|
36
|
+
</script>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%= render 'promethee/edit/write/add_button' %>
|
2
|
+
<%= render 'promethee/edit/write/toolbar' %>
|
3
|
+
<%= render 'promethee/edit/write/component' %>
|
4
|
+
<%= render 'promethee/edit/write/components' %>
|
5
|
+
<% Dir[__dir__ + '/write/component/_*.html.erb'].map do |file| %>
|
6
|
+
<%= render "promethee/edit/write/component/#{File.basename(file, '.html.erb').sub(/\A_/, '')}" %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<script type="text/ng-template" id="promethee/write">
|
10
|
+
<div class="promethee-editor__page">
|
11
|
+
<div ng-class="{ 'container': fullscreen }">
|
12
|
+
<div
|
13
|
+
ng-init="component = component || data"
|
14
|
+
class="promethee-editor__component promethee-editor__component--page"
|
15
|
+
>
|
16
|
+
<ng-include src="'promethee/write/components'"></ng-include>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<ng-include src="'promethee/write/add_button'"></ng-include>
|
20
|
+
</div>
|
21
|
+
</script>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/move/components">
|
2
|
+
<div ng-init="type = component.type; components = component.children">
|
3
|
+
<div
|
4
|
+
ng-repeat="component in components"
|
5
|
+
class="promethee__move--draggable promethee__move--draggable--{{type}}"
|
6
|
+
draggable
|
7
|
+
data-index="{{$index}}"
|
8
|
+
data-type="{{component.type}}"
|
9
|
+
>
|
10
|
+
<ng-include src="'promethee/move/component'"></ng-include>
|
11
|
+
<div
|
12
|
+
class="promethee__move--droppable promethee__move--droppable--{{type}}"
|
13
|
+
droppable
|
14
|
+
data-index="{{$index+1}}"
|
15
|
+
data-type="{{type}}"
|
16
|
+
>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</script>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/move/component/column">
|
2
|
+
<div class="col col-md-{{component.attributes.size}} col-md-offset-{{component.attributes.offset}}">
|
3
|
+
<h1>Column</h1>
|
4
|
+
<ng-include src="'promethee/move'"></ng-include>
|
5
|
+
<div class=" promethee__move--droppable
|
6
|
+
promethee__move--droppable--row
|
7
|
+
promethee__move--droppable--row--inside-column"
|
8
|
+
droppable
|
9
|
+
data-index="{{$index+1}}"
|
10
|
+
data-type="{{type}}"
|
11
|
+
>
|
12
|
+
</div>
|
13
|
+
</script>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/move/component/video">
|
2
|
+
<div ng-controller="VideoController">
|
3
|
+
<div class="embed-responsive embed-responsive-16by9">
|
4
|
+
<iframe ng-if="embed" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" ng-src="{{embed | urlSafe}}"></iframe>
|
5
|
+
<div class="video-neutralizing-overlay"></div>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
</script>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<nav class="navbar navbar-default promethee-editor__navbar">
|
2
|
+
<div class="container-fluid">
|
3
|
+
<div class="navbar-header promethee-editor__icon">
|
4
|
+
<div class="navbar-brand"><%= File.read(__dir__ + '/../../../../assets/images/icon-promethee.svg').html_safe %></div>
|
5
|
+
</div>
|
6
|
+
<div id="navbar">
|
7
|
+
<ul class="nav navbar-nav navbar-right">
|
8
|
+
<li ng-click="action.toggle('move')" ng-class="{active: action.is('move')}"><a><%= fa_icon :arrows %></a></li>
|
9
|
+
|
10
|
+
<li
|
11
|
+
ng-show="action.is('preview')"
|
12
|
+
ng-repeat="device in ['desktop', 'tablet', 'mobile']"
|
13
|
+
ng-click="preview.set(device)"
|
14
|
+
ng-class="{active: preview.is(device)}"
|
15
|
+
>
|
16
|
+
<a><i class="fa fa-{{device}}"></i></a>
|
17
|
+
</li>
|
18
|
+
|
19
|
+
<li ng-click="action.toggle('preview')" ng-class="{active: action.is('preview')}">
|
20
|
+
<a ng-hide="action.is('preview')"><%= fa_icon :eye %></a>
|
21
|
+
<a ng-show="action.is('preview')"><%= fa_icon 'eye-slash' %></a>
|
22
|
+
</li>
|
23
|
+
|
24
|
+
<li ng-click="fullscreen.toggle()" ng-class="{active: fullscreen.enabled}">
|
25
|
+
<a ng-show="fullscreen.disabled"><%= fa_icon :expand %></a>
|
26
|
+
<a ng-show="fullscreen.enabled"><%= fa_icon :compress %></a>
|
27
|
+
</li>
|
28
|
+
</ul>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</nav>
|
@@ -1,25 +1,33 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<script type="text/ng-template" id="promethee/write/add_button">
|
2
|
+
<span
|
3
|
+
type="button"
|
4
|
+
class="btn btn-default btn-block"
|
5
|
+
ng-click="addComponentTo(data.children)"
|
6
|
+
ng-hide="preview"
|
7
|
+
style="margin-bottom: 6px"
|
8
|
+
>
|
9
|
+
Add component
|
10
|
+
</span>
|
6
11
|
|
7
|
-
<div class="promethee-editor__adder" ng-controller="AdderController">
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<
|
12
|
+
<div class="promethee-editor__adder" ng-controller="AdderController">
|
13
|
+
<div class="modal fade in" tabindex="-1" role="dialog" style="display: {{adding ? 'block' : 'none'}}">
|
14
|
+
<div class="modal-dialog modal-lg" role="document">
|
15
|
+
<div class="modal-content">
|
16
|
+
<div class="modal-header">
|
17
|
+
<button type="button" class="close" ng-click="close()"><span aria-hidden="true">×</span></button>
|
18
|
+
<h4 class="modal-title">Select component</h4>
|
19
|
+
</div>
|
20
|
+
<div class="modal-body">
|
21
|
+
<div class="row">
|
22
|
+
<div
|
23
|
+
ng-repeat="definition in definitions"
|
24
|
+
ng-click="pushComponent(definition)"
|
25
|
+
class="col-md-3"
|
26
|
+
>
|
27
|
+
<div class="thumbnail">
|
28
|
+
<img ng-src="{{definition.thumb}}" class="img-responsive">
|
29
|
+
<h4>{{definition.name}}</h4>
|
30
|
+
</div>
|
23
31
|
</div>
|
24
32
|
</div>
|
25
33
|
</div>
|
@@ -27,7 +35,8 @@
|
|
27
35
|
</div>
|
28
36
|
</div>
|
29
37
|
</div>
|
30
|
-
</
|
38
|
+
</script>
|
39
|
+
|
31
40
|
<script type="text/javascript">
|
32
41
|
promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions', function($scope, $rootScope, definitions) {
|
33
42
|
|
@@ -61,4 +70,4 @@
|
|
61
70
|
};
|
62
71
|
|
63
72
|
}]);
|
64
|
-
</script>
|
73
|
+
</script>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/write/toolbar">
|
2
|
+
<div class="pull-right">
|
3
|
+
<span ng-click="editing = !editing" class="promethee-editor__button"><%= fa_icon 'pencil-square' %></span>
|
4
|
+
<span ng-click="remove(component, components)" class="promethee-editor__button"><%= fa_icon 'window-close' %></span>
|
5
|
+
</div>
|
6
|
+
</script>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/write/component/column">
|
2
|
+
<div class="
|
3
|
+
col
|
4
|
+
col-md-{{component.attributes.size}}
|
5
|
+
col-md-offset-{{component.attributes.offset}}
|
6
|
+
promethee-editor__component
|
7
|
+
promethee-editor__component--column"
|
8
|
+
>
|
9
|
+
<div class="promethee-editor__toolbar">
|
10
|
+
Column
|
11
|
+
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
12
|
+
</div>
|
13
|
+
<div ng-show="editing" class="promethee-editor__wrapper">
|
14
|
+
<div class="form-group">
|
15
|
+
<label class="label-control">Size</label>
|
16
|
+
<input ng-model="component.attributes.size" class="form-control" type="number"/>
|
17
|
+
</div>
|
18
|
+
<div class="form-group">
|
19
|
+
<label class="label-control">Offset</label>
|
20
|
+
<input ng-model="component.attributes.offset" class="form-control" type="number"/>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<ng-include src="'promethee/write/components'"></ng-include>
|
25
|
+
|
26
|
+
<span
|
27
|
+
type="button"
|
28
|
+
class="btn btn-default btn-block"
|
29
|
+
ng-click="addComponentTo(component.children)"
|
30
|
+
>
|
31
|
+
Add component
|
32
|
+
</span>
|
33
|
+
</div>
|
34
|
+
</script>
|
data/app/views/promethee/{components/_image_edit.html.erb → edit/write/component/_image.html.erb}
RENAMED
@@ -1,8 +1,8 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/
|
1
|
+
<script type="text/ng-template" id="promethee/write/component/image">
|
2
2
|
<div ng-controller="ImageController" class="promethee-editor__component promethee-editor__component--image">
|
3
3
|
<div class="promethee-editor__toolbar">
|
4
4
|
Image
|
5
|
-
|
5
|
+
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
6
6
|
</div>
|
7
7
|
<div ng-show="editing" class="promethee-editor__wrapper">
|
8
8
|
<div class="form-group">
|
@@ -23,10 +23,6 @@
|
|
23
23
|
</div>
|
24
24
|
</script>
|
25
25
|
|
26
|
-
<script type="text/ng-template" id="promethee/components/image/move">
|
27
|
-
<img ng-src="{{component.attributes.src}}" class="img-responsive">
|
28
|
-
</script>
|
29
|
-
|
30
26
|
<script>
|
31
27
|
angular.injector(['ng', 'Promethee']).get('definitions').push({
|
32
28
|
name: 'Image',
|
data/app/views/promethee/{components/_row_edit.html.erb → edit/write/component/_row.html.erb}
RENAMED
@@ -1,25 +1,18 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/
|
1
|
+
<script type="text/ng-template" id="promethee/write/component/row">
|
2
2
|
<div ng-controller="RowController"
|
3
3
|
class="row promethee-editor__component promethee-editor__component--row">
|
4
4
|
<div class="promethee-editor__toolbar">
|
5
5
|
Row
|
6
|
-
|
6
|
+
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
7
7
|
</div>
|
8
8
|
<div ng-show="editing" class="promethee-editor__wrapper">
|
9
9
|
</div>
|
10
|
-
<ng-include src="'promethee/components
|
10
|
+
<ng-include src="'promethee/write/components'"></ng-include>
|
11
11
|
<div class="clearfix"></div>
|
12
12
|
<span class="btn btn-default btn-block" ng-click="addColumn()" style="margin: 0 6px 6px 6px;width: auto">Add column</span>
|
13
13
|
</div>
|
14
14
|
</script>
|
15
15
|
|
16
|
-
<script type="text/ng-template" id="promethee/components/row/move">
|
17
|
-
<h1>Row</h1>
|
18
|
-
<div class="row">
|
19
|
-
<ng-include src="'promethee/partials/mover'"></ng-include>
|
20
|
-
</div>
|
21
|
-
</script>
|
22
|
-
|
23
16
|
<script>
|
24
17
|
angular.injector(['ng', 'Promethee']).get('definitions').push({
|
25
18
|
name: 'Row',
|
data/app/views/promethee/{components/_text_edit.html.erb → edit/write/component/_text.html.erb}
RENAMED
@@ -1,9 +1,9 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/
|
2
|
-
<div ng-controller="TextController"
|
1
|
+
<script type="text/ng-template" id="promethee/write/component/text">
|
2
|
+
<div ng-controller="TextController"
|
3
3
|
class="promethee-editor__component promethee-editor__component--text">
|
4
4
|
<div class="promethee-editor__toolbar">
|
5
5
|
Text
|
6
|
-
|
6
|
+
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
7
7
|
</div>
|
8
8
|
<div ng-show="editing">
|
9
9
|
<summernote config="options" ng-model="component.attributes.body"></summernote>
|
@@ -14,22 +14,6 @@
|
|
14
14
|
</div>
|
15
15
|
</script>
|
16
16
|
|
17
|
-
<script type="text/ng-template" id="promethee/components/text/move">
|
18
|
-
<div ng-bind-html="component.attributes.body | htmlSafe"></div>
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script type="text/ng-template" id="promethee/components/text/localize">
|
22
|
-
<div class="row">
|
23
|
-
<div class="col-md-6">
|
24
|
-
<summernote config="options" ng-model="component.attributes.body"></summernote>
|
25
|
-
</div>
|
26
|
-
<div class="col-md-6">
|
27
|
-
<b>Master</b>
|
28
|
-
<div class="promethee-editor__wrapper" ng-bind-html="component.master.attributes.body | htmlSafe"></div>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
</script>
|
32
|
-
|
33
17
|
<script>
|
34
18
|
angular.injector(['ng', 'Promethee']).get('definitions').push({
|
35
19
|
name: 'Text',
|
data/app/views/promethee/{components/_video_edit.html.erb → edit/write/component/_video.html.erb}
RENAMED
@@ -1,9 +1,9 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/
|
2
|
-
<div ng-controller="VideoController"
|
1
|
+
<script type="text/ng-template" id="promethee/write/component/video">
|
2
|
+
<div ng-controller="VideoController"
|
3
3
|
class="promethee-editor__component promethee-editor__component--video">
|
4
4
|
<div class="promethee-editor__toolbar">
|
5
5
|
Video
|
6
|
-
|
6
|
+
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
7
7
|
</div>
|
8
8
|
<div ng-show="editing" class="promethee-editor__wrapper">
|
9
9
|
<div class="form-group">
|
@@ -17,15 +17,6 @@
|
|
17
17
|
</div>
|
18
18
|
</script>
|
19
19
|
|
20
|
-
<script type="text/ng-template" id="promethee/components/video/move">
|
21
|
-
<div ng-controller="VideoController">
|
22
|
-
<div class="embed-responsive embed-responsive-16by9">
|
23
|
-
<iframe ng-if="embed" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" ng-src="{{embed | urlSafe}}"></iframe>
|
24
|
-
<div class="video-neutralizing-overlay"></div>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
</script>
|
28
|
-
|
29
20
|
<script>
|
30
21
|
angular.injector(['ng', 'Promethee']).get('definitions').push({
|
31
22
|
name: 'Video',
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/localize/component/text">
|
2
|
+
<div class="row">
|
3
|
+
<div class="col-md-6">
|
4
|
+
<summernote config="options" ng-model="component.attributes.body"></summernote>
|
5
|
+
</div>
|
6
|
+
<div class="col-md-6">
|
7
|
+
<b>Master</b>
|
8
|
+
<div class="promethee-editor__wrapper" ng-bind-html="component.master.attributes.body | htmlSafe"></div>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render "promethee/show/component/#{component[:type]}", component: component %>
|
@@ -1,8 +1,7 @@
|
|
1
1
|
<%
|
2
2
|
size = component[:attributes][:size]
|
3
3
|
offset = component[:attributes][:offset]
|
4
|
-
children = component[:children]
|
5
4
|
%>
|
6
5
|
<div class="col col-md-<%= size %><%= " col-md-offset-#{offset}" if offset > 0 %> <%= promethee_class_for component %>">
|
7
|
-
<%= render 'promethee/components
|
6
|
+
<%= render 'promethee/show/components', components: component[:children] %>
|
8
7
|
</div>
|
File without changes
|
File without changes
|
File without changes
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Dargelos
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -236,28 +236,39 @@ files:
|
|
236
236
|
- app/views/promethee/_edit.html.erb
|
237
237
|
- app/views/promethee/_localize.html.erb
|
238
238
|
- app/views/promethee/_show.html.erb
|
239
|
-
- app/views/promethee/
|
240
|
-
- app/views/promethee/
|
241
|
-
- app/views/promethee/
|
242
|
-
- app/views/promethee/
|
243
|
-
- app/views/promethee/
|
244
|
-
- app/views/promethee/
|
245
|
-
- app/views/promethee/
|
246
|
-
- app/views/promethee/
|
247
|
-
- app/views/promethee/
|
248
|
-
- app/views/promethee/
|
249
|
-
- app/views/promethee/
|
250
|
-
- app/views/promethee/
|
251
|
-
- app/views/promethee/
|
252
|
-
- app/views/promethee/
|
253
|
-
- app/views/promethee/
|
254
|
-
- app/views/promethee/
|
255
|
-
- app/views/promethee/
|
256
|
-
- app/views/promethee/
|
257
|
-
- app/views/promethee/
|
258
|
-
- app/views/promethee/
|
259
|
-
- app/views/promethee/
|
239
|
+
- app/views/promethee/edit/_move.html.erb
|
240
|
+
- app/views/promethee/edit/_preview.html.erb
|
241
|
+
- app/views/promethee/edit/_write.html.erb
|
242
|
+
- app/views/promethee/edit/move/_component.html.erb
|
243
|
+
- app/views/promethee/edit/move/_components.html.erb
|
244
|
+
- app/views/promethee/edit/move/component/_column.html.erb
|
245
|
+
- app/views/promethee/edit/move/component/_image.html.erb
|
246
|
+
- app/views/promethee/edit/move/component/_row.html.erb
|
247
|
+
- app/views/promethee/edit/move/component/_text.html.erb
|
248
|
+
- app/views/promethee/edit/move/component/_video.html.erb
|
249
|
+
- app/views/promethee/edit/shared/_navbar.html.erb
|
250
|
+
- app/views/promethee/edit/write/_add_button.html.erb
|
251
|
+
- app/views/promethee/edit/write/_component.html.erb
|
252
|
+
- app/views/promethee/edit/write/_components.html.erb
|
253
|
+
- app/views/promethee/edit/write/_toolbar.html.erb
|
254
|
+
- app/views/promethee/edit/write/component/_column.html.erb
|
255
|
+
- app/views/promethee/edit/write/component/_image.html.erb
|
256
|
+
- app/views/promethee/edit/write/component/_row.html.erb
|
257
|
+
- app/views/promethee/edit/write/component/_text.html.erb
|
258
|
+
- app/views/promethee/edit/write/component/_video.html.erb
|
259
|
+
- app/views/promethee/localize/component/_column.html.erb
|
260
|
+
- app/views/promethee/localize/component/_image.html.erb
|
261
|
+
- app/views/promethee/localize/component/_row.html.erb
|
262
|
+
- app/views/promethee/localize/component/_text.html.erb
|
263
|
+
- app/views/promethee/localize/component/_video.html.erb
|
260
264
|
- app/views/promethee/preview.html.erb
|
265
|
+
- app/views/promethee/show/_component.html.erb
|
266
|
+
- app/views/promethee/show/_components.html.erb
|
267
|
+
- app/views/promethee/show/component/_column.html.erb
|
268
|
+
- app/views/promethee/show/component/_image.html.erb
|
269
|
+
- app/views/promethee/show/component/_row.html.erb
|
270
|
+
- app/views/promethee/show/component/_text.html.erb
|
271
|
+
- app/views/promethee/show/component/_video.html.erb
|
261
272
|
- config/routes.rb
|
262
273
|
- lib/promethee.rb
|
263
274
|
- lib/promethee/configuration.rb
|
@@ -1,42 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/components/column">
|
2
|
-
<div class="col
|
3
|
-
col-md-{{component.attributes.size}}
|
4
|
-
col-md-offset-{{component.attributes.offset}}
|
5
|
-
promethee-editor__component
|
6
|
-
promethee-editor__component--column">
|
7
|
-
<div class="promethee-editor__toolbar">
|
8
|
-
Column
|
9
|
-
<%= render 'promethee/partials/toolbar_buttons' %>
|
10
|
-
</div>
|
11
|
-
<div ng-show="editing" class="promethee-editor__wrapper">
|
12
|
-
<div class="form-group">
|
13
|
-
<label class="label-control">Size</label>
|
14
|
-
<input ng-model="component.attributes.size" class="form-control" type="number"/>
|
15
|
-
</div>
|
16
|
-
<div class="form-group">
|
17
|
-
<label class="label-control">Offset</label>
|
18
|
-
<input ng-model="component.attributes.offset" class="form-control" type="number"/>
|
19
|
-
</div>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<ng-include src="'promethee/components/children'"></ng-include>
|
23
|
-
|
24
|
-
<span type="button"
|
25
|
-
class="btn btn-default btn-block"
|
26
|
-
ng-click="addComponentTo(component.children)">Add component</span>
|
27
|
-
</div>
|
28
|
-
</script>
|
29
|
-
|
30
|
-
<script type="text/ng-template" id="promethee/components/column/move">
|
31
|
-
<div class="col col-md-{{component.attributes.size}} col-md-offset-{{component.attributes.offset}}">
|
32
|
-
<h1>Column</h1>
|
33
|
-
<ng-include src="'promethee/partials/mover'"></ng-include>
|
34
|
-
<div class=" promethee-editor__mover--droppable
|
35
|
-
promethee-editor__mover--droppable--row
|
36
|
-
promethee-editor__mover--droppable--row--inside-column"
|
37
|
-
droppable
|
38
|
-
data-index="{{$index+1}}"
|
39
|
-
data-type="{{type}}"
|
40
|
-
>
|
41
|
-
</div>
|
42
|
-
</script>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render 'promethee/components/children', children: page[:children] %>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/components/page">
|
2
|
-
<div ng-init="component = data"
|
3
|
-
class="promethee-editor__component promethee-editor__component--page">
|
4
|
-
<ng-include src="'promethee/components/children'"></ng-include>
|
5
|
-
</div>
|
6
|
-
</script>
|
7
|
-
|
8
|
-
<script type="text/ng-template" id="promethee/components/page/move">
|
9
|
-
<ng-include src="'promethee/partials/mover'"></ng-include>
|
10
|
-
</script>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<% # TODO iterate over files in gem, instead of a predefined array %>
|
2
|
-
<% ['page', 'children', 'row', 'column', 'text', 'image', 'video'].each do |type| %>
|
3
|
-
<%= render "promethee/components/#{type}_edit" %>
|
4
|
-
<% end %>
|
5
|
-
|
6
|
-
<% # TODO iterate over custom views to add custom types and override existing types %>
|
7
|
-
<% Dir['app/views/promethee/components/*'].each do |file| %>
|
8
|
-
|
9
|
-
<% end %>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<nav class="navbar navbar-default promethee-editor__navbar">
|
2
|
-
<div class="container-fluid">
|
3
|
-
<div class="navbar-header promethee-editor__icon">
|
4
|
-
<div class="navbar-brand"><%= File.read(__dir__ + '/../../../assets/images/icon-promethee.svg').html_safe %></div>
|
5
|
-
</div>
|
6
|
-
<div id="navbar">
|
7
|
-
<ul class="nav navbar-nav navbar-right">
|
8
|
-
<li ng-click="toggleMove()"><a><%= fa_icon :arrows %></a></li>
|
9
|
-
<li ng-click="enablePreview()" ng-hide="preview"><a><%= fa_icon :eye %></a></li>
|
10
|
-
<li ng-click="previewMode = 'mobile'" ng-class="{ active: previewMode == 'mobile' }" ng-show="preview">
|
11
|
-
<a><%= fa_icon :mobile %></a>
|
12
|
-
</li>
|
13
|
-
<li ng-click="previewMode = 'tablet'" ng-class="{ active: previewMode == 'tablet' }" ng-show="preview"><a>
|
14
|
-
<%= fa_icon :tablet %></a>
|
15
|
-
</li>
|
16
|
-
<li ng-click="previewMode = 'desktop'" ng-class="{ active: previewMode == 'desktop' }" ng-show="preview"><a>
|
17
|
-
<%= fa_icon :desktop %></a>
|
18
|
-
</li>
|
19
|
-
<li ng-click="disablePreview()" ng-show="preview"><a><%= fa_icon 'eye-slash' %></a>
|
20
|
-
</li>
|
21
|
-
<li ng-click="enableFullscreen()" ng-hide="fullscreen"><a><%= fa_icon :expand %></a></li>
|
22
|
-
<li ng-click="disableFullscreen()" ng-show="fullscreen"><a><%= fa_icon :compress %></a></li>
|
23
|
-
</ul>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
|
-
</nav>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<div class="promethee-editor__preview" ng-show="preview"
|
2
|
-
ng-class="{
|
3
|
-
'promethee-editor__preview--mobile': preview && previewMode == 'mobile',
|
4
|
-
'promethee-editor__preview--tablet': preview && previewMode == 'tablet',
|
5
|
-
'promethee-editor__preview--desktop': preview && previewMode == 'desktop'
|
6
|
-
}">
|
7
|
-
<iframe class="promethee-editor__preview--frame"
|
8
|
-
name="preview"
|
9
|
-
sandbox="allow-scripts"
|
10
|
-
frameBorder="0">
|
11
|
-
</iframe>
|
12
|
-
</div>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
except ||= []
|
3
|
-
except = [except] unless except.is_a? Array
|
4
|
-
except.map! { |button| button.to_s.to_sym }
|
5
|
-
|
6
|
-
only ||= []
|
7
|
-
only = [only] unless only.is_a? Array
|
8
|
-
only.map! { |button| button.to_s.to_sym }
|
9
|
-
|
10
|
-
buttons = [:edit, :remove].map{ |button| [button, (only.empty? || button.in?(only)) && !button.in?(except)] }.to_h
|
11
|
-
%>
|
12
|
-
|
13
|
-
<div class="pull-right">
|
14
|
-
<% if buttons[:edit] %>
|
15
|
-
<span ng-click="editing = !editing" class="promethee-editor__button"><%= fa_icon 'pencil-square' %></span>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<% if buttons[:remove] %>
|
19
|
-
<span ng-click="remove(component, components)" class="promethee-editor__button"><%= fa_icon 'window-close' %></span>
|
20
|
-
<% end %>
|
21
|
-
</div>
|