setup new organization layout within backend

This commit is contained in:
Kyle Spearrin 2017-03-01 22:47:24 -05:00
parent 05a92ebd26
commit 492e2e693c
12 changed files with 245 additions and 163 deletions

View File

@ -40,7 +40,7 @@ angular
} }
else { else {
$analytics.eventTrack('Logged In'); $analytics.eventTrack('Logged In');
$state.go('backend.vault'); $state.go('backend.user.vault');
} }
}); });
}; };
@ -51,7 +51,7 @@ angular
$scope.twoFactorPromise.then(function () { $scope.twoFactorPromise.then(function () {
$analytics.eventTrack('Logged In From Two-step'); $analytics.eventTrack('Logged In From Two-step');
$state.go('backend.vault'); $state.go('backend.user.vault');
}); });
}; };
}); });

View File

@ -17,5 +17,6 @@
'bit.vault', 'bit.vault',
'bit.shared', 'bit.shared',
'bit.settings', 'bit.settings',
'bit.tools' 'bit.tools',
'bit.organization'
]); ]);

View File

@ -75,42 +75,56 @@ angular
authorize: true authorize: true
} }
}) })
.state('backend.vault', { .state('backend.user', {
templateUrl: 'app/views/userLayout.html',
abstract: true
})
.state('backend.user.vault', {
url: '^/vault', url: '^/vault',
templateUrl: 'app/vault/views/vault.html', templateUrl: 'app/vault/views/vault.html',
controller: 'vaultController', controller: 'vaultController',
data: { pageTitle: 'My Vault' } data: { pageTitle: 'My Vault' }
}) })
.state('backend.settings', { .state('backend.user.settings', {
url: '^/settings', url: '^/settings',
templateUrl: 'app/settings/views/settings.html', templateUrl: 'app/settings/views/settings.html',
controller: 'settingsController', controller: 'settingsController',
data: { pageTitle: 'Settings' } data: { pageTitle: 'Settings' }
}) })
.state('backend.settingsDomains', { .state('backend.user.settingsDomains', {
url: '^/settings/domains', url: '^/settings/domains',
templateUrl: 'app/settings/views/settingsDomains.html', templateUrl: 'app/settings/views/settingsDomains.html',
controller: 'settingsDomainsController', controller: 'settingsDomainsController',
data: { pageTitle: 'Domain Settings' } data: { pageTitle: 'Domain Settings' }
}) })
.state('backend.tools', { .state('backend.user.tools', {
url: '^/tools', url: '^/tools',
templateUrl: 'app/tools/views/tools.html', templateUrl: 'app/tools/views/tools.html',
controller: 'toolsController', controller: 'toolsController',
data: { pageTitle: 'Tools' } data: { pageTitle: 'Tools' }
}) })
.state('backend.shared', { .state('backend.user.shared', {
url: '^/shared', url: '^/shared',
templateUrl: 'app/shared/views/shared.html', templateUrl: 'app/shared/views/shared.html',
controller: 'sharedController', controller: 'sharedController',
data: { pageTitle: 'Shared' } data: { pageTitle: 'Shared' }
}) })
.state('backend.sharedMe', { .state('backend.user.sharedMe', {
url: '^/shared/me', url: '^/shared/me',
templateUrl: 'app/shared/views/sharedMe.html', templateUrl: 'app/shared/views/sharedMe.html',
controller: 'sharedMeController', controller: 'sharedMeController',
data: { pageTitle: 'Shared with Me' } data: { pageTitle: 'Shared with Me' }
}) })
.state('backend.org', {
templateUrl: 'app/views/organizationLayout.html',
abstract: true
})
.state('backend.org.dashboard', {
url: '^/organization',
templateUrl: 'app/organization/views/dashboard.html',
controller: 'organizationDashboardController',
data: { pageTitle: 'Org Dash' }
})
// Frontend // Frontend
.state('frontend', { .state('frontend', {
@ -182,7 +196,7 @@ angular
if (!toState.data || !toState.data.authorize) { if (!toState.data || !toState.data.authorize) {
if (authService.isAuthenticated()) { if (authService.isAuthenticated()) {
event.preventDefault(); event.preventDefault();
$state.go('backend.vault'); $state.go('backend.user.vault');
} }
return; return;

View File

@ -39,7 +39,7 @@ angular
}); });
$scope.searchVault = function () { $scope.searchVault = function () {
$state.go('backend.vault'); $state.go('backend.user.vault');
}; };
$scope.addLogin = function () { $scope.addLogin = function () {

View File

@ -0,0 +1,6 @@
angular
.module('bit.organization')
.controller('organizationDashboardController', function ($scope) {
});

View File

@ -0,0 +1,2 @@
angular
.module('bit.organization', ['ui.bootstrap']);

View File

@ -0,0 +1,16 @@
<section class="content-header">
<h1>
Organization Dashboard
<small>Some org</small>
</h1>
</section>
<section class="content">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><i class="fa fa-server"></i> My Org</h3>
</div>
<div class="box-body">
Some data
</div>
</div>
</section>

View File

@ -228,7 +228,7 @@
folderRelationships: folderRelationships folderRelationships: folderRelationships
}, function () { }, function () {
$uibModalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
$state.go('backend.vault').then(function () { $state.go('backend.user.vault').then(function () {
$analytics.eventTrack('Imported Data', { label: $scope.model.source }); $analytics.eventTrack('Imported Data', { label: $scope.model.source });
toastr.success('Data has been successfully imported into your vault.', 'Import Success'); toastr.success('Data has been successfully imported into your vault.', 'Import Success');
}); });

View File

@ -1,154 +1,5 @@
<div class="wrapper toast-target"> <div class="wrapper toast-target">
<header class="main-header" ng-controller="topNavController as topNav"> <div ui-view></div>
<a ui-sref="backend.vault" class="logo">
<span class="logo-mini"><i class="fa fa-shield"></i></span>
<span class="logo-lg"><i class="fa fa-shield"></i> <b>bit</b>warden</span>
</a>
<nav class="navbar navbar-static-top" role="navigation">
<a class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li><a ui-sref="frontend.logout">Log Out</a></li>
</ul>
</div>
</nav>
</header>
<aside class="main-sidebar" ng-controller="sideNavController as sideNav">
<section class="sidebar">
<div class="user-panel">
<div class="pull-left image">
<img src="//www.gravatar.com/avatar/{{ main.userProfile.email | gravatar }}.jpg?s=45&d=mm"
class="img-circle" alt="User Image">
</div>
<div class="pull-left info">
<p>{{main.userProfile.extended && main.userProfile.extended.name ? main.userProfile.extended.name : main.userProfile.email}}</p>
<a ui-sref="frontend.logout">Log Out</a>
</div>
</div>
<form class="sidebar-form">
<label for="search" class="sr-only">Search</label>
<div class="form-group has-feedback">
<input type="text" id="search" class="form-control" placeholder="Search vault..."
ng-focus="searchVault()" ng-model="main.searchVaultText" />
<span class="fa fa-search form-control-feedback" aria-hidden="true"></span>
</div>
</form>
<ul class="sidebar-menu">
<li class="header">WEB VAULT</li>
<li class="treeview" ng-class="{active: $state.includes('backend.vault')}">
<a ui-sref="backend.vault"><i class="fa fa-lock fa-fw"></i> <span>My Vault</span></a>
<ul class="treeview-menu" ng-class="{'menu-open': $state.includes('backend.vault')}">
<li>
<a href="javascript:void(0)" ng-click="addLogin()">
<i class="fa fa-plus-circle fa-fw"></i> New Login
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="addFolder()">
<i class="fa fa-folder fa-fw"></i> New Folder
</a>
</li>
</ul>
</li>
<li class="treeview"
ng-class="{active: $state.is('backend.shared') || $state.is('backend.sharedMe')}">
<a ui-sref="backend.shared">
<small class="label pull-right bg-yellow">beta</small>
<i class="fa fa-share-alt fa-fw"></i> <span>Sharing Center</span>
</a>
<ul class="treeview-menu" ng-class="{'menu-open': $state.is('backend.shared')
|| $state.is('backend.sharedMe')}">
<li ng-class="{active: $state.is('backend.shared')}">
<a ui-sref="backend.shared">
<i class="fa fa-fw fa-circle-o"></i> My Shares
</a>
</li>
<li ng-class="{active: $state.is('backend.sharedMe')}">
<a ui-sref="backend.sharedMe">
<i class="fa fa-fw fa-circle-o"></i> Shared with Me
</a>
</li>
</ul>
</li>
<li class="treeview" ng-class="{active: $state.is('backend.tools')}">
<a ui-sref="backend.tools"><i class="fa fa-wrench fa-fw"></i> <span>Tools</span></a>
</li>
<li class="treeview"
ng-class="{active: $state.is('backend.settings') || $state.is('backend.settingsDomains')}">
<a ui-sref="backend.settings"><i class="fa fa-cogs fa-fw"></i> <span>Settings</span></a>
<ul class="treeview-menu" ng-class="{'menu-open': $state.is('backend.settings')
|| $state.is('backend.settingsDomains')}">
<li ng-class="{active: $state.is('backend.settingsDomains')}">
<a ui-sref="backend.settingsDomains">
<i class="fa fa-fw fa-circle-o"></i> Domain Rules
</a>
</li>
</ul>
</li>
<li>
<a href="https://help.bitwarden.com/" target="_blank"
analytics-on="click" analytics-event="Clicked Get Help">
<i class="fa fa-info-circle fa-fw"></i> <span>Get Help</span>
</a>
</li>
<li class="header">
<small class="label pull-right bg-green">FREE</small>
MOBILE APPS
</li>
<li>
<a href="https://itunes.apple.com/us/app/bitwarden-free-password-manager/id1137397744?mt=8"
target="_blank" analytics-on="click" analytics-event="Clicked iOS">
<i class="fa fa-apple fa-fw"></i> <span>iOS</span>
</a>
</li>
<li>
<a href="https://play.google.com/store/apps/details?id=com.x8bit.bitwarden"
target="_blank" analytics-on="click" analytics-event="Clicked Android">
<i class="fa fa-android fa-fw"></i> <span>Android</span>
</a>
</li>
<li class="header">
<small class="label pull-right bg-green">FREE</small>
BROWSER EXTENSIONS
</li>
<li>
<a href="https://chrome.google.com/webstore/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb"
target="_blank" analytics-on="click" analytics-event="Clicked Chrome">
<i class="fa fa-chrome fa-fw"></i> <span>Chrome</span>
</a>
</li>
<li>
<a href="javascript:void(0)"
target="_blank" analytics-on="click" analytics-event="Clicked Firefox">
<small class="label pull-right bg-gray">coming very soon</small>
<i class="fa fa-firefox fa-fw"></i> <span>Firefox</span>
</a>
</li>
<li>
<a href="https://addons.opera.com/extensions/details/bitwarden-free-password-manager/"
target="_blank" analytics-on="click" analytics-event="Clicked Opera">
<i class="fa fa-opera fa-fw"></i> <span>Opera</span>
</a>
</li>
<li>
<a href="javascript:void(0)"
target="_blank" analytics-on="click" analytics-event="Clicked Edge">
<small class="label pull-right bg-gray">coming soon</small>
<i class="fa fa-edge fa-fw"></i> <span>Edge</span>
</a>
</li>
</ul>
</section>
</aside>
<div class="content-wrapper" ui-view>
</div>
<footer class="main-footer"> <footer class="main-footer">
<div class="pull-right hidden-xs"> <div class="pull-right hidden-xs">

View File

@ -0,0 +1,40 @@
<header class="main-header" ng-controller="topNavController as topNav">
<a ui-sref="backend.user.vault" class="logo">
<span class="logo-mini"><i class="fa fa-shield"></i></span>
<span class="logo-lg"><i class="fa fa-shield"></i> <b>bit</b>warden</span>
</a>
<nav class="navbar navbar-static-top" role="navigation">
<a class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li><a ui-sref="frontend.logout">Log Out</a></li>
</ul>
</div>
</nav>
</header>
<aside class="main-sidebar" ng-controller="sideNavController as sideNav">
<section class="sidebar">
<div class="user-panel">
<div class="pull-left image">
<img src="//www.gravatar.com/avatar/{{ main.userProfile.email | gravatar }}.jpg?s=45&d=mm"
class="img-circle" alt="User Image">
</div>
<div class="pull-left info">
<p>{{main.userProfile.extended && main.userProfile.extended.name ? main.userProfile.extended.name : main.userProfile.email}}</p>
<a ui-sref="frontend.logout">Log Out</a>
</div>
</div>
<ul class="sidebar-menu">
<li class="header">ORG</li>
</ul>
</section>
</aside>
<div class="content-wrapper" ui-view>
</div>

View File

@ -0,0 +1,150 @@
<header class="main-header" ng-controller="topNavController as topNav">
<a ui-sref="backend.user.vault" class="logo">
<span class="logo-mini"><i class="fa fa-shield"></i></span>
<span class="logo-lg"><i class="fa fa-shield"></i> <b>bit</b>warden</span>
</a>
<nav class="navbar navbar-static-top" role="navigation">
<a class="sidebar-toggle" data-toggle="offcanvas" role="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li><a ui-sref="frontend.logout">Log Out</a></li>
</ul>
</div>
</nav>
</header>
<aside class="main-sidebar" ng-controller="sideNavController as sideNav">
<section class="sidebar">
<div class="user-panel">
<div class="pull-left image">
<img src="//www.gravatar.com/avatar/{{ main.userProfile.email | gravatar }}.jpg?s=45&d=mm"
class="img-circle" alt="User Image">
</div>
<div class="pull-left info">
<p>{{main.userProfile.extended && main.userProfile.extended.name ? main.userProfile.extended.name : main.userProfile.email}}</p>
<a ui-sref="frontend.logout">Log Out</a>
</div>
</div>
<form class="sidebar-form">
<label for="search" class="sr-only">Search</label>
<div class="form-group has-feedback">
<input type="text" id="search" class="form-control" placeholder="Search vault..."
ng-focus="searchVault()" ng-model="main.searchVaultText" />
<span class="fa fa-search form-control-feedback" aria-hidden="true"></span>
</div>
</form>
<ul class="sidebar-menu">
<li class="header">WEB VAULT</li>
<li class="treeview" ng-class="{active: $state.includes('backend.user.vault')}">
<a ui-sref="backend.user.vault"><i class="fa fa-lock fa-fw"></i> <span>My Vault</span></a>
<ul class="treeview-menu" ng-class="{'menu-open': $state.includes('backend.user.vault')}">
<li>
<a href="javascript:void(0)" ng-click="addLogin()">
<i class="fa fa-plus-circle fa-fw"></i> New Login
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="addFolder()">
<i class="fa fa-folder fa-fw"></i> New Folder
</a>
</li>
</ul>
</li>
<li class="treeview"
ng-class="{active: $state.is('backend.user.shared') || $state.is('backend.user.sharedMe')}">
<a ui-sref="backend.user.shared">
<small class="label pull-right bg-yellow">beta</small>
<i class="fa fa-share-alt fa-fw"></i> <span>Sharing Center</span>
</a>
<ul class="treeview-menu" ng-class="{'menu-open': $state.is('backend.user.shared')
|| $state.is('backend.user.sharedMe')}">
<li ng-class="{active: $state.is('backend.user.shared')}">
<a ui-sref="backend.user.shared">
<i class="fa fa-fw fa-circle-o"></i> My Shares
</a>
</li>
<li ng-class="{active: $state.is('backend.user.sharedMe')}">
<a ui-sref="backend.user.sharedMe">
<i class="fa fa-fw fa-circle-o"></i> Shared with Me
</a>
</li>
</ul>
</li>
<li class="treeview" ng-class="{active: $state.is('backend.user.tools')}">
<a ui-sref="backend.user.tools"><i class="fa fa-wrench fa-fw"></i> <span>Tools</span></a>
</li>
<li class="treeview"
ng-class="{active: $state.is('backend.user.settings') || $state.is('backend.user.settingsDomains')}">
<a ui-sref="backend.user.settings"><i class="fa fa-cogs fa-fw"></i> <span>Settings</span></a>
<ul class="treeview-menu" ng-class="{'menu-open': $state.is('backend.user.settings')
|| $state.is('backend.user.settingsDomains')}">
<li ng-class="{active: $state.is('backend.user.settingsDomains')}">
<a ui-sref="backend.user.settingsDomains">
<i class="fa fa-fw fa-circle-o"></i> Domain Rules
</a>
</li>
</ul>
</li>
<li>
<a href="https://help.bitwarden.com/" target="_blank"
analytics-on="click" analytics-event="Clicked Get Help">
<i class="fa fa-info-circle fa-fw"></i> <span>Get Help</span>
</a>
</li>
<li class="header">
<small class="label pull-right bg-green">FREE</small>
MOBILE APPS
</li>
<li>
<a href="https://itunes.apple.com/us/app/bitwarden-free-password-manager/id1137397744?mt=8"
target="_blank" analytics-on="click" analytics-event="Clicked iOS">
<i class="fa fa-apple fa-fw"></i> <span>iOS</span>
</a>
</li>
<li>
<a href="https://play.google.com/store/apps/details?id=com.x8bit.bitwarden"
target="_blank" analytics-on="click" analytics-event="Clicked Android">
<i class="fa fa-android fa-fw"></i> <span>Android</span>
</a>
</li>
<li class="header">
<small class="label pull-right bg-green">FREE</small>
BROWSER EXTENSIONS
</li>
<li>
<a href="https://chrome.google.com/webstore/detail/bitwarden-free-password-m/nngceckbapebfimnlniiiahkandclblb"
target="_blank" analytics-on="click" analytics-event="Clicked Chrome">
<i class="fa fa-chrome fa-fw"></i> <span>Chrome</span>
</a>
</li>
<li>
<a href="javascript:void(0)"
target="_blank" analytics-on="click" analytics-event="Clicked Firefox">
<small class="label pull-right bg-gray">coming very soon</small>
<i class="fa fa-firefox fa-fw"></i> <span>Firefox</span>
</a>
</li>
<li>
<a href="https://addons.opera.com/extensions/details/bitwarden-free-password-manager/"
target="_blank" analytics-on="click" analytics-event="Clicked Opera">
<i class="fa fa-opera fa-fw"></i> <span>Opera</span>
</a>
</li>
<li>
<a href="javascript:void(0)"
target="_blank" analytics-on="click" analytics-event="Clicked Edge">
<small class="label pull-right bg-gray">coming soon</small>
<i class="fa fa-edge fa-fw"></i> <span>Edge</span>
</a>
</li>
</ul>
</section>
</aside>
<div class="content-wrapper" ui-view>
</div>

View File

@ -115,12 +115,14 @@
<script src="app/vault/vaultAddLoginController.js"></script> <script src="app/vault/vaultAddLoginController.js"></script>
<script src="app/vault/vaultEditFolderController.js"></script> <script src="app/vault/vaultEditFolderController.js"></script>
<script src="app/vault/vaultAddFolderController.js"></script> <script src="app/vault/vaultAddFolderController.js"></script>
<script src="app/vault/vaultShareLoginController.js"></script>
<script src="app/shared/sharedModule.js"></script> <script src="app/shared/sharedModule.js"></script>
<script src="app/shared/sharedController.js"></script> <script src="app/shared/sharedController.js"></script>
<script src="app/shared/sharedMeController.js"></script> <script src="app/shared/sharedMeController.js"></script>
<script src="app/organization/organizationModule.js"></script>
<script src="app/organization/organizationDashboardController.js"></script>
<script src="app/settings/settingsModule.js"></script> <script src="app/settings/settingsModule.js"></script>
<script src="app/settings/settingsController.js"></script> <script src="app/settings/settingsController.js"></script>
<script src="app/settings/settingsChangePasswordController.js"></script> <script src="app/settings/settingsChangePasswordController.js"></script>