promethee 1.6.29 → 1.6.30
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-edit/_move.sass +1 -1
- data/app/views/promethee/components/aside/_edit.inspect.html.erb +3 -3
- data/app/views/promethee/components/collection/_edit.inspect.html.erb +10 -41
- data/app/views/promethee/components/collection_item/_edit.define.html.erb +25 -0
- data/app/views/promethee/components/collection_item/_edit.inspect.html.erb +25 -0
- data/app/views/promethee/components/collection_item/_edit.move.html.erb +46 -0
- data/app/views/promethee/components/collection_item/_icon.svg +1 -0
- data/app/views/promethee/components/collection_item/_localize.html.erb +15 -0
- data/app/views/promethee/components/collection_item/_show.html.erb +32 -0
- data/app/views/promethee/components/row/_show.html.erb +2 -2
- data/app/views/promethee/components/slider/_edit.move.html.erb +1 -1
- data/app/views/promethee/components/slider_item/_edit.define.html.erb +10 -3
- data/app/views/promethee/components/slider_item/_edit.inspect.html.erb +14 -41
- data/app/views/promethee/components/slider_item/_edit.move.html.erb +36 -4
- data/app/views/promethee/components/slider_item/_icon.svg +1 -3
- data/app/views/promethee/components/slider_item/_localize.html.erb +4 -4
- data/app/views/promethee/components/slider_item/_show.html.erb +30 -3
- data/lib/promethee/rails/version.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '083292512fe13e861376d4e3267c9f536655ebb1'
|
4
|
+
data.tar.gz: 92351c0b82f1e3112377460e3bc116abda3c0377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a67c38235022701f4b18cc334e706fb4c90eecfbb8a5ea496c398d3e8ae98fb6ea356876b7f9d985c0135919ea9c7686d6e8db344eac5bd59d178513f1d8a0d2
|
7
|
+
data.tar.gz: e578016f13e629c184af2e0d285cef953f7ce1bb90a10d2a4e45c55d6014cf38555a7b063eab512e9f1f3cda431c2010becace3491a43b667348aa52c8919a11
|
@@ -17,9 +17,9 @@
|
|
17
17
|
<div class="form-group">
|
18
18
|
<label class="label-control">Button label position</label>
|
19
19
|
<div>
|
20
|
-
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position"
|
21
|
-
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position"
|
22
|
-
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position"
|
20
|
+
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position" type="radio" value="left" />Left </label>
|
21
|
+
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position" type="radio" value="center" />Center </label>
|
22
|
+
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.open_label_position" type="radio" value="right" />Right </label>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
25
|
</script>
|
@@ -5,47 +5,16 @@
|
|
5
5
|
<input ng-model="promethee.inspected.attributes.items_per_line" type="range" min="2" max="12">
|
6
6
|
</div>
|
7
7
|
|
8
|
-
<div
|
9
|
-
<div
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
</div>
|
19
|
-
<div class="col-xs-3">
|
20
|
-
<ng-include src="'promethee/move/component'"></ng-include>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
</div>
|
8
|
+
<div class="form-group">
|
9
|
+
<div class="btn btn-default" ng-click="addComponentByType('collection_item', promethee.inspected.children)">Add item</div>
|
10
|
+
<div ng-show="promethee.inspected.children.length > 1">
|
11
|
+
<br><br>
|
12
|
+
<label class="label-control">Drag the items below to reorder them:</label>
|
13
|
+
<ul ui-sortable ng-model="promethee.inspected.children" class="list-unstyled">
|
14
|
+
<li ng-repeat="item in promethee.inspected.children">
|
15
|
+
<%= fa_icon :bars %> Item {{$index + 1}}
|
16
|
+
</li>
|
17
|
+
</ul>
|
24
18
|
</div>
|
25
19
|
</div>
|
26
|
-
|
27
|
-
<div class="pull-right btn-toolbar" ng-controller="CollectionInspectorController">
|
28
|
-
<span ng-repeat="definition in itemDefinitions" class="btn btn-default" ng-click="addItem(definition)">Add {{definition.name}}</span>
|
29
|
-
</div>
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script>
|
33
|
-
promethee.controller('CollectionInspectorController', ['$scope', function($scope) {
|
34
|
-
var availableComponents = ['image', 'video'];
|
35
|
-
|
36
|
-
$scope.itemDefinitions = $scope.promethee.definitions.filter(function(definition) {
|
37
|
-
return availableComponents.includes(definition.data.type);
|
38
|
-
});
|
39
|
-
|
40
|
-
var clone = function(object) {
|
41
|
-
return JSON.parse(JSON.stringify(object));
|
42
|
-
}
|
43
|
-
|
44
|
-
$scope.addItem = function(definition) {
|
45
|
-
var item = JSON.parse(JSON.stringify(definition.data));
|
46
|
-
item.id = $scope.generateIdentifier();
|
47
|
-
|
48
|
-
$scope.promethee.inspected.children.push(item);
|
49
|
-
}
|
50
|
-
}])
|
51
20
|
</script>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%
|
2
|
+
init = <<~JAVASCRIPT
|
3
|
+
promethee.definitions.push({
|
4
|
+
name: 'Collection Item',
|
5
|
+
icon: #{ promethee_component_render_icon 'collection_item' },
|
6
|
+
position: 15,
|
7
|
+
library: false,
|
8
|
+
data: {
|
9
|
+
type: 'collection_item',
|
10
|
+
attributes: {
|
11
|
+
searchable_caption: "",
|
12
|
+
media_type: "image",
|
13
|
+
image: {
|
14
|
+
id: undefined,
|
15
|
+
name: ""
|
16
|
+
},
|
17
|
+
video: {
|
18
|
+
url: "https://vimeo.com/115082758"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
})
|
23
|
+
JAVASCRIPT
|
24
|
+
%>
|
25
|
+
<div ng-init="<%= init %>"></div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/components/collection_item/edit/inspect">
|
2
|
+
<div class="form-group">
|
3
|
+
<label class="label-control">Media type</label>
|
4
|
+
<div>
|
5
|
+
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.media_type" type="radio" value="image" />Image </label>
|
6
|
+
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.media_type" type="radio" value="video" />Video </label>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<promethee-uploader ng-show="promethee.inspected.attributes.media_type == 'image'" ng-model="promethee.inspected.attributes.image" label="Image" limits="'.jpg,.jpeg,.png,.gif'"></promethee-uploader>
|
11
|
+
|
12
|
+
<div class="form-group" ng-show="promethee.inspected.attributes.media_type == 'video'">
|
13
|
+
<label class="label-control">Video URL</label>
|
14
|
+
<input class="form-control" ng-model="promethee.inspected.attributes.video.url"></summernote>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="row">
|
18
|
+
<div class="col-xs-12">
|
19
|
+
<div class="form-group">
|
20
|
+
<label class="label-control">Caption</label>
|
21
|
+
<summernote config="summernoteConfig" ng-model="promethee.inspected.attributes.searchable_caption"></summernote>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</script>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/components/collection_item/edit/move">
|
2
|
+
<%= render 'promethee/edit/move.header', type: 'collection_item' %>
|
3
|
+
<div class="header">Collection Item</div>
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-xs-12">
|
6
|
+
<img ng-show="component.attributes.media_type == 'image'" ng-src="/promethee/blob/{{component.attributes.image.id}}" class="img-responsive">
|
7
|
+
<div ng-show="component.attributes.media_type == 'video'" ng-controller="CollectionItemVideoController">
|
8
|
+
<div class="embed-responsive embed-responsive-16by9">
|
9
|
+
<iframe ng-if="embed" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" ng-src="{{embed | urlSafe}}"></iframe>
|
10
|
+
<div class="video-neutralizing-overlay"></div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<div class="row">
|
16
|
+
<div class="col-xs-12 collection-item-caption" ng-show="component.attributes.searchable_caption !== ''">Caption</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script>
|
23
|
+
promethee.controller('CollectionItemVideoController', ['$scope', function($scope) {
|
24
|
+
Object.defineProperty($scope, 'embed', {
|
25
|
+
get: function() {
|
26
|
+
var embed = null;
|
27
|
+
var url = this.component.attributes.video.url + '';
|
28
|
+
|
29
|
+
if(url.includes('vimeo')) {
|
30
|
+
var id = url.replace(/^(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?$/, '$1');
|
31
|
+
embed = 'https://player.vimeo.com/video/' + id + '?color=ffffff&title=0&byline=0&portrait=0';
|
32
|
+
}
|
33
|
+
else if(url.includes('youtube')) {
|
34
|
+
var parts = url.split('watch?v=');
|
35
|
+
var id = parts[parts.length - 1];
|
36
|
+
embed = 'https://www.youtube.com/embed/' + id;
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
var embed = url;
|
40
|
+
}
|
41
|
+
|
42
|
+
return embed;
|
43
|
+
}
|
44
|
+
})
|
45
|
+
}]);
|
46
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"></svg>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<script type="text/ng-template" id="promethee/components/collection_item/localize">
|
2
|
+
<div ng-show="component.master.attributes.searchable_caption !== ''">
|
3
|
+
<hr>
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-md-6">
|
6
|
+
<b>Collection Item Caption</b>
|
7
|
+
<div class="promethee-edit__wrapper" ng-bind-html="component.master.attributes.searchable_caption | htmlSafe"></div>
|
8
|
+
</div>
|
9
|
+
<div class="col-md-6">
|
10
|
+
<label class="label-control">Collection Item Caption</label>
|
11
|
+
<summernote config="summernoteConfig" ng-model="component.attributes.searchable_caption"></summernote>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</script>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<%
|
2
|
+
media_type = component[:attributes][:media_type]
|
3
|
+
case media_type
|
4
|
+
when 'image'
|
5
|
+
image_data = component[:attributes][:image]
|
6
|
+
if image_data && image_data[:id]
|
7
|
+
image_blob = ActiveStorage::Blob.find image_data[:id]
|
8
|
+
end
|
9
|
+
when 'video'
|
10
|
+
url = component[:attributes][:video][:url].to_s
|
11
|
+
if 'vimeo'.in? url
|
12
|
+
video_id = url.gsub(/\A(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?\z/, '\1')
|
13
|
+
iframe_src = "https://player.vimeo.com/video/#{video_id}?color=ffffff&title=0&byline=0&portrait=0"
|
14
|
+
elsif 'youtube'.in? url
|
15
|
+
video_id = url.split('watch?v=').last
|
16
|
+
iframe_src = "http://www.youtube.com/embed/#{video_id}"
|
17
|
+
else
|
18
|
+
iframe_src = url
|
19
|
+
end
|
20
|
+
end
|
21
|
+
%>
|
22
|
+
<div class="collection-item__content">
|
23
|
+
|
24
|
+
<% if iframe_src.present? %>
|
25
|
+
<div class="embed-responsive embed-responsive-16by9">
|
26
|
+
<iframe frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" src="<%= iframe_src %>"></iframe>
|
27
|
+
</div>
|
28
|
+
<% elsif image_blob.present? %>
|
29
|
+
<%= render 'promethee/show/image.srcset', blob: image_blob, alt: '' %>
|
30
|
+
<% end %>
|
31
|
+
<%= component[:attributes][:searchable_caption].to_s.html_safe %>
|
32
|
+
</div>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<%
|
2
|
-
background_color = component[:attributes][:bgcolor]
|
2
|
+
background_color = "rgba(255, 255, 255, 1)" || component[:attributes][:bgcolor]
|
3
3
|
background_images = []
|
4
4
|
background_positions = []
|
5
5
|
background_sizes = []
|
6
6
|
|
7
|
-
if component[:attributes].has_key?(:backgrounds) # retro-compatibility
|
7
|
+
if component[:attributes] && component[:attributes].has_key?(:backgrounds) # retro-compatibility
|
8
8
|
component[:attributes][:backgrounds].each do |item|
|
9
9
|
image_data = item[:image]
|
10
10
|
if image_data && image_data[:id]
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= render 'promethee/edit/move.header', type: 'slider' %>
|
3
3
|
<div class="header">Slider</div>
|
4
4
|
<div ng-controller="SliderMoveController">
|
5
|
-
<div class="row carousel">
|
5
|
+
<div ng-show="components.length" class="row carousel">
|
6
6
|
<div class="col-xs-1" ng-click="selectedIndex = (selectedIndex == 0) ? (components.length - 1) : (selectedIndex - 1)"><span><</span></div>
|
7
7
|
<div class="col-xs-8" ng-repeat="component in components" ng-show="$index == selectedIndex">
|
8
8
|
<ng-include src="'promethee/move/component'"></ng-include>
|
@@ -2,14 +2,21 @@
|
|
2
2
|
init = <<~JAVASCRIPT
|
3
3
|
promethee.definitions.push({
|
4
4
|
name: 'Slider Item',
|
5
|
-
icon: #{ promethee_component_render_icon '
|
5
|
+
icon: #{ promethee_component_render_icon 'slider_item' },
|
6
6
|
position: 15,
|
7
7
|
library: false,
|
8
8
|
data: {
|
9
9
|
type: 'slider_item',
|
10
10
|
attributes: {
|
11
|
-
|
12
|
-
|
11
|
+
searchable_caption: "",
|
12
|
+
media_type: "image",
|
13
|
+
image: {
|
14
|
+
id: undefined,
|
15
|
+
name: ""
|
16
|
+
},
|
17
|
+
video: {
|
18
|
+
url: "https://vimeo.com/115082758"
|
19
|
+
}
|
13
20
|
}
|
14
21
|
}
|
15
22
|
})
|
@@ -1,52 +1,25 @@
|
|
1
1
|
<script type="text/ng-template" id="promethee/components/slider_item/edit/inspect">
|
2
|
-
<div
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
</
|
7
|
-
<div class="col-xs-3">
|
8
|
-
<ng-include src="'promethee/move/component'"></ng-include>
|
9
|
-
</div>
|
2
|
+
<div class="form-group">
|
3
|
+
<label class="label-control">Media type</label>
|
4
|
+
<div>
|
5
|
+
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.media_type" type="radio" value="image" />Image </label>
|
6
|
+
<label class="radio-inline"> <input ng-model="promethee.inspected.attributes.media_type" type="radio" value="video" />Video </label>
|
10
7
|
</div>
|
11
8
|
</div>
|
12
9
|
|
10
|
+
<promethee-uploader ng-show="promethee.inspected.attributes.media_type == 'image'" ng-model="promethee.inspected.attributes.image" label="Image" limits="'.jpg,.jpeg,.png,.gif'"></promethee-uploader>
|
11
|
+
|
12
|
+
<div class="form-group" ng-show="promethee.inspected.attributes.media_type == 'video'">
|
13
|
+
<label class="label-control">Video URL</label>
|
14
|
+
<input class="form-control" ng-model="promethee.inspected.attributes.video.url"></summernote>
|
15
|
+
</div>
|
16
|
+
|
13
17
|
<div class="row">
|
14
18
|
<div class="col-xs-12">
|
15
19
|
<div class="form-group">
|
16
|
-
<label class="label-control">
|
17
|
-
<summernote config="summernoteConfig" ng-model="promethee.inspected.attributes.
|
20
|
+
<label class="label-control">Caption</label>
|
21
|
+
<summernote config="summernoteConfig" ng-model="promethee.inspected.attributes.searchable_caption"></summernote>
|
18
22
|
</div>
|
19
23
|
</div>
|
20
24
|
</div>
|
21
|
-
|
22
|
-
<div class="pull-right btn-toolbar" ng-controller="SliderItemInspectorController">
|
23
|
-
<span ng-show="promethee.inspected.attributes.media.type === undefined" ng-repeat="definition in itemDefinitions" class="btn btn-default" ng-click="setMedia(definition)">Set {{definition.name}}</span>
|
24
|
-
<span ng-show="promethee.inspected.attributes.media.type !== undefined" class="btn btn-danger" ng-click="removeMedia()">Remove Media</span>
|
25
|
-
</div>
|
26
|
-
</script>
|
27
|
-
|
28
|
-
<script>
|
29
|
-
promethee.controller('SliderItemInspectorController', ['$scope', function($scope) {
|
30
|
-
var availableComponents = ['image', 'video'];
|
31
|
-
|
32
|
-
$scope.itemDefinitions = $scope.promethee.definitions.filter(function(definition) {
|
33
|
-
return availableComponents.includes(definition.data.type);
|
34
|
-
});
|
35
|
-
|
36
|
-
$scope.setMedia = function(definition) {
|
37
|
-
var media = JSON.parse(JSON.stringify(definition.data));
|
38
|
-
$scope.promethee.inspected.attributes.media = media;
|
39
|
-
};
|
40
|
-
|
41
|
-
$scope.removeMedia = function() {
|
42
|
-
$scope.promethee.inspected.attributes.media = {};
|
43
|
-
};
|
44
|
-
}])
|
45
|
-
|
46
|
-
promethee.controller('SliderItemMediaInspectorController', ['$scope', function($scope) {
|
47
|
-
$scope.component = $scope.promethee.inspected.attributes.media;
|
48
|
-
$scope.$watch("promethee.inspected", function() {
|
49
|
-
$scope.component = $scope.promethee.inspected.attributes.media;
|
50
|
-
})
|
51
|
-
}])
|
52
25
|
</script>
|
@@ -2,13 +2,45 @@
|
|
2
2
|
<%= render 'promethee/edit/move.header', type: 'slider_item' %>
|
3
3
|
<div class="header">Slider Item</div>
|
4
4
|
<div class="row">
|
5
|
-
<div class="col-xs-12"
|
6
|
-
<
|
7
|
-
|
5
|
+
<div class="col-xs-12">
|
6
|
+
<img ng-show="component.attributes.media_type == 'image'" ng-src="/promethee/blob/{{component.attributes.image.id}}" class="img-responsive">
|
7
|
+
<div ng-show="component.attributes.media_type == 'video'" ng-controller="SliderItemVideoController">
|
8
|
+
<div class="embed-responsive embed-responsive-16by9">
|
9
|
+
<iframe ng-if="embed" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" ng-src="{{embed | urlSafe}}"></iframe>
|
10
|
+
<div class="video-neutralizing-overlay"></div>
|
11
|
+
</div>
|
8
12
|
</div>
|
9
13
|
</div>
|
10
|
-
|
14
|
+
</div>
|
15
|
+
<div class="row">
|
16
|
+
<div class="col-xs-12 slider-item-caption" ng-show="component.attributes.searchable_caption !== ''">Caption</div>
|
11
17
|
</div>
|
12
18
|
</div>
|
13
19
|
</div>
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script>
|
23
|
+
promethee.controller('SliderItemVideoController', ['$scope', function($scope) {
|
24
|
+
Object.defineProperty($scope, 'embed', {
|
25
|
+
get: function() {
|
26
|
+
var embed = null;
|
27
|
+
var url = this.component.attributes.video.url + '';
|
28
|
+
|
29
|
+
if(url.includes('vimeo')) {
|
30
|
+
var id = url.replace(/^(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?$/, '$1');
|
31
|
+
embed = 'https://player.vimeo.com/video/' + id + '?color=ffffff&title=0&byline=0&portrait=0';
|
32
|
+
}
|
33
|
+
else if(url.includes('youtube')) {
|
34
|
+
var parts = url.split('watch?v=');
|
35
|
+
var id = parts[parts.length - 1];
|
36
|
+
embed = 'https://www.youtube.com/embed/' + id;
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
var embed = url;
|
40
|
+
}
|
41
|
+
|
42
|
+
return embed;
|
43
|
+
}
|
44
|
+
})
|
45
|
+
}]);
|
14
46
|
</script>
|
@@ -1,3 +1 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
2
|
-
<path fill="#FFF" d="M30.3,35.9 L30.3,64.4 L70.9,64.4 L70.9,35.9 L30.3,35.9 Z M71.9,34.9 L71.9,65.4 L29.3,65.4 L29.3,34.9 L71.9,34.9 Z M75,32 L75,68.2 L26.1,68.2 L26.1,32 L75,32 Z M73,34 L28.1,34 L28.1,66.2 L73,66.2 L73,34 Z M90,37.7 L77,37.7 L77,35.7 L92,35.7 L92,64.5 L77,64.5 L77,62.5 L90,62.5 L90,37.7 Z M11,62.5 L24,62.5 L24,64.5 L9,64.5 L9,35.7 L24,35.7 L24,37.7 L11,37.7 L11,62.5 Z"/>
|
3
|
-
</svg>
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"></svg>
|
@@ -3,12 +3,12 @@
|
|
3
3
|
<hr>
|
4
4
|
<div class="row">
|
5
5
|
<div class="col-md-6">
|
6
|
-
<b>
|
7
|
-
<div class="promethee-edit__wrapper" ng-bind-html="component.master.attributes.
|
6
|
+
<b>Slider Item Caption</b>
|
7
|
+
<div class="promethee-edit__wrapper" ng-bind-html="component.master.attributes.searchable_caption | htmlSafe"></div>
|
8
8
|
</div>
|
9
9
|
<div class="col-md-6">
|
10
|
-
<label class="label-control">
|
11
|
-
<summernote config="summernoteConfig" ng-model="component.attributes.
|
10
|
+
<label class="label-control">Slider Item Caption</label>
|
11
|
+
<summernote config="summernoteConfig" ng-model="component.attributes.searchable_caption"></summernote>
|
12
12
|
</div>
|
13
13
|
</div>
|
14
14
|
</div>
|
@@ -1,5 +1,32 @@
|
|
1
|
-
<%
|
1
|
+
<%
|
2
|
+
media_type = component[:attributes][:media_type]
|
3
|
+
case media_type
|
4
|
+
when 'image'
|
5
|
+
image_data = component[:attributes][:image]
|
6
|
+
if image_data && image_data[:id]
|
7
|
+
image_blob = ActiveStorage::Blob.find image_data[:id]
|
8
|
+
end
|
9
|
+
when 'video'
|
10
|
+
url = component[:attributes][:video][:url].to_s
|
11
|
+
if 'vimeo'.in? url
|
12
|
+
video_id = url.gsub(/\A(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?\z/, '\1')
|
13
|
+
iframe_src = "https://player.vimeo.com/video/#{video_id}?color=ffffff&title=0&byline=0&portrait=0"
|
14
|
+
elsif 'youtube'.in? url
|
15
|
+
video_id = url.split('watch?v=').last
|
16
|
+
iframe_src = "http://www.youtube.com/embed/#{video_id}"
|
17
|
+
else
|
18
|
+
iframe_src = url
|
19
|
+
end
|
20
|
+
end
|
21
|
+
%>
|
2
22
|
<div class="carousel-item__content">
|
3
|
-
|
4
|
-
|
23
|
+
|
24
|
+
<% if iframe_src.present? %>
|
25
|
+
<div class="embed-responsive embed-responsive-16by9">
|
26
|
+
<iframe frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="allowfullscreen" src="<%= iframe_src %>"></iframe>
|
27
|
+
</div>
|
28
|
+
<% elsif image_blob.present? %>
|
29
|
+
<%= render 'promethee/show/image.srcset', blob: image_blob, alt: '' %>
|
30
|
+
<% end %>
|
31
|
+
<%= component[:attributes][:searchable_caption].to_s.html_safe %>
|
5
32
|
</div>
|
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.6.
|
4
|
+
version: 1.6.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Dargelos
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2018-06-
|
16
|
+
date: 2018-06-19 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rails
|
@@ -196,6 +196,12 @@ files:
|
|
196
196
|
- app/views/promethee/components/collection/_icon.svg
|
197
197
|
- app/views/promethee/components/collection/_localize.html.erb
|
198
198
|
- app/views/promethee/components/collection/_show.html.erb
|
199
|
+
- app/views/promethee/components/collection_item/_edit.define.html.erb
|
200
|
+
- app/views/promethee/components/collection_item/_edit.inspect.html.erb
|
201
|
+
- app/views/promethee/components/collection_item/_edit.move.html.erb
|
202
|
+
- app/views/promethee/components/collection_item/_icon.svg
|
203
|
+
- app/views/promethee/components/collection_item/_localize.html.erb
|
204
|
+
- app/views/promethee/components/collection_item/_show.html.erb
|
199
205
|
- app/views/promethee/components/column/_edit.define.html.erb
|
200
206
|
- app/views/promethee/components/column/_edit.inspect.html.erb
|
201
207
|
- app/views/promethee/components/column/_edit.move.html.erb
|