mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
#176: show children tag
This commit is contained in:
parent
2b6a14a348
commit
740476460f
@ -28,11 +28,6 @@ public class TagCriteria {
|
|||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
|
||||||
* Approximate tag name.
|
|
||||||
*/
|
|
||||||
private String nameLike;
|
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -236,6 +236,9 @@ angular.module('docs').controller('Document', function ($scope, $rootScope, $tim
|
|||||||
|
|
||||||
Restangular.one('tag/list').get().then(function (data) {
|
Restangular.one('tag/list').get().then(function (data) {
|
||||||
$scope.tags = data.tags;
|
$scope.tags = data.tags;
|
||||||
|
_.each($scope.tags, function (tag) {
|
||||||
|
tag.children = _.where($scope.tags, { parent: tag.id });
|
||||||
|
});
|
||||||
$scope.extractNavigatedTag();
|
$scope.extractNavigatedTag();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -319,4 +322,13 @@ angular.module('docs').controller('Document', function ($scope, $rootScope, $tim
|
|||||||
$scope.navigationEnabled = !$scope.navigationEnabled;
|
$scope.navigationEnabled = !$scope.navigationEnabled;
|
||||||
localStorage.navigationEnabled = $scope.navigationEnabled;
|
localStorage.navigationEnabled = $scope.navigationEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.getTagChildrenShort = function (tag) {
|
||||||
|
var children = tag.children;
|
||||||
|
if (children.length > 2) {
|
||||||
|
children = children.slice(0, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _.pluck(children, 'name').join(', ') + (tag.children.length > 2 ? '...' : '');
|
||||||
|
};
|
||||||
});
|
});
|
@ -155,7 +155,13 @@
|
|||||||
<!-- Current folder -->
|
<!-- Current folder -->
|
||||||
<table class="row table table-hover table-navigation" ng-show="navigationEnabled">
|
<table class="row table table-hover table-navigation" ng-show="navigationEnabled">
|
||||||
<tr ng-repeat="tag in tags | filter: navigatedFilter: navigatedComparator" ng-click="navigateToTag(tag)">
|
<tr ng-repeat="tag in tags | filter: navigatedFilter: navigatedComparator" ng-click="navigateToTag(tag)">
|
||||||
<td colspan="2"><span class="fas fa-tags" ng-style="{ color: tag.color }"></span> {{ tag.name }}</td>
|
<td class="tree-structure">
|
||||||
|
<div class="tree-line"></div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="fas fa-tags" ng-style="{ color: tag.color }"></span> {{ tag.name }}
|
||||||
|
<span class="text-muted small">{{ getTagChildrenShort(tag) }}</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -36,12 +36,34 @@
|
|||||||
|
|
||||||
// Navigation
|
// Navigation
|
||||||
.table-navigation {
|
.table-navigation {
|
||||||
|
margin-left: 22px !important;
|
||||||
|
|
||||||
tr {
|
tr {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
td {
|
td {
|
||||||
border: none !important;
|
border: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
td.tree-structure {
|
||||||
|
padding: 0;
|
||||||
|
width: 1em;
|
||||||
|
border-left: 1px solid #aaa !important;
|
||||||
|
|
||||||
|
.tree-line {
|
||||||
|
border-bottom: 1px solid #aaa !important;
|
||||||
|
border-left: 1px solid #aaa;
|
||||||
|
margin-left: -1px;
|
||||||
|
width: 100%;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
td.tree-structure {
|
||||||
|
border-left: 1px solid transparent !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user