promethee 1.0.18 → 1.0.19

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.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -4
  3. data/app/assets/stylesheets/promethee-editor/_component.sass +17 -0
  4. data/app/assets/stylesheets/promethee-editor/_mover.sass +11 -0
  5. data/app/assets/stylesheets/promethee.sass +15 -0
  6. data/app/views/promethee/_localize.html.erb +4 -2
  7. data/app/views/promethee/edit/_write.html.erb +3 -0
  8. data/app/views/promethee/edit/move/component/_cover.html.erb +8 -0
  9. data/app/views/promethee/edit/move/component/_details.html.erb +6 -0
  10. data/app/views/promethee/edit/move/component/_image.html.erb +4 -1
  11. data/app/views/promethee/edit/move/component/_slider.html.erb +7 -0
  12. data/app/views/promethee/edit/write/component/_cover.html.erb +70 -0
  13. data/app/views/promethee/edit/write/component/_details.html.erb +68 -0
  14. data/app/views/promethee/edit/write/component/_image.html.erb +19 -3
  15. data/app/views/promethee/edit/write/component/_slider.html.erb +77 -0
  16. data/app/views/promethee/localize/_component.html.erb +3 -0
  17. data/app/views/promethee/localize/component/_column.html.erb +2 -10
  18. data/app/views/promethee/localize/component/_cover.html.erb +11 -0
  19. data/app/views/promethee/localize/component/_details.html.erb +11 -0
  20. data/app/views/promethee/localize/component/_image.html.erb +11 -1
  21. data/app/views/promethee/localize/component/_slider.html.erb +3 -0
  22. data/app/views/promethee/localize/component/_text.html.erb +9 -1
  23. data/app/views/promethee/show/component/_cover.html.erb +6 -0
  24. data/app/views/promethee/show/component/_details.html.erb +8 -0
  25. data/app/views/promethee/show/component/_image.html.erb +9 -2
  26. data/app/views/promethee/show/component/_slider.html.erb +16 -0
  27. data/lib/promethee/rails/version.rb +1 -1
  28. metadata +15 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91fcc83478af634a7c46e76f061a1c9c2c71635a
4
- data.tar.gz: 8673c66290f2eb5a9e8b7ed43d3b1eecd97604eb
3
+ metadata.gz: ff4222a60ff026188abda14dedaef525f7af012a
4
+ data.tar.gz: 8272fbd675688bb2b8c079c1c61b922f6b86a992
5
5
  SHA512:
6
- metadata.gz: e8ab2ffa36e0e05778155c594fa57b1134b6a613b74a163319dd219c2094de6376ef14907b78fafd695a3714294d00f59d4c912890cf012511f28ed301d0a160
7
- data.tar.gz: c1720102c79c8eeb8e8ad2e07a83a35a1d56afc5588b3c04289dcf5cb4b1241d7baa748da5d2a802f3b33fcf5136dedb3d7688190fccac96378c837b955aac7f
6
+ metadata.gz: 3fa8ec13bc82dc0b430724afad25795c56166774a792a934b72160d9977d07f9c2e296ebfd268e76852f88fbb23e60a4fbad956a5c46a173c69853c101dd58b6
7
+ data.tar.gz: 30c2f867088622d787d15727d8fb5117f564ddaac82c005e4577289f9baf3bff5e2f3b3965f68f425b067130952a55a4c82d4e75f82a19424a4f502a10f96299
data/README.md CHANGED
@@ -163,9 +163,10 @@ With javascript set:
163
163
  //= require jquery
164
164
  //= require jquery-ui
165
165
  //= require bootstrap
166
+ //= require summernote
166
167
  //= require angular
167
168
  //= require angular-animate
168
- //= require summernote
169
+ //= require angular-ui-bootstrap
169
170
  //= require angular-summernote
170
171
  //= require promethee
171
172
  //= require promethee-editor
@@ -306,12 +307,15 @@ This would do quite the same thing:
306
307
  - promethee-i18n
307
308
  - Component versioning
308
309
  - Edit in a column
