mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 07:07:57 +01:00
Tag stats (client)
This commit is contained in:
parent
97fa6b10f7
commit
0ab480165c
@ -113,10 +113,10 @@ public class TagDao {
|
||||
public List<TagStatDto> getStats(String userId) {
|
||||
EntityManager em = ThreadLocalContext.get().getEntityManager();
|
||||
StringBuilder sb = new StringBuilder("select t.TAG_ID_C, t.TAG_NAME_C, count(d.DOC_ID_C) ");
|
||||
sb.append(" from T_DOCUMENT_TAG dt ");
|
||||
sb.append(" join T_TAG t on t.TAG_ID_C = dt.DOT_IDTAG_C ");
|
||||
sb.append(" join T_DOCUMENT d on d.DOC_ID_C = dt.DOT_IDDOCUMENT_C ");
|
||||
sb.append(" where d.DOC_IDUSER_C = :userId and t.TAG_DELETEDATE_D is null and d.DOC_DELETEDATE_D is null ");
|
||||
sb.append(" from T_TAG t ");
|
||||
sb.append(" left join T_DOCUMENT_TAG dt on t.TAG_ID_C = dt.DOT_IDTAG_C ");
|
||||
sb.append(" left join T_DOCUMENT d on d.DOC_ID_C = dt.DOT_IDDOCUMENT_C and d.DOC_DELETEDATE_D is null and d.DOC_IDUSER_C = :userId ");
|
||||
sb.append(" where t.TAG_DELETEDATE_D is null ");
|
||||
sb.append(" group by t.TAG_ID_C ");
|
||||
|
||||
// Perform the query
|
||||
|
@ -1,2 +1 @@
|
||||
- Tag stats (client)
|
||||
- Users administration (client)
|
@ -9,6 +9,11 @@ App.controller('Tag', function($scope, $dialog, $state, Tag, Restangular) {
|
||||
$scope.tags = data.tags;
|
||||
});
|
||||
|
||||
// Retrieve tag stats
|
||||
Restangular.one('tag/stats').get().then(function(data) {
|
||||
$scope.stats = data.stats;
|
||||
})
|
||||
|
||||
/**
|
||||
* Add a tag.
|
||||
*/
|
||||
|
@ -2,18 +2,16 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span4 well text-center">
|
||||
|
||||
<p class="input-prepend input-append">
|
||||
<div class="input-prepend input-append input-block-level">
|
||||
<span class="add-on"><span class="icon-plus"></span></span>
|
||||
<input type="text" placeholder="Tag name" ng-model="tag.name" ui-keyup="{'enter':'addTag()'}">
|
||||
<button type="submit" class="btn btn-primary" ng-click="addTag()">Add</button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h1>{{ tags.length }} <small>Tags</small></h1>
|
||||
|
||||
<p class="input-prepend">
|
||||
<div class="input-prepend input-block-level">
|
||||
<span class="add-on"><span class="icon-search"></span></span>
|
||||
<input type="text" placeholder="Search" ng-model="search.name">
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-hover table-tags">
|
||||
<tbody>
|
||||
@ -25,5 +23,13 @@
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user