Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Commit 46383df

Browse files
author
Gaël UTARD
committed
Merge tag '2.23.0' into geotrek_UX_dev_mid_2018
2 parents 6ac7ce0 + b59ca9d commit 46383df

21 files changed

+133
-32
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2.23.0-ux / 2020-03-05
2+
======================
3+
4+
**Enhancements**
5+
6+
* Show media on detail page
7+
18
2.22.1-ux / 2020-02-07
29
======================
310

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _See [Prerequisites](docs/README.md#Prerequisites)._
1212
- Geotrek-Rando v2 can synchronize only with Geotrek-Admin v2
1313
- Ubuntu 14.04
1414

15-
### Syncronization
15+
### Synchronization
1616

1717
_See [Synchronize data](docs/data-sync.md)._
1818

npm-shrinkwrap.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "geotrekrando",
3-
"version": "2.22.1-ux",
3+
"version": "2.23.0-ux",
44
"description": "Geotrek rando public portal of Geotrek",
55
"author": "Makina Corpus",
66
"main": "src/app/app.js",

src/app/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var dependencies = [
99
'rando.commons',
1010
'rando.treks',
1111
'rando.sensitive',
12+
'rando.media',
1213
'rando.pois',
1314
'rando.services',
1415
'rando.items',
@@ -101,6 +102,7 @@ require('./layout');
101102
require('./loader');
102103
require('./treks');
103104
require('./sensitive');
105+
require('./media');
104106
require('./pois');
105107
require('./services');
106108
require('./items-list');

src/app/detail/controllers.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ function DetailController($scope, $rootScope, $state, $q, $modal, $timeout, $sta
6868
});
6969
};
7070

71+
$scope.openPlayer = function openPlayer (media) {
72+
$modal.open({
73+
template: require('../media/templates/media-modal.html'),
74+
controller: 'MediaController',
75+
resolve: {
76+
media: function () {
77+
return media;
78+
}
79+
}
80+
});
81+
};
82+
7183
// function switchInterestsNodes() {
7284
// if (document.querySelector('.main-infos .interests') && window.matchMedia("(min-width: 769px)").matches) {
7385
// document.querySelector('.detail-map').appendChild(document.querySelector('.main-infos .interests'));
@@ -438,6 +450,7 @@ function DetailController($scope, $rootScope, $state, $q, $modal, $timeout, $sta
438450

439451
getInterests(result, forceRefresh);
440452
$rootScope.$emit('initGallery', result.properties.pictures);
453+
$rootScope.$emit('initMedia', result.properties.videos);
441454
$scope.result.informations = detailService.hasInfos(result.properties, 'duration_pretty', 'duration', 'difficulty.label', 'levels', 'route', 'ascent', 'depth', 'networks', 'target_audience');
442455
$rootScope.$emit('detailUpdated', forceRefresh);
443456
},
@@ -473,6 +486,7 @@ function DetailController($scope, $rootScope, $state, $q, $modal, $timeout, $sta
473486

474487
}
475488

489+
476490
module.exports = {
477491
DetailController: DetailController
478492
};

src/app/detail/directives.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ function detailContentPictures() {
3333
};
3434
}
3535

36+
function detailContentMedia() {
37+
return {
38+
restrict: 'E',
39+
replace: true,
40+
template: require('./templates/detail-content-media.html')
41+
};
42+
}
43+
3644
function detailContentElevation() {
3745
return {
3846
restrict: 'E',
@@ -94,6 +102,7 @@ module.exports = {
94102
detailContent: detailContent,
95103
detailContentMeta: detailContentMeta,
96104
detailContentPictures: detailContentPictures,
105+
detailContentMedia: detailContentMedia,
97106
detailContentFromTo: detailContentFromTo,
98107
detailContentEventsInfo: detailContentEventsInfo,
99108
detailContentElevation: detailContentElevation,

src/app/detail/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ angular.module('rando.detail', ['ui.bootstrap'])
66
.directive('detailContent', require('./directives').detailContent)
77
.directive('detailContentMeta', require('./directives').detailContentMeta)
88
.directive('detailContentPictures', require('./directives').detailContentPictures)
9+
.directive('detailContentMedia', require('./directives').detailContentMedia)
910
.directive('detailContentFromTo', require('./directives').detailContentFromTo)
1011
.directive('detailContentEventsInfo', require('./directives').detailContentEventsInfo)
1112
.directive('detailContentElevation', require('./directives').detailContentElevation)

src/app/detail/styles/_detail-content.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,16 @@
454454
}
455455
}
456456

457+
.detail-content-medias {
458+
margin: 1.5em 2rem 0 2rem;
459+
h3 {
460+
margin-bottom: .5em;
461+
}
462+
a {
463+
color: $secondary-color;
464+
}
465+
}
466+
457467
.detail-content-elevation {
458468

459469
margin: 1.5em 2rem 0 2rem;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<div class="medias detail-content-medias" ng-if="result.properties.videos[0]">
2+
<h3>Media</h3>
3+
<ul class="medias-liste">
4+
<li ng-repeat="media in result.properties.videos track by $index"
5+
class="detail-media media"
6+
ng-class="{video: media.backend === 'Youtube' || media.backend === 'Vimeo', audio: media.backend === 'SoundCloud'}">
7+
<a href class="detail-media-link primary-hover-c" ng-click="openPlayer(media)" title="{{::media.legend}}">
8+
<i ng-if="media.backend === 'Youtube' || media.backend === 'Vimeo'" class="fa fa-file-video-o"></i>
9+
<i ng-if="media.backend === 'SoundCloud'" class="fa fa-file-audio-o"></i>
10+
<span>{{::media.legend}}</span>
11+
</a>
12+
</li>
13+
<li ng-repeat="file in result.properties.files track by $index" class="detail-media media file">
14+
<a href="{{::file.url}}" title="{{::file.legend}}" class="detail-media-link primary-hover-c">
15+
<i class="fa fa-file-o"></i> {{::file.legend}}
16+
</a>
17+
</li>
18+
</ul>
19+
</div>

0 commit comments

Comments
 (0)