309
- - UI et branding
310
+ - UI and branding
310
311
  - Gallery
311
312
  - Menu
312
313
  - Tab
313
- - Cover
314
- - Chapter (or maybe it's a cover too?)
314
+ - ~~Cover~~
315
+ - ~~Chapter (or maybe it's a cover too? *Yes it is, but see next line*)~~
316
+ - Section (in order to organize page contents within distincts parts which can be referenced. eg: scrollspy, hyperlink, tabs, ...)
317
+ - Utils rake tasks (generate, destroy, override, ...)
318
+ - Doc (to be updated in terms of the new component concept and structure)
315
319
 
316
320
  ## Development
317
321
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -2,9 +2,26 @@
2
2
  &--text
3
3
  .mce-tinymce
4
4
  border: none
5
+
5
6
  .mce-panel
6
7
  border-top-color: $promethee-transparent-grey
8
+
7
9
  .mce-btn-group:not(:first-child)
8
10
  border-left-color: $promethee-transparent-grey
11
+
9
12
  .mce-top-part::before
10
13
  box-shadow: none
14
+
15
+ &--cover
16
+ .promethee-editor__cover-content
17
+ padding: 150px 30px
18
+ background-repeat: no-repeat
19
+ background-position: center center
20
+ background-size: cover
21
+
22
+ &--slider
23
+ .fontawesome-carousel-control .fa
24
+ top: 50%
25
+ position: absolute
26
+ transform: translateY(-50%)
27
+ font-size: 30px
@@ -2,10 +2,13 @@
2
2
  transform-origin: top
3
3
  transition: transform ease-out 0.5s
4
4
  transform: scale(0.3)
5
+
5
6
  &.ng-hide
6
7
  transform: scale(1)
8
+
7
9
  .row, .col
8
10
  position: relative
11
+
9
12
  &--draggable
10
13
  h4
11
14
  font-size: 11px
@@ -14,8 +17,10 @@
14
17
  color: $promethee-color
15
18
  padding: 0 0 0 3px
16
19
  margin: 0
20
+
17
21
  &--row
18
22
  padding-left: 10px
23
+
19
24
  &--droppable
20
25
  margin: 10px 0
21
26
  position: relative
@@ -24,6 +29,7 @@
24
29
  width: 400px
25
30
  height: 40px
26
31
  transition: .2s
32
+
27
33
  &--hidden
28
34
  visibility: hidden
29
35
  pointer-events: none
@@ -39,14 +45,17 @@
39
45
  left: -25px
40
46
  width: 40px
41
47
  height: 400px
48
+
42
49
  &--inside-column
43
50
  position: absolute
44
51
  top: 0
45
52
  right: -25px
46
53
  width: 40px
47
54
  height: 400px
55
+
48
56
  &--dragged
49
57
  opacity: 0.25
58
+
50
59
  .ui-droppable-active
51
60
  border-color: $promethee-color
52
61
 
@@ -57,6 +66,7 @@
57
66
  &--dragging
58
67
  .promethee__move--droppable.promethee__move--droppable--row
59
68
  display: none
69
+
60
70
  // Except for columns, which can be dropped only on rows
61
71
  &--dragging.promethee__move--dragging--column
62
72
  .promethee__move--droppable
@@ -65,6 +75,7 @@
65
75
  &.promethee__move--droppable.promethee__move--droppable--row--inside-column,
66
76
  &.promethee__move--droppable.promethee__move--droppable--row--first
67
77
  display: block
78
+
68
79
  .video-neutralizing-overlay
69
80
  background: transparent
70
81
  position: absolute
@@ -1 +1,16 @@
1
1
  .promethee
2
+ &__component
3
+ &--cover
4
+ background-repeat: no-repeat
5
+ background-position: center center
6
+ background-size: cover
7
+ padding: 150px 30px
8
+
9
+ &--slider
10
+ .promethee__component
11
+ margin-bottom: 0
12
+ .fontawesome-carousel-control .fa
13
+ top: 50%
14
+ position: absolute
15
+ transform: translateY(-50%)
16
+ font-size: 30px
@@ -14,7 +14,8 @@ 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 = $scope.component = data;
17
+ $scope.data = data;
18
+ $scope.component = {children: data.components};
18
19
 
19
20
  $scope.options = {
20
21
  toolbar: [
@@ -38,11 +39,12 @@ promethee_data = Promethee::Data.new master_data, localization_data: localizatio
38
39
  ng-controller="PrometheeLocalizerController as prometheeLocalizerController">
39
40
  <input type="hidden" name="page[data]" id="page_data" value="{{data}}" />
40
41
 
42
+ <%= render 'promethee/localize/component' %>
41
43
  <% Dir[__dir__ + '/localize/component/*.html.erb'].map do |file| %>
42
44
  <%= render "promethee/localize/component/#{File.basename(file, '.html.erb').sub(/\A_/, '')}" %>
43
45
  <% end %>
44
46
 
45
47
  <div ng-repeat="component in component.children">
46
- <ng-include src="'promethee/localize/components'"></ng-include>
48
+ <ng-include src="'promethee/localize/component'"></ng-include>
47
49
  </div>
48
50
  </div>
@@ -5,6 +5,9 @@
5
5
  <% Dir[__dir__ + '/write/component/_*.html.erb'].map do |file| %>
6
6
  <%= render "promethee/edit/write/component/#{File.basename(file, '.html.erb').sub(/\A_/, '')}" %>
7
7
  <% end %>
8
+ <% Dir[__dir__ + '/write/toolbar/_*.html.erb'].map do |file| %>
9
+ <%= render "promethee/edit/write/toolbar/#{File.basename(file, '.html.erb').sub(/\A_/, '')}" %>
10
+ <% end %>
8
11
 
9
12
  <script type="text/ng-template" id="promethee/write">
10
13
  <div class="promethee-editor__page">
@@ -0,0 +1,8 @@
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>
@@ -0,0 +1,6 @@
1
+ <script type="text/ng-template" id="promethee/move/component/details">
2
+ <details>
3
+ <summary>{{component.attributes.summary}}</summary>
4
+ <ng-include src="'promethee/move'"></ng-include>
5
+ </details>
6
+ </script>
@@ -1,3 +1,6 @@
1
1
  <script type="text/ng-template" id="promethee/move/component/image">
2
- <img ng-src="{{component.attributes.src}}" class="img-responsive">
2
+ <figure>
3
+ <img ng-src="{{component.attributes.src}}" class="img-responsive">
4
+ <figcaption ng-show="component.attributes.caption" ng-bind-html="component.attributes.caption | htmlSafe"></figcaption>
5
+ </figure>
3
6
  </script>
@@ -0,0 +1,7 @@
1
+ <script type="text/ng-template" id="promethee/move/component/slider">
2
+ <h1>Slider</h1>
3
+
4
+ <div ng-if="component.children.length > 0" ng-init="component = component.children[0]">
5
+ <ng-include src="'promethee/move/component'"></ng-include>
6
+ </div>
7
+ </script>
@@ -0,0 +1,70 @@
1
+ <script type="text/ng-template" id="promethee/write/component/cover">
2
+ <div ng-controller="CoverController" class="promethee-editor__component promethee-editor__component--cover">
3
+ <div class="promethee-editor__toolbar">
4
+ Cover
5
+ <ng-include src="'promethee/write/toolbar'"></ng-include>
6
+ </div>
7
+ <div ng-show="editing" class="promethee-editor__wrapper">
8
+ <div class="form-group">
9
+ <label class="label-control">Image Url</label>
10
+ <input ng-model="component.attributes.src" class="form-control" type="text"/>
11
+ </div>
12
+ </div>
13
+
14
+ <div
15
+ ng-hide="editing"
16
+ class="promethee-editor__wrapper promethee-editor__cover-content"
17
+ ng-bind-html="component.attributes.body | htmlSafe"
18
+ ng-click="edit()"
19
+ style="background-image: url('{{component.attributes.src}}')"
20
+ ></div>
21
+
22
+ <div
23
+ ng-show="editing"
24
+ class="promethee-editor__wrapper promethee-editor__cover-content"
25
+ style="background-image: url('{{component.attributes.src}}')"
26
+ >
27
+ <summernote config="options" ng-model="component.attributes.body"></summernote>
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
+ alt: '',
41
+ caption: ''
42
+ }
43
+ }
44
+ });
45
+
46
+ promethee.controller('CoverController', ['$scope', function($scope) {
47
+ $scope.editing = false;
48
+
49
+ $scope.edit = function() {
50
+ $scope.editing = true;
51
+ };
52
+
53
+ $scope.complete = function() {
54
+ $scope.editing = false;
55
+ };
56
+
57
+ $scope.toggleEdit = function() {
58
+ $scope.editing = !$scope.editing;
59
+ };
60
+
61
+ $scope.options = {
62
+ toolbar: [
63
+ ['headline', ['style']],
64
+ ['style', ['bold', 'italic']],
65
+ ['alignment', ['ul', 'ol', 'paragraph']],
66
+ ['code', ['codeview']]
67
+ ]
68
+ };
69
+ }]);
70
+ </script>
@@ -0,0 +1,68 @@
1
+ <script type="text/ng-template" id="promethee/write/component/details">
2
+ <div ng-controller="DetailsController"
3
+ class="promethee-editor__component promethee-editor__component--details">
4
+ <div class="promethee-editor__toolbar">
5
+ Details
6
+ <ng-include src="'promethee/write/toolbar'"></ng-include>
7
+ </div>
8
+
9
+ <div ng-show="editing" class="promethee-editor__wrapper">
10
+ <div class="form-group">
11
+ <label class="label-control">Summary</label>
12
+ <input ng-model="component.attributes.summary" class="form-control" type="text"/>
13
+ </div>
14
+ </div>
15
+
16
+ <details>
17
+ <summary>{{component.attributes.summary}}</summary>
18
+ <ng-include src="'promethee/write/components'"></ng-include>
19
+
20
+ <span
21
+ type="button"
22
+ class="btn btn-default btn-block"
23
+ ng-click="addComponentTo(component.children)"
24
+ >
25
+ Add component
26
+ </span>
27
+ </details>
28
+ </div>
29
+ </script>
30
+
31
+ <script>
32
+ angular.injector(['ng', 'Promethee']).get('definitions').push({
33
+ name: 'Details',
34
+ thumb: 'http://via.placeholder.com/300x200',
35
+ data: {
36
+ type: 'details',
37
+ children: [],
38
+ attributes: {
39
+ summary: 'Edit me'
40
+ }
41
+ }
42
+ });
43
+
44
+ promethee.controller('DetailsController', ['$scope', function($scope) {
45
+ $scope.editing = false;
46
+
47
+ $scope.edit = function() {
48
+ $scope.editing = true;
49
+ };
50
+
51
+ $scope.complete = function() {
52
+ $scope.editing = false;
53
+ };
54
+
55
+ $scope.toggleEdit = function() {
56
+ $scope.editing = !$scope.editing;
57
+ };
58
+
59
+ $scope.options = {
60
+ toolbar: [
61
+ ['headline', ['style']],
62
+ ['style', ['bold', 'italic']],
63
+ ['alignment', ['ul', 'ol', 'paragraph']],
64
+ ['code', ['codeview']]
65
+ ]
66
+ };
67
+ }]);
68
+ </script>
@@ -13,10 +13,15 @@
13
13
  <label class="label-control">Alt</label>
