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