mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
#23: Edit tag parent
This commit is contained in:
parent
99a596b2e1
commit
80bd11b44e
@ -121,7 +121,9 @@ public class TagResource extends BaseResource {
|
||||
}
|
||||
|
||||
// Check the parent
|
||||
if (parentId != null) {
|
||||
if (StringUtils.isEmpty(parentId)) {
|
||||
parentId = null;
|
||||
} else {
|
||||
Tag parentTag = tagDao.getByTagId(principal.getId(), parentId);
|
||||
if (parentTag == null) {
|
||||
throw new ClientException("ParentNotFound", MessageFormat.format("Parent not found: {0}", parentId));
|
||||
@ -175,7 +177,9 @@ public class TagResource extends BaseResource {
|
||||
}
|
||||
|
||||
// Check the parent
|
||||
if (parentId != null) {
|
||||
if (StringUtils.isEmpty(parentId)) {
|
||||
parentId = null;
|
||||
} else {
|
||||
Tag parentTag = tagDao.getByTagId(principal.getId(), parentId);
|
||||
if (parentTag == null) {
|
||||
throw new ClientException("ParentNotFound", MessageFormat.format("Parent not found: {0}", parentId));
|
||||
|
@ -21,6 +21,15 @@
|
||||
<tbody>
|
||||
<tr ng-repeat="tag in tags | filter:search">
|
||||
<td><inline-edit value="tag.name" on-edit="updateTag(tag)" /></td>
|
||||
<td class="col-xs-4">
|
||||
<select class="form-control" ng-model="tag.parent" ng-change="updateTag(tag)">
|
||||
<option value="" ng-selected="!tag.parent"></option>
|
||||
<option ng-repeat="tag0 in tags"
|
||||
ng-if="tag0.id != tag.id"
|
||||
ng-selected="tag.parent == tag0.id"
|
||||
value="{{ tag0.id }}">Parent: {{ tag0.name }}</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="col-xs-1"><span colorpicker class="btn" on-hide="updateTag(tag)" data-color="" ng-model="tag.color" ng-style="{ 'background': tag.color }"> </span></td>
|
||||
<td class="col-xs-1"><button class="btn btn-danger pull-right" ng-click="deleteTag(tag)"><span class="glyphicon glyphicon-trash"></span></button></td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user