14
14
  <input ng-model="component.attributes.alt" class="form-control" type="text"/>
15
15
  </div>
16
+ <div class="form-group">
17
+ <label class="label-control">Caption</label>
18
+ <summernote config="options" ng-model="component.attributes.caption"></summernote>
19
+ </div>
16
20
  </div>
17
- <div ng-show="component.attributes.src">
21
+ <figure ng-show="component.attributes.src">
18
22
  <img ng-click="edit()" ng-src="{{component.attributes.src}}" class="img-responsive">
19
- </div>
23
+ <figcaption ng-show="component.attributes.caption" ng-bind-html="component.attributes.caption | htmlSafe"></figcaption>
24
+ </figure>
20
25
  <div ng-hide="component.attributes.src">
21
26
  <p ng-hide="editing" ng-click="edit()" class="text-center">Click to set the image</p>
22
27
  </div>
@@ -30,7 +35,9 @@
30
35
  data: {
31
36
  type: 'image',
32
37
  attributes: {
33
- src: 'https://source.unsplash.com/random/1920x1080'
38
+ src: 'https://picsum.photos/1920/1080/?random',
39
+ alt: '',
40
+ caption: ''
34
41
  }
35
42
  }
36
43
  });
@@ -49,5 +56,14 @@
49
56
  $scope.toggleEdit = function() {
50
57
  $scope.editing = !$scope.editing;
51
58
  };
