promethee 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -39
- data/app/assets/javascripts/promethee-edit.js +209 -0
- data/app/assets/stylesheets/{promethee-editor.sass → promethee-edit.sass} +6 -6
- data/app/assets/stylesheets/{promethee-editor → promethee-edit}/_move.sass +7 -7
- data/app/assets/stylesheets/{promethee-editor → promethee-edit}/_preview.sass +1 -1
- data/app/assets/stylesheets/{promethee-editor → promethee-edit}/_write.sass +8 -8
- data/app/views/promethee/_edit.html.erb +33 -115
- data/app/views/promethee/_localize.html.erb +11 -7
- data/app/{assets/javascripts/promethee-editor.js → views/promethee/components/column/_edit.define.html.erb} +0 -0
- data/app/views/promethee/{edit/inspector/component/_column.html.erb → components/column/_edit.inspect.html.erb} +1 -1
- data/app/views/promethee/{edit/move/component/_column.html.erb → components/column/_edit.move.html.erb} +4 -4
- data/app/views/promethee/components/column/_edit.write.html.erb +17 -0
- data/app/views/promethee/components/column/_localize.html.erb +3 -0
- data/app/views/promethee/{show/component/_column.html.erb → components/column/_show.html.erb} +0 -0
- data/app/views/promethee/components/cover/_edit.define.html.erb +13 -0
- data/app/views/promethee/{edit/inspector/component/_cover.html.erb → components/cover/_edit.inspect.html.erb} +1 -1
- data/app/views/promethee/components/cover/_edit.move.html.erb +7 -0
- data/app/views/promethee/components/cover/_edit.write.html.erb +39 -0
- data/app/views/promethee/{localize/component/_cover.html.erb → components/cover/_localize.html.erb} +4 -2
- data/app/views/promethee/{show/component/_cover.html.erb → components/cover/_show.html.erb} +0 -0
- data/app/views/promethee/components/details/_edit.define.html.erb +13 -0
- data/app/views/promethee/{edit/inspector/component/_details.html.erb → components/details/_edit.inspect.html.erb} +1 -1
- data/app/views/promethee/{edit/move/component/_details.html.erb → components/details/_edit.move.html.erb} +1 -1
- data/app/views/promethee/components/details/_edit.write.html.erb +35 -0
- data/app/views/promethee/{localize/component/_details.html.erb → components/details/_localize.html.erb} +3 -1
- data/app/views/promethee/{show/component/_details.html.erb → components/details/_show.html.erb} +0 -0
- data/app/views/promethee/components/image/_edit.define.html.erb +14 -0
- data/app/views/promethee/{edit/inspector/component/_image.html.erb → components/image/_edit.inspect.html.erb} +1 -1
- data/app/views/promethee/{edit/move/component/_image.html.erb → components/image/_edit.move.html.erb} +1 -1
- data/app/views/promethee/{edit/write/component/_image.html.erb → components/image/_edit.write.html.erb} +7 -23
- data/app/views/promethee/{localize/component/_image.html.erb → components/image/_localize.html.erb} +5 -2
- data/app/views/promethee/{show/component/_image.html.erb → components/image/_show.html.erb} +0 -0
- data/app/views/promethee/components/row/_edit.define.html.erb +11 -0
- data/app/views/promethee/components/row/_edit.inspect.html.erb +3 -0
- data/app/views/promethee/{edit/move/component/_row.html.erb → components/row/_edit.move.html.erb} +1 -1
- data/app/views/promethee/components/row/_edit.write.html.erb +33 -0
- data/app/views/promethee/components/row/_localize.html.erb +3 -0
- data/app/views/promethee/{show/component/_row.html.erb → components/row/_show.html.erb} +0 -0
- data/app/views/promethee/components/slider/_edit.define.html.erb +11 -0
- data/app/views/promethee/components/slider/_edit.inspect.html.erb +3 -0
- data/app/views/promethee/{edit/move/component/_slider.html.erb → components/slider/_edit.move.html.erb} +2 -3
- data/app/views/promethee/{edit/write/component/_slider.html.erb → components/slider/_edit.write.html.erb} +25 -32
- data/app/views/promethee/components/slider/_localize.html.erb +3 -0
- data/app/views/promethee/{show/component/_slider.html.erb → components/slider/_show.html.erb} +0 -0
- data/app/views/promethee/components/text/_edit.define.html.erb +12 -0
- data/app/views/promethee/{edit/inspector/component/_text.html.erb → components/text/_edit.inspect.html.erb} +1 -1
- data/app/views/promethee/{edit/move/component/_text.html.erb → components/text/_edit.move.html.erb} +1 -1
- data/app/views/promethee/components/text/_edit.write.html.erb +32 -0
- data/app/views/promethee/{localize/component/_text.html.erb → components/text/_localize.html.erb} +4 -2
- data/app/views/promethee/{show/component/_text.html.erb → components/text/_show.html.erb} +0 -0
- data/app/views/promethee/components/video/_edit.define.html.erb +12 -0
- data/app/views/promethee/{edit/inspector/component/_video.html.erb → components/video/_edit.inspect.html.erb} +1 -1
- data/app/views/promethee/{edit/move/component/_video.html.erb → components/video/_edit.move.html.erb} +1 -1
- data/app/views/promethee/{edit/write/component/_video.html.erb → components/video/_edit.write.html.erb} +7 -39
- data/app/views/promethee/components/video/_localize.html.erb +3 -0
- data/app/views/promethee/{show/component/_video.html.erb → components/video/_show.html.erb} +0 -0
- data/app/views/promethee/edit/_move.html.erb +35 -74
- data/app/views/promethee/edit/_preview.html.erb +3 -3
- data/app/views/promethee/edit/_write.html.erb +67 -17
- data/app/views/promethee/show/_component.html.erb +1 -1
- data/lib/promethee/rails/version.rb +1 -1
- metadata +55 -57
- data/app/views/promethee/edit/inspector/_inspector.html.erb +0 -11
- data/app/views/promethee/edit/inspector/component/_row.html.erb +0 -3
- data/app/views/promethee/edit/inspector/component/_slider.html.erb +0 -3
- data/app/views/promethee/edit/move/_component.html.erb +0 -5
- data/app/views/promethee/edit/move/_components.html.erb +0 -26
- data/app/views/promethee/edit/move/component/_cover.html.erb +0 -8
- data/app/views/promethee/edit/shared/_data.html.erb +0 -1
- data/app/views/promethee/edit/shared/_navbar.html.erb +0 -25
- data/app/views/promethee/edit/write/_add_button.html.erb +0 -66
- data/app/views/promethee/edit/write/_component.html.erb +0 -3
- data/app/views/promethee/edit/write/_components.html.erb +0 -7
- data/app/views/promethee/edit/write/_toolbar.html.erb +0 -5
- data/app/views/promethee/edit/write/component/_column.html.erb +0 -21
- data/app/views/promethee/edit/write/component/_cover.html.erb +0 -55
- data/app/views/promethee/edit/write/component/_details.html.erb +0 -52
- data/app/views/promethee/edit/write/component/_row.html.erb +0 -42
- data/app/views/promethee/edit/write/component/_text.html.erb +0 -44
- data/app/views/promethee/localize/_component.html.erb +0 -3
- data/app/views/promethee/localize/component/_column.html.erb +0 -3
- data/app/views/promethee/localize/component/_row.html.erb +0 -3
- data/app/views/promethee/localize/component/_slider.html.erb +0 -3
- data/app/views/promethee/localize/component/_video.html.erb +0 -3
@@ -1 +1 @@
|
|
1
|
-
<%= render "promethee/
|
1
|
+
<%= render "promethee/components/#{component[:type]}/show", component: component %>
|
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
|
+
version: 1.2.0
|
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: 2018-01-
|
14
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -225,73 +225,71 @@ files:
|
|
225
225
|
- app/assets/images/icon-promethee.svg
|
226
226
|
- app/assets/images/logo-promethee-horizontal.svg
|
227
227
|
- app/assets/images/logo-promethee-vertical.svg
|
228
|
-
- app/assets/javascripts/promethee-
|
228
|
+
- app/assets/javascripts/promethee-edit.js
|
229
229
|
- app/assets/javascripts/promethee.js
|
230
|
-
- app/assets/stylesheets/promethee-
|
231
|
-
- app/assets/stylesheets/promethee-
|
232
|
-
- app/assets/stylesheets/promethee-
|
233
|
-
- app/assets/stylesheets/promethee-
|
230
|
+
- app/assets/stylesheets/promethee-edit.sass
|
231
|
+
- app/assets/stylesheets/promethee-edit/_move.sass
|
232
|
+
- app/assets/stylesheets/promethee-edit/_preview.sass
|
233
|
+
- app/assets/stylesheets/promethee-edit/_write.sass
|
234
234
|
- app/assets/stylesheets/promethee.sass
|
235
235
|
- app/controllers/promethee_controller.rb
|
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/components/column/_edit.define.html.erb
|
240
|
+
- app/views/promethee/components/column/_edit.inspect.html.erb
|
241
|
+
- app/views/promethee/components/column/_edit.move.html.erb
|
242
|
+
- app/views/promethee/components/column/_edit.write.html.erb
|
243
|
+
- app/views/promethee/components/column/_localize.html.erb
|
244
|
+
- app/views/promethee/components/column/_show.html.erb
|
245
|
+
- app/views/promethee/components/cover/_edit.define.html.erb
|
246
|
+
- app/views/promethee/components/cover/_edit.inspect.html.erb
|
247
|
+
- app/views/promethee/components/cover/_edit.move.html.erb
|
248
|
+
- app/views/promethee/components/cover/_edit.write.html.erb
|
249
|
+
- app/views/promethee/components/cover/_localize.html.erb
|
250
|
+
- app/views/promethee/components/cover/_show.html.erb
|
251
|
+
- app/views/promethee/components/details/_edit.define.html.erb
|
252
|
+
- app/views/promethee/components/details/_edit.inspect.html.erb
|
253
|
+
- app/views/promethee/components/details/_edit.move.html.erb
|
254
|
+
- app/views/promethee/components/details/_edit.write.html.erb
|
255
|
+
- app/views/promethee/components/details/_localize.html.erb
|
256
|
+
- app/views/promethee/components/details/_show.html.erb
|
257
|
+
- app/views/promethee/components/image/_edit.define.html.erb
|
258
|
+
- app/views/promethee/components/image/_edit.inspect.html.erb
|
259
|
+
- app/views/promethee/components/image/_edit.move.html.erb
|
260
|
+
- app/views/promethee/components/image/_edit.write.html.erb
|
261
|
+
- app/views/promethee/components/image/_localize.html.erb
|
262
|
+
- app/views/promethee/components/image/_show.html.erb
|
263
|
+
- app/views/promethee/components/row/_edit.define.html.erb
|
264
|
+
- app/views/promethee/components/row/_edit.inspect.html.erb
|
265
|
+
- app/views/promethee/components/row/_edit.move.html.erb
|
266
|
+
- app/views/promethee/components/row/_edit.write.html.erb
|
267
|
+
- app/views/promethee/components/row/_localize.html.erb
|
268
|
+
- app/views/promethee/components/row/_show.html.erb
|
269
|
+
- app/views/promethee/components/slider/_edit.define.html.erb
|
270
|
+
- app/views/promethee/components/slider/_edit.inspect.html.erb
|
271
|
+
- app/views/promethee/components/slider/_edit.move.html.erb
|
272
|
+
- app/views/promethee/components/slider/_edit.write.html.erb
|
273
|
+
- app/views/promethee/components/slider/_localize.html.erb
|
274
|
+
- app/views/promethee/components/slider/_show.html.erb
|
275
|
+
- app/views/promethee/components/text/_edit.define.html.erb
|
276
|
+
- app/views/promethee/components/text/_edit.inspect.html.erb
|
277
|
+
- app/views/promethee/components/text/_edit.move.html.erb
|
278
|
+
- app/views/promethee/components/text/_edit.write.html.erb
|
279
|
+
- app/views/promethee/components/text/_localize.html.erb
|
280
|
+
- app/views/promethee/components/text/_show.html.erb
|
281
|
+
- app/views/promethee/components/video/_edit.define.html.erb
|
282
|
+
- app/views/promethee/components/video/_edit.inspect.html.erb
|
283
|
+
- app/views/promethee/components/video/_edit.move.html.erb
|
284
|
+
- app/views/promethee/components/video/_edit.write.html.erb
|
285
|
+
- app/views/promethee/components/video/_localize.html.erb
|
286
|
+
- app/views/promethee/components/video/_show.html.erb
|
239
287
|
- app/views/promethee/edit/_move.html.erb
|
240
288
|
- app/views/promethee/edit/_preview.html.erb
|
241
289
|
- app/views/promethee/edit/_write.html.erb
|
242
|
-
- app/views/promethee/edit/inspector/_inspector.html.erb
|
243
|
-
- app/views/promethee/edit/inspector/component/_column.html.erb
|
244
|
-
- app/views/promethee/edit/inspector/component/_cover.html.erb
|
245
|
-
- app/views/promethee/edit/inspector/component/_details.html.erb
|
246
|
-
- app/views/promethee/edit/inspector/component/_image.html.erb
|
247
|
-
- app/views/promethee/edit/inspector/component/_row.html.erb
|
248
|
-
- app/views/promethee/edit/inspector/component/_slider.html.erb
|
249
|
-
- app/views/promethee/edit/inspector/component/_text.html.erb
|
250
|
-
- app/views/promethee/edit/inspector/component/_video.html.erb
|
251
|
-
- app/views/promethee/edit/move/_component.html.erb
|
252
|
-
- app/views/promethee/edit/move/_components.html.erb
|
253
|
-
- app/views/promethee/edit/move/component/_column.html.erb
|
254
|
-
- app/views/promethee/edit/move/component/_cover.html.erb
|
255
|
-
- app/views/promethee/edit/move/component/_details.html.erb
|
256
|
-
- app/views/promethee/edit/move/component/_image.html.erb
|
257
|
-
- app/views/promethee/edit/move/component/_row.html.erb
|
258
|
-
- app/views/promethee/edit/move/component/_slider.html.erb
|
259
|
-
- app/views/promethee/edit/move/component/_text.html.erb
|
260
|
-
- app/views/promethee/edit/move/component/_video.html.erb
|
261
|
-
- app/views/promethee/edit/shared/_data.html.erb
|
262
|
-
- app/views/promethee/edit/shared/_navbar.html.erb
|
263
|
-
- app/views/promethee/edit/write/_add_button.html.erb
|
264
|
-
- app/views/promethee/edit/write/_component.html.erb
|
265
|
-
- app/views/promethee/edit/write/_components.html.erb
|
266
|
-
- app/views/promethee/edit/write/_toolbar.html.erb
|
267
|
-
- app/views/promethee/edit/write/component/_column.html.erb
|
268
|
-
- app/views/promethee/edit/write/component/_cover.html.erb
|
269
|
-
- app/views/promethee/edit/write/component/_details.html.erb
|
270
|
-
- app/views/promethee/edit/write/component/_image.html.erb
|
271
|
-
- app/views/promethee/edit/write/component/_row.html.erb
|
272
|
-
- app/views/promethee/edit/write/component/_slider.html.erb
|
273
|
-
- app/views/promethee/edit/write/component/_text.html.erb
|
274
|
-
- app/views/promethee/edit/write/component/_video.html.erb
|
275
|
-
- app/views/promethee/localize/_component.html.erb
|
276
|
-
- app/views/promethee/localize/component/_column.html.erb
|
277
|
-
- app/views/promethee/localize/component/_cover.html.erb
|
278
|
-
- app/views/promethee/localize/component/_details.html.erb
|
279
|
-
- app/views/promethee/localize/component/_image.html.erb
|
280
|
-
- app/views/promethee/localize/component/_row.html.erb
|
281
|
-
- app/views/promethee/localize/component/_slider.html.erb
|
282
|
-
- app/views/promethee/localize/component/_text.html.erb
|
283
|
-
- app/views/promethee/localize/component/_video.html.erb
|
284
290
|
- app/views/promethee/preview.html.erb
|
285
291
|
- app/views/promethee/show/_component.html.erb
|
286
292
|
- app/views/promethee/show/_components.html.erb
|
287
|
-
- app/views/promethee/show/component/_column.html.erb
|
288
|
-
- app/views/promethee/show/component/_cover.html.erb
|
289
|
-
- app/views/promethee/show/component/_details.html.erb
|
290
|
-
- app/views/promethee/show/component/_image.html.erb
|
291
|
-
- app/views/promethee/show/component/_row.html.erb
|
292
|
-
- app/views/promethee/show/component/_slider.html.erb
|
293
|
-
- app/views/promethee/show/component/_text.html.erb
|
294
|
-
- app/views/promethee/show/component/_video.html.erb
|
295
293
|
- config/routes.rb
|
296
294
|
- lib/promethee.rb
|
297
295
|
- lib/promethee/configuration.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<div class="promethee-editor__inspector" ng-show="promethee.inspected">
|
2
|
-
<div class="promethee-editor__inspector-header">
|
3
|
-
<div class="pull-right">
|
4
|
-
<span ng-click="promethee.inspected = null"><%= fa_icon :times %></span>
|
5
|
-
</div>
|
6
|
-
<h5>{{promethee.inspected.type}}</h5>
|
7
|
-
</div>
|
8
|
-
<div class="promethee-editor__inspector-content">
|
9
|
-
<ng-include ng-if="promethee.inspected" src="'promethee/inspector/component/' + promethee.inspected.type"></ng-include>
|
10
|
-
</div>
|
11
|
-
</div>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/move/components">
|
2
|
-
<div ng-init="type = component.type; components = component.children">
|
3
|
-
<div
|
4
|
-
class="promethee-editor__move__droppable promethee-editor__move__droppable--{{type}} promethee-editor__move__droppable--{{type}}--first"
|
5
|
-
droppable
|
6
|
-
data-index="0"
|
7
|
-
>
|
8
|
-
</div>
|
9
|
-
<div
|
10
|
-
ng-repeat="component in components"
|
11
|
-
class="promethee-editor__move__draggable promethee-editor__move__draggable--{{type}}"
|
12
|
-
draggable
|
13
|
-
data-index="{{$index}}"
|
14
|
-
data-type="{{component.type}}"
|
15
|
-
>
|
16
|
-
<ng-include src="'promethee/move/component'"></ng-include>
|
17
|
-
<div
|
18
|
-
class="promethee-editor__move__droppable promethee-editor__move__droppable--{{type}}"
|
19
|
-
droppable
|
20
|
-
data-index="{{$index+1}}"
|
21
|
-
data-type="{{type}}"
|
22
|
-
>
|
23
|
-
</div>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
|
-
</script>
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/move/component/cover">
|
2
|
-
<div
|
3
|
-
class="promethee-editor__wrapper promethee-editor__cover-content"
|
4
|
-
ng-bind-html="component.attributes.body | htmlSafe"
|
5
|
-
style="background-image: url('{{component.attributes.src}}')"
|
6
|
-
></div>
|
7
|
-
</div>
|
8
|
-
</script>
|
@@ -1 +0,0 @@
|
|
1
|
-
<input type="hidden" name="page[data]" id="page_data" value="{{data}}" />
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<nav class="navbar navbar-default promethee-editor__navbar" ng-class="{'navbar-fixed-top': fullscreen }">
|
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="mode = 'write'" ng-class="{active: mode == 'write'}"><a><%= fa_icon :pencil %></a></li>
|
9
|
-
<li ng-click="mode = 'move'" ng-class="{active: mode == 'move'}"><a><%= fa_icon :arrows %></a></li>
|
10
|
-
<li ng-click="enablePreview()" ng-class="{active: mode == 'preview'}">
|
11
|
-
<a data-toggle="dropdown"><%= fa_icon :eye %></a>
|
12
|
-
<ul class="dropdown-menu" ng-show="mode == 'preview'">
|
13
|
-
<li ng-click="preview = 'desktop'" ng-class="{active: preview == 'desktop'}"><a><i class="fa fa-desktop"></i></a></li>
|
14
|
-
<li ng-click="preview = 'tablet'" ng-class="{active: preview == 'tablet'}"><a><i class="fa fa-tablet"></i></a></li>
|
15
|
-
<li ng-click="preview = 'mobile'" ng-class="{active: preview == 'mobile'}"><a><i class="fa fa-mobile"></i></a></li>
|
16
|
-
</ul>
|
17
|
-
</li>
|
18
|
-
<li ng-click="fullscreen = !fullscreen">
|
19
|
-
<a ng-show="fullscreen"><%= fa_icon :expand %></a>
|
20
|
-
<a ng-hide="fullscreen"><%= fa_icon :compress %></a>
|
21
|
-
</li>
|
22
|
-
</ul>
|
23
|
-
</div>
|
24
|
-
</div>
|
25
|
-
</nav>
|
@@ -1,66 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/write/add_button">
|
2
|
-
<a ng-click="addComponentTo(component.children)" class="promethee-editor__adder__button"><%= fa_icon 'plus-circle', class: "fa-3x" %></a>
|
3
|
-
</script>
|
4
|
-
|
5
|
-
<div class="promethee-editor__adder" ng-controller="AdderController">
|
6
|
-
<div class="modal fade in" tabindex="-1" role="dialog" style="display: {{adding ? 'block' : 'none'}}">
|
7
|
-
<div class="modal-dialog modal-lg" role="document">
|
8
|
-
<div class="modal-content">
|
9
|
-
<div class="modal-header">
|
10
|
-
<button type="button" class="close" ng-click="close()"><span aria-hidden="true">×</span></button>
|
11
|
-
<h4 class="modal-title">Select component</h4>
|
12
|
-
</div>
|
13
|
-
<div class="modal-body">
|
14
|
-
<div class="row">
|
15
|
-
<div
|
16
|
-
ng-repeat="definition in definitions"
|
17
|
-
ng-click="pushComponent(definition)"
|
18
|
-
class="col-md-3"
|
19
|
-
>
|
20
|
-
<div class="thumbnail">
|
21
|
-
<img ng-src="{{definition.thumb}}" class="img-responsive">
|
22
|
-
<h4>{{definition.name}}</h4>
|
23
|
-
<p>{{definition.description}}</p>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
</div>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
</div>
|
32
|
-
|
33
|
-
<script type="text/javascript">
|
34
|
-
promethee.controller('AdderController', ['$scope', '$rootScope', 'definitions', function($scope, $rootScope, definitions) {
|
35
|
-
|
36
|
-
$scope.adding = false;
|
37
|
-
$scope.childrenToAddTo = null;
|
38
|
-
$scope.definitions = definitions;
|
39
|
-
|
40
|
-
$scope.close = function() {
|
41
|
-
$scope.adding = false;
|
42
|
-
$scope.addingToChildren = null;
|
43
|
-
};
|
44
|
-
|
45
|
-
$scope.pushComponent = function(definition) {
|
46
|
-
var definition = angular.copy(definition.data);
|
47
|
-
definition.id = $scope.createIdentifier();
|
48
|
-
$scope.childrenToAddTo.push(definition);
|
49
|
-
$scope.close();
|
50
|
-
};
|
51
|
-
|
52
|
-
$rootScope.addComponentTo = function(components) {
|
53
|
-
$scope.adding = true;
|
54
|
-
$scope.childrenToAddTo = components;
|
55
|
-
};
|
56
|
-
|
57
|
-
// https://gist.github.com/gordonbrander/2230317
|
58
|
-
$scope.createIdentifier = function () {
|
59
|
-
// Math.random should be unique because of its seeding algorithm.
|
60
|
-
// Convert it to base 36 (numbers + letters), and grab the first 9 characters
|
61
|
-
// after the decimal.
|
62
|
-
return '' + Math.random().toString(36).substr(2, 9);
|
63
|
-
};
|
64
|
-
|
65
|
-
}]);
|
66
|
-
</script>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/write/component/column">
|
2
|
-
<div
|
3
|
-
ng-click="inspect(component, $event)"
|
4
|
-
class="
|
5
|
-
col
|
6
|
-
col-md-{{component.attributes.size}}
|
7
|
-
col-md-offset-{{component.attributes.offset}}
|
8
|
-
promethee-editor__component
|
9
|
-
promethee-editor__component--column
|
10
|
-
"
|
11
|
-
>
|
12
|
-
<div class="promethee-editor__component-selected" ng-class="{'promethee-editor__component-selected--visible': promethee.inspected === component}">
|
13
|
-
<div class="promethee-editor__toolbar">
|
14
|
-
Column
|
15
|
-
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
16
|
-
</div>
|
17
|
-
<ng-include src="'promethee/write/components'"></ng-include>
|
18
|
-
<ng-include src="'promethee/write/add_button'"></ng-include>
|
19
|
-
</div>
|
20
|
-
</div>
|
21
|
-
</script>
|
@@ -1,55 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/write/component/cover">
|
2
|
-
<div
|
3
|
-
ng-controller="CoverController"
|
4
|
-
ng-click="inspect(component, $event)"
|
5
|
-
class="promethee-editor__component promethee-editor__component--cover"
|
6
|
-
>
|
7
|
-
<div class="promethee-editor__component-selected" ng-class="{'promethee-editor__component-selected--visible': promethee.inspected === component}">
|
8
|
-
<div class="promethee-editor__toolbar">
|
9
|
-
Cover
|
10
|
-
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
11
|
-
</div>
|
12
|
-
|
13
|
-
<div
|
14
|
-
ng-hide="editing"
|
15
|
-
class="promethee-editor__wrapper promethee-editor__cover-content"
|
16
|
-
ng-bind-html="component.attributes.body | htmlSafe"
|
17
|
-
ng-click="edit()"
|
18
|
-
style="background-image: url('{{component.attributes.src}}')"
|
19
|
-
></div>
|
20
|
-
|
21
|
-
<div
|
22
|
-
ng-show="editing"
|
23
|
-
class="promethee-editor__wrapper promethee-editor__cover-content"
|
24
|
-
style="background-image: url('{{component.attributes.src}}')"
|
25
|
-
>
|
26
|
-
<summernote config="options" ng-model="component.attributes.body"></summernote>
|
27
|
-
</div>
|
28
|
-
</div>
|
29
|
-
</div>
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script>
|
33
|
-
angular.injector(['ng', 'Promethee']).get('definitions').push({
|
34
|
-
name: 'Cover',
|
35
|
-
thumb: 'http://via.placeholder.com/300x200',
|
36
|
-
data: {
|
37
|
-
type: 'cover',
|
38
|
-
attributes: {
|
39
|
-
src: 'https://picsum.photos/1920/1080/?random',
|
40
|
-
body: ''
|
41
|
-
}
|
42
|
-
}
|
43
|
-
});
|
44
|
-
|
45
|
-
promethee.controller('CoverController', ['$scope', function($scopen) {
|
46
|
-
$scope.options = {
|
47
|
-
toolbar: [
|
48
|
-
['headline', ['style']],
|
49
|
-
['style', ['bold', 'italic']],
|
50
|
-
['alignment', ['ul', 'ol', 'paragraph']],
|
51
|
-
['code', ['codeview']]
|
52
|
-
]
|
53
|
-
};
|
54
|
-
}]);
|
55
|
-
</script>
|
@@ -1,52 +0,0 @@
|
|
1
|
-
<script type="text/ng-template" id="promethee/write/component/details">
|
2
|
-
<div
|
3
|
-
ng-controller="DetailsController"
|
4
|
-
ng-click="inspect(component, $event)"
|
5
|
-
class="promethee-editor__component promethee-editor__component--details"
|
6
|
-
>
|
7
|
-
<div class="promethee-editor__component-selected" ng-class="{'promethee-editor__component-selected--visible': promethee.inspected === component}">
|
8
|
-
<div class="promethee-editor__toolbar">
|
9
|
-
Details
|
10
|
-
<ng-include src="'promethee/write/toolbar'"></ng-include>
|
11
|
-
</div>
|
12
|
-
|
13
|
-
<details>
|
14
|
-
<summary>{{component.attributes.summary}}</summary>
|
15
|
-
<ng-include src="'promethee/write/components'"></ng-include>
|
16
|
-
|
17
|
-
<span
|
18
|
-
type="button"
|
19
|
-
class="btn btn-default btn-block"
|
20
|
-
ng-click="addComponentTo(component.children)"
|
21
|
-
>
|
22
|
-
Add component
|
23
|
-
</span>
|
24
|
-
</details>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
</script>
|
28
|
-
|
29
|
-
<script>
|
30
|
-
angular.injector(['ng', 'Promethee']).get('definitions').push({
|
31
|
-
name: 'Details',
|
32
|
-
thumb: 'http://via.placeholder.com/300x200',
|
33
|
-
data: {
|
34
|
-
type: 'details',
|
35
|
-
children: [],
|
36
|
-
attributes: {
|
37
|
-
summary: 'Edit me'
|
38
|
-
}
|
39
|
-
}
|
40
|
-
});
|
41
|
-
|
42
|
-
promethee.controller('DetailsController', ['$scope', function($scope) {
|
43
|
-
$scope.options = {
|
44
|
-
toolbar: [
|
45
|
-
['headline', ['style']],
|
46
|
-
['style', ['bold', 'italic']],
|
47
|
-
['alignment', ['ul', 'ol', 'paragraph']],
|
48
|
-
['code', ['codeview']]
|
49
|
-
]
|
50
|
-
};
|
51
|
-
}]);
|
52
|
-
</script>
|