Tag stats design

This commit is contained in:
jendib 2013-08-04 17:15:52 +02:00
parent b5201b5bde
commit b5e3598b48
3 changed files with 13 additions and 3 deletions

View File

@ -1 +1,2 @@
- Users administration (client)
- Users administration (client)
- Tag color (client/server)

View File

@ -14,6 +14,15 @@ App.controller('Tag', function($scope, $dialog, $state, Tag, Restangular) {
$scope.stats = data.stats;
})
/**
* Returns total number of document from tag stats.
*/
$scope.getStatCount = function() {
return _.reduce($scope.stats, function(memo, stat) {
return memo + stat.count
}, 0);
};
/**
* Add a tag.
*/

View File

@ -27,8 +27,8 @@
<div class="span8 well">
<h1>{{ tags.length }} <small>tag{{ tags.length > 1 ? 's' : '' }}</small></h1>
<dl class="dl-horizontal" ng-repeat="stat in stats | orderBy: '-count'">
<dt>{{ stat.name }}</dt>
<dd><progress percent="stat.count / tags.length * 100" class="progress-info"></progress></dd>
<dt>{{ stat.name }} <span class="badge badge-info">{{ stat.count }}</span></dt>
<dd><progress percent="stat.count / getStatCount() * 100" class="progress-info"></progress></dd>
</dl>
</div>
</div>