59
+
60
+ $scope.options = {
61
+ toolbar: [
62
+ ['headline', ['style']],
63
+ ['style', ['bold', 'italic']],
64
+ ['alignment', ['ul', 'ol', 'paragraph']],
65
+ ['code', ['codeview']]
66
+ ]
67
+ };
52
68
  }]);
53
69
  </script>
@@ -0,0 +1,77 @@
1
+ <script type="text/ng-template" id="promethee/write/component/slider">
2
+ <div ng-controller="SliderController"
3
+ class="row promethee-editor__component promethee-editor__component--slider">
4
+ <div class="promethee-editor__toolbar">
5
+ Slider
6
+
7
+ <ng-include src="'promethee/write/toolbar'"></ng-include>
8
+
9
+ <div class="pull-right">
10
+ <span ng-show="editing" ng-click="prev()" class="promethee-editor__button"><%= fa_icon 'chevron-left' %></span>
11
+ <span ng-show="editing" ng-click="next()" class="promethee-editor__button"><%= fa_icon 'chevron-right' %></span>
12
+ </div>
13
+ </div>
14
+
15
+ <div id="{{sliderId}}" class="carousel slide" data-ride="carousel" ng-init="components = component.children">
16
+ <div class="carousel-inner" style="min-height: 100px">
17
+ <div ng-repeat="component in components track by $index" class="item" ng-class="{active: $index === 0}">
18
+ <ng-include src="'promethee/' + (editing ? 'write' : 'move') + '/component'"></ng-include>
19
+ </div>
20
+ </div>
21
+
22
+ <a ng-hide="editing" ng-click="$event.preventDefault()" class="left carousel-control fontawesome-carousel-control" href="#{{sliderId}}" data-slide="prev">
23
+ <%= fa_icon 'angle-left' %>
24
+ </a>
25
+ <a ng-hide="editing" ng-click="$event.preventDefault()" class="right carousel-control fontawesome-carousel-control" href="#{{sliderId}}" data-slide="next">
26
+ <%= fa_icon 'angle-right' %>
27
+ </a>
28
+ </div>
29
+
30
+ <span
31
+ type="button"
32
+ class="btn btn-default btn-block"
33
+ ng-click="addComponentTo(component.children);goToLastItem();"
34
+ >
35
+ Add item
36
+ </span>
37
+ </div>
38
+ </script>
39
+
40
+ <script>
41
+ angular.injector(['ng', 'Promethee']).get('definitions').push({
42
+ name: 'Slider',
43
+ thumb: 'http://via.placeholder.com/300x200',
44
+ data: {
45
+ type: 'slider',
46
+ attributes: {},
47
+ children: []
48
+ }
49
+ });
50
+
51
+ promethee.controller('SliderController', ['$scope', '$element', function($scope, $element) {
52
+ $scope.sliderId = 'slider-' + Date.now() + '-' + Math.floor(Math.random()*1000000);
53
+
54
+ $scope.$watch('editing', function(newVal) {
55
+ if(newVal === true) $element.find('.carousel').carousel('pause');
56
+ else $element.find('.carousel').carousel('play');
57
+ });
58
+
59
+ $scope.goToLastItem = function() {
60
+ setTimeout(function() {
61
+ $element.find('.carousel').carousel($scope.component.children.length - 1);
62
+ }, 1000);
63
+ };
64
+
65
+ $scope.prev = function() {
66
+ $element.find('.carousel').carousel('prev');
67
+ };
68
+
69
+ $scope.next = function() {
70
+ $element.find('.carousel').carousel('next');
71
+ };
72
+
73
+ $element.find('.carousel').carousel();
74
+
75
+ // element.ready(function() { this.find('.carousel').carousel() });
76
+ }]);
77
+ </script>
@@ -0,0 +1,3 @@
1
+ <script type="text/ng-template" id="promethee/localize/component">
2
+ <ng-include src="'promethee/localize/component/' + component.type"></ng-include>
3
+ </script>
@@ -1,11 +1,3 @@
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>
1
+ <script type="text/ng-template" id="promethee/localize/component/column">
2
+
11
3
  </script>
