Skip to content

Commit

Permalink
fixes #4885 all websites dashboard should use number sort again
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed May 5, 2014
1 parent a4b4f89 commit 4b6e77f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions plugins/MultiSites/angularjs/dashboard/dashboard-model.js
Expand Up @@ -93,6 +93,10 @@ angular.module('piwikApp').factory('multisitesDashboardModel', function (piwikAp
site.idsite = reportMetadata[index].idsite;
site.group = reportMetadata[index].group;
site.main_url = reportMetadata[index].main_url;
// casting evolution to int fixes sorting, see: http://dev.piwik.org/trac/ticket/4885
site.visits_evolution = parseInt(site.visits_evolution);
site.pageviews_evolution = parseInt(site.pageviews_evolution);
site.revenue_evolution = parseInt(site.revenue_evolution);

if (site.group) {

Expand Down
1 change: 0 additions & 1 deletion plugins/MultiSites/angularjs/site/site-directive.js
Expand Up @@ -35,7 +35,6 @@ angular.module('piwikApp').directive('piwikMultisitesSite', function($document,

$scope.period = piwik.period;
$scope.date = piwik.broadcast.getValueFromUrl('date');
$scope.parseInt = parseInt;

this.getWebsite = function () {
return $scope.website;
Expand Down
6 changes: 3 additions & 3 deletions plugins/MultiSites/angularjs/site/site.html
Expand Up @@ -22,9 +22,9 @@

<td ng-if="period != 'range'" style="width:170px;">
<div class="visits" ng-if="!website.isGroup">
<span ng-show="parseInt(website[evolutionMetric]) > 0"><img src="plugins/MultiSites/images/arrow_up.png" alt="" /> <span style="color: green;">{{ website[evolutionMetric] }}&nbsp;</span></span>
<span ng-show="parseInt(website[evolutionMetric]) == 0"><img src="plugins/MultiSites/images/stop.png" alt="" /> <span>{{ website[evolutionMetric] }}</span></span>
<span ng-show="parseInt(website[evolutionMetric]) < 0"><img src="plugins/MultiSites/images/arrow_down.png" alt="" /> <span style="color: red;">{{ website[evolutionMetric] }}&nbsp;</span></span>
<span ng-show="website[evolutionMetric] > 0"><img src="plugins/MultiSites/images/arrow_up.png" alt="" /> <span style="color: green;">{{ website[evolutionMetric] }}%&nbsp;</span></span>
<span ng-show="website[evolutionMetric] == 0"><img src="plugins/MultiSites/images/stop.png" alt="" /> <span>{{ website[evolutionMetric] }}%</span></span>
<span ng-show="website[evolutionMetric] < 0"><img src="plugins/MultiSites/images/arrow_down.png" alt="" /> <span style="color: red;">{{ website[evolutionMetric] }}%&nbsp;</span></span>
</div>
</td>

Expand Down

0 comments on commit 4b6e77f

Please sign in to comment.