sum7/warehost-frontend
sum7
/
warehost-frontend
Archived
1
0
Fork 0

[web] menu fertig?

This commit is contained in:
Martin Geno 2016-09-18 17:03:12 +02:00
parent 7f94fc78be
commit 85feebfc7e
2 changed files with 8 additions and 5 deletions

View File

@ -8,7 +8,7 @@ script#nodes_renderer(type="text/ng-template")
span.glyphicon.glyphicon-plus span.glyphicon.glyphicon-plus
a.btn.btn-default(data-nodrag,ng-click="edit(this)") a.btn.btn-default(data-nodrag,ng-click="edit(this)")
span.glyphicon.glyphicon-pencil span.glyphicon.glyphicon-pencil
a.btn.btn-default(data-nodrag,ng-click="remove(this)") a.btn.btn-default(data-nodrag,ng-click="delete(this)")
span.glyphicon.glyphicon-remove span.glyphicon.glyphicon-remove
.list-group(ui-tree-nodes,ng-model="node.children",ng-class="{hidden: collapsed}") .list-group(ui-tree-nodes,ng-model="node.children",ng-class="{hidden: collapsed}")
.list-group-item(ui-tree-node,ng-repeat="node in node.children",ng-include="'nodes_renderer'") .list-group-item(ui-tree-node,ng-repeat="node in node.children",ng-include="'nodes_renderer'")
@ -41,4 +41,4 @@ script#nodes_renderer(type="text/ng-template")
label(for="shortUrl") URL label(for="shortUrl") URL
i (http(s)://PLACEHOLDER/{{obj.url}}) i (http(s)://PLACEHOLDER/{{obj.url}})
input.form-control(id="shortUrl",ng-model="obj.url") input.form-control(id="shortUrl",ng-model="obj.url")
submit.btn.btn-default Save input.btn.btn-default(type="submit",value="Save")

View File

@ -49,16 +49,19 @@ angular.module('warehost')
if($scope.obj.ID){ if($scope.obj.ID){
$http.put(config.api+'/web/website/'+$stateParams.websiteid+'/menu/'+$scope.obj.ID,$scope.obj).then(submitresult); $http.put(config.api+'/web/website/'+$stateParams.websiteid+'/menu/'+$scope.obj.ID,$scope.obj).then(submitresult);
}else{ }else{
$http.post(config.api+'/web/website'+$stateParams.websiteid+'/menu/',$scope.obj).then(submitresult); $http.post(config.api+'/web/website/'+$stateParams.websiteid+'/menu',$scope.obj).then(submitresult);
} }
}; };
$scope.delete = function(a){ $scope.delete = function(a){
$http.delete(config.api+'/web/website/'+$stateParams.websiteid+'/menu/'+a.website.ID).then(submitresult); $http.delete(config.api+'/web/website/'+$stateParams.websiteid+'/menu/'+a.$modelValue.ID).then(submitresult);
}; };
$scope.add = function(a){ $scope.add = function(a){
$scope.obj = {}; $scope.obj = {};
if(a){ if(a){
$scope.obj.parentid = a.$modelValue.ID; $scope.obj.parentid = {
Int64: a.$modelValue.ID,
Valid: true
};
$scope.parent = a.$modelValue; $scope.parent = a.$modelValue;
}else{ }else{
$scope.parent = null; $scope.parent = null;