@@ -0,0 +1,11 @@
1
+ <script type="text/ng-template" id="promethee/localize/component/cover">
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,11 @@
1
+ <script type="text/ng-template" id="promethee/localize/component/details">
2
+ <div class="row">
3
+ <div class="col-md-6">
4
+ <input ng-model="component.attributes.summary" type="text" class="form-control">
5
+ </div>
6
+ <div class="col-md-6">
7
+ <b>Master</b>
8
+ <input ng-model="component.master.attributes.summary" type="text" class="form-control" disabled/>
9
+ </div>
10
+ </div>
11
+ </script>
@@ -1,3 +1,13 @@
1
1
  <script type="text/ng-template" id="promethee/localize/component/image">
2
-
2
+ <div class="row">
3
+ <div class="col-md-6">
4
+ <input ng-model="component.attributes.alt" type="text" class="form-control">
5
+ <summernote config="options" ng-model="component.attributes.caption"></summernote>
6
+ </div>
7
+ <div class="col-md-6">
8
+ <b>Master</b>
9
+ <input ng-model="component.master.attributes.alt" type="text" class="form-control" disabled/>
10
+ <div class="promethee-editor__wrapper" ng-bind-html="component.master.attributes.caption | htmlSafe"></div>
11
+ </div>
12
+ </div>
3
13
  </script>
