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

Commit

Permalink
Merge tag '2.26.0' into geotrek_UX_dev_mid_2018
Browse files Browse the repository at this point in the history
  • Loading branch information
LePetitTim committed Jul 16, 2020
2 parents 244392e + add8d7b commit a79fe6b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2.26.0-ux / 2020-07-16
===================

**Enhancements**

* Add google analytic for downloaded pdf, gpx, kml

2.25.0-ux / 2020-07-10
======================

Expand Down
2 changes: 1 addition & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geotrekrando",
"version": "2.25.0-ux",
"version": "2.26.0-ux",
"description": "Geotrek rando public portal of Geotrek",
"author": "Makina Corpus",
"main": "src/app/app.js",
Expand Down
23 changes: 22 additions & 1 deletion src/app/layout/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function LayoutController($rootScope, $scope, $state, $location, resultsService,
function SubHeaderController() {
}

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

$scope.webGLisEnable = webglService.isEnabled();

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

$scope.back = $rootScope.back;

$scope.gaDownloadGPX = function(item) {
if (globalSettings.GOOGLE_ANALYTICS_ID) {
Analytics.send('event', 'GPX', 'download', item.properties.slug);
}
$window.open(item.properties.gpx, "_self")
};

$scope.gaDownloadKML = function(item) {
if (globalSettings.GOOGLE_ANALYTICS_ID) {
Analytics.send('event', 'KML', 'download', item.properties.slug);
}
$window.open(item.properties.kml, "_self")
};

$scope.gaDownloadPDF = function(item) {
if (globalSettings.GOOGLE_ANALYTICS_ID) {
Analytics.send('event', 'PDF', 'download', item.properties.slug);
}
$window.open(item.properties.printable, "_blank")
};

getResultDetails(false);

}
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout/templates/sidebar-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</a>
</li>
<li class="toolbar-action print" ng-if="result.properties.printable">
<a class="toolbar-action-link" href="{{::result.properties.printable}}" target="_blank" tooltip-placement="bottom" tooltip="{{'PRINT' | translate}}">
<a class="toolbar-action-link" href ng-click="gaDownloadPDF(result)" tooltip-placement="bottom" tooltip="{{'PRINT' | translate}}">
<ng-include class="print-icon svg-icon" src="'/images/icons/print.svg'"></ng-include>
<span class="toolbar-action-label">{{'PRINT' | translate}}</span>
</a>
Expand All @@ -23,13 +23,13 @@
</a>
<ul class="dropdown-menu" role="menu">
<li class="toolbar-action kml" ng-if="result.properties.kml">
<a class="toolbar-action-link" href="{{::result.properties.kml}}" target="_self" tooltip-placement="bottom" tooltip="{{'KML' | translate}}">
<a class="toolbar-action-link" href ng-click="gaDownloadKML(result)" tooltip-placement="bottom" tooltip="{{'KML' | translate}}">
<span class="txt-icon">KML</span>
<span class="toolbar-action-label">{{'KML' | translate}}</span>
</a>
</li>
<li class="toolbar-action gpx" ng-if="result.properties.gpx">
<a class="toolbar-action-link" href="{{::result.properties.gpx}}" target="_self" tooltip-placement="bottom" tooltip="{{'GPX' | translate}}">
<a class="toolbar-action-link" href ng-click="gaDownloadGPX(result)" tooltip-placement="bottom" tooltip="{{'GPX' | translate}}">
<span class="txt-icon">GPX</span>
<span class="toolbar-action-label">{{'GPX' | translate}}</span>
</a>
Expand Down

0 comments on commit a79fe6b

Please sign in to comment.