diff --git a/public/components/alert.js b/public/app/components/alert.js similarity index 100% rename from public/components/alert.js rename to public/app/components/alert.js diff --git a/public/app/components/config.js b/public/app/components/config.js new file mode 100644 index 0000000..181cfdc --- /dev/null +++ b/public/app/components/config.js @@ -0,0 +1,10 @@ +'use strict'; +angular.module('config', []) + .factory('config', function() { + return { + api: 'https://apiv2.warehost.de', + table: { + count: 25 + } + }; + }); diff --git a/public/components/ngfilter-boolean.jade b/public/app/components/ngfilter-boolean.jade similarity index 100% rename from public/components/ngfilter-boolean.jade rename to public/app/components/ngfilter-boolean.jade diff --git a/public/components/session.js b/public/app/components/session.js similarity index 100% rename from public/components/session.js rename to public/app/components/session.js diff --git a/public/app/web/list.js b/public/app/web/list.js index 49dd033..41da1d6 100644 --- a/public/app/web/list.js +++ b/public/app/web/list.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('warehost') - .controller('ListWebCtrl',function(session,config,alert,NgTableParams,$scope,$rootScope,$http,$stateParams){ + .controller('ListWebCtrl',function(session,config,alert,NgTableParams,$scope,$rootScope,$http){ $scope.tableParams = new NgTableParams({ sorting: { 'invited.username': 'asc' }, total: 0, diff --git a/public/app/web/menu.js b/public/app/web/menu.js index 9e1e604..d913f26 100644 --- a/public/app/web/menu.js +++ b/public/app/web/menu.js @@ -9,10 +9,10 @@ angular.module('warehost') $http.get(config.api+'/web/involve').then(function(res){ session.set(res); alert.set(res); - $scope.list = res.data.data + $scope.list = res.data.data; for(var key in res.data.data){ var item = res.data.data[key]; - if(item.website.ID == $stateParams.websiteid){ + if(item.website.ID === $stateParams.websiteid){ $scope.website = item.website; } } @@ -21,7 +21,7 @@ angular.module('warehost') load(); $rootScope.$on('warehost.web.website.update',load); $scope.add = function(){ - $http.post(config.api+'/web/website',{name:prompt("Name:")}).then(function(res){ + $http.post(config.api+'/web/website',{name:window.prompt('Name:')}).then(function(res){ session.set(res); $rootScope.$broadcast('warehost.web.website.update'); }); diff --git a/public/index.html b/public/index.html index 54941f2..cfbe0e7 100644 --- a/public/index.html +++ b/public/index.html @@ -48,6 +48,9 @@ + + + @@ -56,9 +59,6 @@ - - -