mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +01:00
Tag stats design
This commit is contained in:
parent
b5201b5bde
commit
b5e3598b48
@ -1 +1,2 @@
|
|||||||
- Users administration (client)
|
- Users administration (client)
|
||||||
|
- Tag color (client/server)
|
@ -14,6 +14,15 @@ App.controller('Tag', function($scope, $dialog, $state, Tag, Restangular) {
|
|||||||
$scope.stats = data.stats;
|
$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.
|
* Add a tag.
|
||||||
*/
|
*/
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
<div class="span8 well">
|
<div class="span8 well">
|
||||||
<h1>{{ tags.length }} <small>tag{{ tags.length > 1 ? 's' : '' }}</small></h1>
|
<h1>{{ tags.length }} <small>tag{{ tags.length > 1 ? 's' : '' }}</small></h1>
|
||||||
<dl class="dl-horizontal" ng-repeat="stat in stats | orderBy: '-count'">
|
<dl class="dl-horizontal" ng-repeat="stat in stats | orderBy: '-count'">
|
||||||
<dt>{{ stat.name }}</dt>
|
<dt>{{ stat.name }} <span class="badge badge-info">{{ stat.count }}</span></dt>
|
||||||
<dd><progress percent="stat.count / tags.length * 100" class="progress-info"></progress></dd>
|
<dd><progress percent="stat.count / getStatCount() * 100" class="progress-info"></progress></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user