Merge branch 'master' into kondor
This commit is contained in:
commit
e586619687
|
@ -20,13 +20,11 @@ angular.module('warehost')
|
|||
}
|
||||
})
|
||||
.state('app.host.signup', {
|
||||
url:'/',
|
||||
url:'/signup',
|
||||
views:{
|
||||
'@app':{
|
||||
templateUrl: 'app/home.html',
|
||||
controller:function(alert){
|
||||
alert.set({});
|
||||
}
|
||||
templateUrl: 'app/host/signup.html',
|
||||
controller:'SignupHostCtrl'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
.container
|
||||
h1 Hosting Signup
|
||||
.panel.panel-info
|
||||
.panel-heading AGB
|
||||
.panel-body
|
||||
.panel-footer(ng-if="!profil.ID && status")
|
||||
.checkbox
|
||||
label
|
||||
input(type="checkbox",ng-model="agb")
|
||||
| Accept AGB
|
||||
.btn.btn-default(type="submit",ng-click="signup()",ng-class="{'disabled':!agb}") Submit
|
||||
.panel-footer(ng-if="!profil.ID && !status")
|
||||
| You are not allow to signup Hosting
|
||||
.panel-footer(ng-if="profil.ID")
|
||||
| You have already signup
|
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('warehost')
|
||||
.controller('SignupHostCtrl',function(session,config,alert,$scope,$http){
|
||||
$scope.status = false;
|
||||
$scope.profil = {};
|
||||
$scope.agb = false;
|
||||
alert.set({});
|
||||
function load(){
|
||||
$http.get(config.api+'/host/profil').then(function(res){
|
||||
$scope.profil = res.data.data;
|
||||
$http.get(config.api+'/host/signup').then(function(res){
|
||||
session.set(res);
|
||||
alert.set(res);
|
||||
$scope.status = res.data.data;
|
||||
},function(res){
|
||||
session.set(res);
|
||||
alert.set(res);
|
||||
});
|
||||
});
|
||||
}
|
||||
$scope.signup = function(){
|
||||
if($scope.agb){
|
||||
$http.post(config.api+'/host/signup').then(function(res){
|
||||
session.set(res);
|
||||
alert.set(res);
|
||||
$scope.status = res.data.data;
|
||||
},function(res){
|
||||
session.set(res);
|
||||
alert.set(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
load();
|
||||
|
||||
});
|
|
@ -66,6 +66,7 @@
|
|||
<script src="app/host/index.js"></script>
|
||||
<script src="app/host/mail.js"></script>
|
||||
<script src="app/host/menu.js"></script>
|
||||
<script src="app/host/signup.js"></script>
|
||||
<script src="app/host/web.js"></script>
|
||||
<script src="app/index.js"></script>
|
||||
<script src="app/invite.js"></script>
|
||||
|
|
Reference in New Issue