@@ -0,0 +1,3 @@
1
+ <script type="text/ng-template" id="promethee/localize/component/slider">
2
+
3
+ </script>
@@ -1,3 +1,11 @@
1
1
  <script type="text/ng-template" id="promethee/localize/component/text">
2
-
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>
3
11
  </script>
@@ -0,0 +1,6 @@
1
+ <%
2
+ src = component[:attributes][:src].to_s
3
+ body = component[:attributes][:body].to_s
4
+ %>
5
+
6
+ <%= content_tag :div, body.html_safe, class: promethee_class_for(component), style: 'background-image: url(' + src.to_json.html_safe + ')' %>
@@ -0,0 +1,8 @@
1
+ <%
2
+ summary = component[:attributes][:summary]
3
+ %>
4
+
5
+ <details class="<%= promethee_class_for component %>">
6
+ <summary><%= summary %></summary>
7
+ <%= render 'promethee/show/components', components: component[:children] %>
8
+ </details>
@@ -1,7 +1,14 @@
1
1
  <%
2
2
  src = component[:attributes][:src]
3
3
  alt = component[:attributes][:alt]
4
+ caption = component[:attributes][:caption].to_s
4
5
  %>
5
- <div class="<%= promethee_class_for component %>">
6
+ <figure class="<%= promethee_class_for component %>">
6
7
  <img class="img-responsive" src="<%= src %>" alt="<%= alt %>">
