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.dropdown(ng-if="modules.length>0")
|
||||||
|
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false")
|
||||||
|
span.glyphicon.glyphicon-th-large
|
||||||
|
| Apps
|
||||||
|
span.caret
|
||||||
|
ul.dropdown-menu
|
||||||
|
li(ng-if="modules.indexOf('web')>-1",ui-sref="app.web.index")
|
||||||
|
a(nav navbar-nav) Websites
|
||||||
|
li(ng-if="modules.indexOf('host')>-1",ui-sref="app.host.index")
|
||||||
|
a(nav navbar-nav) Hosting
|
||||||
|
li(ng-if="modules.indexOf('test')>-1")
|
||||||
|
a(nav navbar-nav) Testing
|
||||||
|
li.dropdown
|
||||||
|
a.dropdown-toggle(data-toggle="dropdown",role="button",aria-haspopup="true",aria-expanded="false")
|
||||||
|
span.glyphicon.glyphicon-user
|
||||||
|
| {{session.login.username}}
|
||||||
|
span.caret
|
||||||
|
ul.dropdown-menu
|
||||||
li
|
li
|
||||||
a(ui-sref="app.L.invites",ui-sref-active="active")
|
a(ui-sref="app.L.invites",ui-sref-active="active")
|
||||||
span.glyphicon.glyphicon-send
|
span.glyphicon.glyphicon-send
|
||||||
| Invites
|
| Invites
|
||||||
li(ng-if="session.login.superadmin")
|
li(ng-if="session.login.superadmin")
|
||||||
a(ui-sref="app.A.admin",ui-sref-active="active")
|
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
|
span.glyphicon.glyphicon-cog
|
||||||
| Admin
|
| Settings
|
||||||
.navbar-text(ng-class="{ 'active': $state.includes('app.L.settings') }")
|
li
|
||||||
| Welcome
|
a(ng-click="logout()")
|
||||||
a(ui-sref="app.L.settings",ui-sref-active="active") {{session.login.username}}
|
span.glyphicon.glyphicon-log-out
|
||||||
|
|
| Logout
|
||||||
span.glyphicon.glyphicon-user
|
|
||||||
.navbar-text
|
|
||||||
span.glyphicon.glyphicon-log-out(ng-click="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,9 +1,6 @@
|
||||||
.container
|
.container
|
||||||
h1 Settings
|
h1 Settings
|
||||||
.row
|
form(ng-submit="submit()",name="myform")
|
||||||
.col-md-6
|
|
||||||
h2 Global
|
|
||||||
form.well.well-sm(ng-submit="submit()",name="myform")
|
|
||||||
.form-group
|
.form-group
|
||||||
label(for="globalUsername") Username
|
label(for="globalUsername") Username
|
||||||
input.form-control(id="globalUsername",ng-model="session.login.username",readonly)
|
input.form-control(id="globalUsername",ng-model="session.login.username",readonly)
|
||||||
|
@ -25,5 +22,3 @@
|
||||||
a.btn.btn-danger(ng-click="delete()")
|
a.btn.btn-danger(ng-click="delete()")
|
||||||
span.glyphicon.glyphicon-trash
|
span.glyphicon.glyphicon-trash
|
||||||
| Delete
|
| 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