add modules as App
This commit is contained in:
parent
044bfd7eca
commit
a8a9d46c8b
|
@ -0,0 +1,22 @@
|
||||||
|
'use strict';
|
||||||
|
angular.module('warehost')
|
||||||
|
.config(['$stateProvider',function ($stateProvider) {
|
||||||
|
$stateProvider
|
||||||
|
.state('app.host', {
|
||||||
|
url:'/host',
|
||||||
|
views:{
|
||||||
|
'menu':{templateUrl:'app/host/menu.html'}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('app.host.index', {
|
||||||
|
url:'/',
|
||||||
|
views:{
|
||||||
|
'@app':{
|
||||||
|
templateUrl: 'app/home.html',
|
||||||
|
controller:function(alert){
|
||||||
|
alert.set({});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}]);
|
|
@ -0,0 +1,2 @@
|
||||||
|
li
|
||||||
|
a(ui-sref="app.host.index",ui-sref-active="active") Home
|
|
@ -10,27 +10,42 @@
|
||||||
span.icon-bar
|
span.icon-bar
|
||||||
span.icon-bar
|
span.icon-bar
|
||||||
.navbar-collapse.collapse(uib-collapse="!isOpen")
|
.navbar-collapse.collapse(uib-collapse="!isOpen")
|
||||||
ui.nav.navbar-nav
|
ui.nav.navbar-nav(ui-view="menu")
|
||||||
li(ng-if="session.profil.shift",ui-sref="app.shift.index",ng-class="{ active: $state.includes('app.shift') }")
|
|
||||||
a(nav navbar-nav) Shift
|
|
||||||
li(ng-if="session.profil.host",ui-sref="app.host.index",ng-class="{ active: $state.includes('app.host') }")
|
|
||||||
a(nav navbar-nav) Hosting
|
|
||||||
ui.nav.navbar-nav.navbar-right(ng-if="session.login.active")
|
ui.nav.navbar-nav.navbar-right(ng-if="session.login.active")
|
||||||
li
|
li.dropdown(ng-if="modules.length>0")
|
||||||
a(ui-sref="app.L.invites",ui-sref-active="active")
|
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false")
|
||||||
span.glyphicon.glyphicon-send
|
span.glyphicon.glyphicon-th-large
|
||||||
| Invites
|
| Apps
|
||||||
li(ng-if="session.login.superadmin")
|
span.caret
|
||||||
a(ui-sref="app.A.admin",ui-sref-active="active")
|
ul.dropdown-menu
|
||||||
span.glyphicon.glyphicon-cog
|
li(ng-if="modules.indexOf('web')>-1",ui-sref="app.web.index")
|
||||||
| Admin
|
a(nav navbar-nav) Websites
|
||||||
.navbar-text(ng-class="{ 'active': $state.includes('app.L.settings') }")
|
li(ng-if="modules.indexOf('host')>-1",ui-sref="app.host.index")
|
||||||
| Welcome
|
a(nav navbar-nav) Hosting
|
||||||
a(ui-sref="app.L.settings",ui-sref-active="active") {{session.login.username}}
|
li(ng-if="modules.indexOf('test')>-1")
|
||||||
|
|
a(nav navbar-nav) Testing
|
||||||
span.glyphicon.glyphicon-user
|
li.dropdown
|
||||||
.navbar-text
|
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false")
|
||||||
span.glyphicon.glyphicon-log-out(ng-click="logout()")
|
span.glyphicon.glyphicon-user
|
||||||
|
| {{session.login.username}}
|
||||||
|
span.caret
|
||||||
|
ul.dropdown-menu
|
||||||
|
li
|
||||||
|
a(ui-sref="app.L.invites",ui-sref-active="active")
|
||||||
|
span.glyphicon.glyphicon-send
|
||||||
|
| Invites
|
||||||
|
li(ng-if="session.login.superadmin")
|
||||||
|
a(ui-sref="app.A.admin",ui-sref-active="active")
|
||||||
|
span.glyphicon.glyphicon-tasks
|
||||||
|
| User Managment
|
||||||
|
li
|
||||||
|
a(ui-sref="app.L.settings",ui-sref-active="active")
|
||||||
|
span.glyphicon.glyphicon-cog
|
||||||
|
| Settings
|
||||||
|
li
|
||||||
|
a(ng-click="logout()")
|
||||||
|
span.glyphicon.glyphicon-log-out
|
||||||
|
| Logout
|
||||||
form.navbar-form.navbar-right(ng-if="!session.login.active",ng-submit="login()")
|
form.navbar-form.navbar-right(ng-if="!session.login.active",ng-submit="login()")
|
||||||
.form-group(ng-class="{'has-error': (error.fields.indexOf('username') >= 0)}")
|
.form-group(ng-class="{'has-error': (error.fields.indexOf('username') >= 0)}")
|
||||||
input.form-control(ng-model="obj.username",placeholder="Username",pattern=".{3,}")
|
input.form-control(ng-model="obj.username",placeholder="Username",pattern=".{3,}")
|
||||||
|
|
|
@ -4,8 +4,15 @@ angular.module('warehost')
|
||||||
.controller('MainCtrl',function($scope,alert,$http,$state,config,session){
|
.controller('MainCtrl',function($scope,alert,$http,$state,config,session){
|
||||||
$scope.isOpen = false;
|
$scope.isOpen = false;
|
||||||
$scope.obj = {};
|
$scope.obj = {};
|
||||||
|
$scope.modules = [];
|
||||||
$scope.$state = $state;
|
$scope.$state = $state;
|
||||||
|
|
||||||
|
$http.get(config.api+'/modules').then(function(res){
|
||||||
|
session.set(res);
|
||||||
|
alert.set(res);
|
||||||
|
$scope.modules = res.data.data;
|
||||||
|
});
|
||||||
|
|
||||||
$scope.toggleOpen = function(){
|
$scope.toggleOpen = function(){
|
||||||
$scope.isOpen = !$scope.isOpen;
|
$scope.isOpen = !$scope.isOpen;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,29 +1,24 @@
|
||||||
.container
|
.container
|
||||||
h1 Settings
|
h1 Settings
|
||||||
.row
|
form(ng-submit="submit()",name="myform")
|
||||||
.col-md-6
|
.form-group
|
||||||
h2 Global
|
label(for="globalUsername") Username
|
||||||
form.well.well-sm(ng-submit="submit()",name="myform")
|
input.form-control(id="globalUsername",ng-model="session.login.username",readonly)
|
||||||
.form-group
|
.form-group(ng-class="{'has-error': (error.fields.indexOf('currentpassword') >= 0)}")
|
||||||
label(for="globalUsername") Username
|
label(for="currentPassword") Current Password
|
||||||
input.form-control(id="globalUsername",ng-model="session.login.username",readonly)
|
input.form-control(id="currentPassword",type="password",ng-model="obj.currentPassword")
|
||||||
.form-group(ng-class="{'has-error': (error.fields.indexOf('currentpassword') >= 0)}")
|
.form-group(ng-class="{'has-error': (error.fields.indexOf('newpassword') >= 0 || !myform.newPassword.$valid)}")
|
||||||
label(for="currentPassword") Current Password
|
label(for="newPassword") New Password
|
||||||
input.form-control(id="currentPassword",type="password",ng-model="obj.currentPassword")
|
input.form-control(id="newPassword",type="password",name="newPassword",ng-model="obj.newPassword",ng-minlength="3")
|
||||||
.form-group(ng-class="{'has-error': (error.fields.indexOf('newpassword') >= 0 || !myform.newPassword.$valid)}")
|
.form-group(ng-class="{'has-error': (obj.newPassword != obj.repeatPassword && myform.repeatPassword.$dirty)}")
|
||||||
label(for="newPassword") New Password
|
label(for="repeatPassword") Again Password
|
||||||
input.form-control(id="newPassword",type="password",name="newPassword",ng-model="obj.newPassword",ng-minlength="3")
|
input.form-control(id="repeatPassword",type="password",name="repeatPassword",ng-model="obj.repeatPassword")
|
||||||
.form-group(ng-class="{'has-error': (obj.newPassword != obj.repeatPassword && myform.repeatPassword.$dirty)}")
|
.row
|
||||||
label(for="repeatPassword") Again Password
|
.col-xs-6
|
||||||
input.form-control(id="repeatPassword",type="password",name="repeatPassword",ng-model="obj.repeatPassword")
|
button.btn.btn-primary(type="submit")
|
||||||
.row
|
span.glyphicon.glyphicon-floppy-disk
|
||||||
.col-xs-6
|
| Save
|
||||||
button.btn.btn-primary(type="submit")
|
.col-xs-6.text-right
|
||||||
span.glyphicon.glyphicon-floppy-disk
|
a.btn.btn-danger(ng-click="delete()")
|
||||||
| Save
|
span.glyphicon.glyphicon-trash
|
||||||
.col-xs-6.text-right
|
| Delete
|
||||||
a.btn.btn-danger(ng-click="delete()")
|
|
||||||
span.glyphicon.glyphicon-trash
|
|
||||||
| Delete
|
|
||||||
.col-md-6
|
|
||||||
h2 Profiles
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
'use strict';
|
||||||
|
angular.module('warehost')
|
||||||
|
.config(['$stateProvider',function ($stateProvider) {
|
||||||
|
$stateProvider
|
||||||
|
.state('app.web', {
|
||||||
|
url:'/web',
|
||||||
|
views:{
|
||||||
|
'menu':{templateUrl:'app/web/menu.html'}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('app.web.index', {
|
||||||
|
url:'/',
|
||||||
|
views:{
|
||||||
|
'@app':{
|
||||||
|
templateUrl: 'app/home.html',
|
||||||
|
controller:function(alert){
|
||||||
|
alert.set({});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}]);
|
|
@ -0,0 +1,2 @@
|
||||||
|
li
|
||||||
|
a(ui-sref="app.web.index",ui-sref-active="active") Home
|
|
@ -48,11 +48,12 @@
|
||||||
<!-- build:js({.tmp,public}) app/app.js -->
|
<!-- build:js({.tmp,public}) app/app.js -->
|
||||||
<script src="app/app.js"></script>
|
<script src="app/app.js"></script>
|
||||||
<!-- injector:js -->
|
<!-- injector:js -->
|
||||||
|
<script src="app/host/index.js"></script>
|
||||||
<script src="app/index.js"></script>
|
<script src="app/index.js"></script>
|
||||||
<script src="app/invites.js"></script>
|
<script src="app/invites.js"></script>
|
||||||
<script src="app/main.js"></script>
|
<script src="app/main.js"></script>
|
||||||
<script src="app/settings.js"></script>
|
<script src="app/settings.js"></script>
|
||||||
<script src="app/shift/index.js"></script>
|
<script src="app/web/index.js"></script>
|
||||||
<script src="components/alert.js"></script>
|
<script src="components/alert.js"></script>
|
||||||
<script src="components/config.js"></script>
|
<script src="components/config.js"></script>
|
||||||
<script src="components/session.js"></script>
|
<script src="components/session.js"></script>
|
||||||
|
|
Reference in New Issue