7
- </div>
8
+
9
+ <% if caption.present? %>
10
+ <figcaption>
11
+ <%= caption.html_safe %>
12
+ </figcaption>
13
+ <% end %>
14
+ </figure>
@@ -0,0 +1,16 @@
1
+ <div id="slider-<%= component[:id] %>" class="carousel slide <%= promethee_class_for component %>" data-ride="carousel">
2
+ <div class="carousel-inner">
3
+ <% component[:children].each.with_index do |child, n| %>
4
+ <div class="item<%= ' active' if n.zero? %>">
5
+ <%= render 'promethee/show/component', component: child %>
6
+ </div>
7
+ <% end %>
8
+ </div>
9
+
10
+ <a class="left carousel-control fontawesome-carousel-control" href="#slider-<%= component[:id] %>" data-slide="prev">
11
+ <%= fa_icon 'angle-left' %>
12
+ </a>
13
+ <a class="right carousel-control fontawesome-carousel-control" href="#slider-<%= component[:id] %>" data-slide="next">
14
+ <%= fa_icon 'angle-right' %>
15
+ </a>
16
+ </div>
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '1.0.18'
3
+ VERSION = '1.0.19'
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.0.18
4
+ version: 1.0.19
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-03 00:00:00.000000000 Z
14
+ date: 2018-01-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -242,8 +242,11 @@ files:
242
242
  - app/views/promethee/edit/move/_component.html.erb
243
243
  - app/views/promethee/edit/move/_components.html.erb
244
244
  - app/views/promethee/edit/move/component/_column.html.erb
245
+ - app/views/promethee/edit/move/component/_cover.html.erb
246
+ - app/views/promethee/edit/move/component/_details.html.erb
245
247
  - app/views/promethee/edit/move/component/_image.html.erb
246
248
  - app/views/promethee/edit/move/component/_row.html.erb
249
+ - app/views/promethee/edit/move/component/_slider.html.erb
247
250
  - app/views/promethee/edit/move/component/_text.html.erb
248
251
  - app/views/promethee/edit/move/component/_video.html.erb
249
252
  - app/views/promethee/edit/shared/_navbar.html.erb
@@ -252,21 +255,31 @@ files:
252
255
  - app/views/promethee/edit/write/_components.html.erb
253
256
  - app/views/promethee/edit/write/_toolbar.html.erb
254
257
  - app/views/promethee/edit/write/component/_column.html.erb
258
+ - app/views/promethee/edit/write/component/_cover.html.erb
259
+ - app/views/promethee/edit/write/component/_details.html.erb
255
260
  - app/views/promethee/edit/write/component/_image.html.erb
256
261
  - app/views/promethee/edit/write/component/_row.html.erb
262
+ - app/views/promethee/edit/write/component/_slider.html.erb
257
263
  - app/views/promethee/edit/write/component/_text.html.erb
258
264
  - app/views/promethee/edit/write/component/_video.html.erb
265
+ - app/views/promethee/localize/_component.html.erb
259
266
  - app/views/promethee/localize/component/_column.html.erb
267
+ - app/views/promethee/localize/component/_cover.html.erb
268
+ - app/views/promethee/localize/component/_details.html.erb
260
269
  - app/views/promethee/localize/component/_image.html.erb
261
270
  - app/views/promethee/localize/component/_row.html.erb
271
+ - app/views/promethee/localize/component/_slider.html.erb
262
272
  - app/views/promethee/localize/component/_text.html.erb
263
273
  - app/views/promethee/localize/component/_video.html.erb
264
274
  - app/views/promethee/preview.html.erb
265
275
  - app/views/promethee/show/_component.html.erb
266
276
  - app/views/promethee/show/_components.html.erb
267
277
  - app/views/promethee/show/component/_column.html.erb
278
+ - app/views/promethee/show/component/_cover.html.erb
279
+ - app/views/promethee/show/component/_details.html.erb
268
280
  - app/views/promethee/show/component/_image.html.erb
269
281
  - app/views/promethee/show/component/_row.html.erb
282
+ - app/views/promethee/show/component/_slider.html.erb
270
283
  - app/views/promethee/show/component/_text.html.erb
271
284
  - app/views/promethee/show/component/_video.html.erb
272
285
  - config/routes.rb