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

Merge branch 'master' into kondor

This commit is contained in:
Martin Geno 2016-12-07 21:34:50 +01:00
commit e586619687
4 changed files with 55 additions and 5 deletions

View File

@ -20,13 +20,11 @@ angular.module('warehost')
} }
}) })
.state('app.host.signup', { .state('app.host.signup', {
url:'/', url:'/signup',
views:{ views:{
'@app':{ '@app':{
templateUrl: 'app/home.html', templateUrl: 'app/host/signup.html',
controller:function(alert){ controller:'SignupHostCtrl'
alert.set({});
}
} }
} }
}) })

View File

@ -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

36
public/app/host/signup.js Normal file
View File

@ -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();
});

View File

@ -66,6 +66,7 @@
<script src="app/host/index.js"></script> <script src="app/host/index.js"></script>
<script src="app/host/mail.js"></script> <script src="app/host/mail.js"></script>
<script src="app/host/menu.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/host/web.js"></script>
<script src="app/index.js"></script> <script src="app/index.js"></script>
<script src="app/invite.js"></script> <script src="app/invite.js"></script>