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

Commit a79fe6b

Browse files
committed
Merge tag '2.26.0' into geotrek_UX_dev_mid_2018
2 parents 244392e + add8d7b commit a79fe6b

File tree

5 files changed

+34
-6
lines changed

5 files changed

+34
-6
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2.26.0-ux / 2020-07-16
2+
===================
3+
4+
**Enhancements**
5+
6+
* Add google analytic for downloaded pdf, gpx, kml
7+
18
2.25.0-ux / 2020-07-10
29
======================
310

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.25.0-ux",
3+
"version": "2.26.0-ux",
44
"description": "Geotrek rando public portal of Geotrek",
55
"author": "Makina Corpus",
66
"main": "src/app/app.js",

src/app/layout/controllers.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function LayoutController($rootScope, $scope, $state, $location, resultsService,
181181
function SubHeaderController() {
182182
}
183183

184-
function SidebarDetailController($scope, $rootScope, $modal, $stateParams, $location, globalSettings, resultsService, favoritesService, webglService) {
184+
function SidebarDetailController($scope, $window, $rootScope, $modal, $stateParams, $location, globalSettings, resultsService, favoritesService, webglService, Analytics) {
185185

186186
$scope.webGLisEnable = webglService.isEnabled();
187187

@@ -227,6 +227,27 @@ function SidebarDetailController($scope, $rootScope, $modal, $stateParams, $loca
227227

228228
$scope.back = $rootScope.back;
229229

230+
$scope.gaDownloadGPX = function(item) {
231+
if (globalSettings.GOOGLE_ANALYTICS_ID) {
232+
Analytics.send('event', 'GPX', 'download', item.properties.slug);
233+
}
234+
$window.open(item.properties.gpx, "_self")
235+
};
236+
237+
$scope.gaDownloadKML = function(item) {
238+
if (globalSettings.GOOGLE_ANALYTICS_ID) {
239+
Analytics.send('event', 'KML', 'download', item.properties.slug);
240+
}
241+
$window.open(item.properties.kml, "_self")
242+
};
243+
244+
$scope.gaDownloadPDF = function(item) {
245+
if (globalSettings.GOOGLE_ANALYTICS_ID) {
246+
Analytics.send('event', 'PDF', 'download', item.properties.slug);
247+
}
248+
$window.open(item.properties.printable, "_blank")
249+
};
250+
230251
getResultDetails(false);
231252

232253
}

src/app/layout/templates/sidebar-detail.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</a>
1313
</li>
1414
<li class="toolbar-action print" ng-if="result.properties.printable">
15-
<a class="toolbar-action-link" href="{{::result.properties.printable}}" target="_blank" tooltip-placement="bottom" tooltip="{{'PRINT' | translate}}">
15+
<a class="toolbar-action-link" href ng-click="gaDownloadPDF(result)" tooltip-placement="bottom" tooltip="{{'PRINT' | translate}}">
1616
<ng-include class="print-icon svg-icon" src="'/images/icons/print.svg'"></ng-include>
1717
<span class="toolbar-action-label">{{'PRINT' | translate}}</span>
1818
</a>
@@ -23,13 +23,13 @@
2323
</a>
2424
<ul class="dropdown-menu" role="menu">
2525
<li class="toolbar-action kml" ng-if="result.properties.kml">
26-
<a class="toolbar-action-link" href="{{::result.properties.kml}}" target="_self" tooltip-placement="bottom" tooltip="{{'KML' | translate}}">
26+
<a class="toolbar-action-link" href ng-click="gaDownloadKML(result)" tooltip-placement="bottom" tooltip="{{'KML' | translate}}">
2727
<span class="txt-icon">KML</span>
2828
<span class="toolbar-action-label">{{'KML' | translate}}</span>
2929
</a>
3030
</li>
3131
<li class="toolbar-action gpx" ng-if="result.properties.gpx">
32-
<a class="toolbar-action-link" href="{{::result.properties.gpx}}" target="_self" tooltip-placement="bottom" tooltip="{{'GPX' | translate}}">
32+
<a class="toolbar-action-link" href ng-click="gaDownloadGPX(result)" tooltip-placement="bottom" tooltip="{{'GPX' | translate}}">
3333
<span class="txt-icon">GPX</span>
3434
<span class="toolbar-action-label">{{'GPX' | translate}}</span>
3535
</a>

0 commit comments

Comments
 (0)