fix manage controller, refactor logged attr
This commit is contained in:
parent
b391344daf
commit
a3d0b9e48b
2 changed files with 21 additions and 22 deletions
81
js/routes.js
81
js/routes.js
|
|
@ -8,47 +8,9 @@ angular
|
||||||
$routeProvider
|
$routeProvider
|
||||||
.when('/', {
|
.when('/', {
|
||||||
templateUrl: 'views/home.html',
|
templateUrl: 'views/home.html',
|
||||||
validate: false
|
|
||||||
})
|
})
|
||||||
.when('/createProfile', {
|
.when('/createProfile', {
|
||||||
templateUrl: 'views/createProfile.html',
|
templateUrl: 'views/createProfile.html',
|
||||||
validate: false
|
|
||||||
})
|
|
||||||
.when('/join', {
|
|
||||||
templateUrl: 'views/join.html',
|
|
||||||
validate: true
|
|
||||||
})
|
|
||||||
.when('/import', {
|
|
||||||
templateUrl: 'views/import.html',
|
|
||||||
validate: false
|
|
||||||
})
|
|
||||||
.when('/create', {
|
|
||||||
templateUrl: 'views/create.html',
|
|
||||||
validate: true
|
|
||||||
})
|
|
||||||
.when('/copayers', {
|
|
||||||
templateUrl: 'views/copayers.html',
|
|
||||||
validate: true
|
|
||||||
})
|
|
||||||
.when('/receive', {
|
|
||||||
templateUrl: 'views/addresses.html',
|
|
||||||
validate: true
|
|
||||||
})
|
|
||||||
.when('/history', {
|
|
||||||
templateUrl: 'views/transactions.html',
|
|
||||||
validate: true
|
|
||||||
})
|
|
||||||
.when('/send', {
|
|
||||||
templateUrl: 'views/send.html',
|
|
||||||
validate: true
|
|
||||||
})
|
|
||||||
.when('/more', {
|
|
||||||
templateUrl: 'views/more.html',
|
|
||||||
validate: true
|
|
||||||
})
|
|
||||||
.when('/settings', {
|
|
||||||
templateUrl: 'views/settings.html',
|
|
||||||
validate: false
|
|
||||||
})
|
})
|
||||||
.when('/unsupported', {
|
.when('/unsupported', {
|
||||||
templateUrl: 'views/unsupported.html'
|
templateUrl: 'views/unsupported.html'
|
||||||
|
|
@ -56,13 +18,49 @@ angular
|
||||||
.when('/uri-payment/:data', {
|
.when('/uri-payment/:data', {
|
||||||
templateUrl: 'views/uri-payment.html'
|
templateUrl: 'views/uri-payment.html'
|
||||||
})
|
})
|
||||||
|
.when('/join', {
|
||||||
|
templateUrl: 'views/join.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/import', {
|
||||||
|
templateUrl: 'views/import.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/create', {
|
||||||
|
templateUrl: 'views/create.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/copayers', {
|
||||||
|
templateUrl: 'views/copayers.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/receive', {
|
||||||
|
templateUrl: 'views/addresses.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/history', {
|
||||||
|
templateUrl: 'views/transactions.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/send', {
|
||||||
|
templateUrl: 'views/send.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/more', {
|
||||||
|
templateUrl: 'views/more.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
|
.when('/settings', {
|
||||||
|
templateUrl: 'views/settings.html',
|
||||||
|
logged: true
|
||||||
|
})
|
||||||
.when('/warning', {
|
.when('/warning', {
|
||||||
templateUrl: 'views/warning.html',
|
templateUrl: 'views/warning.html',
|
||||||
validate: true
|
logged: true
|
||||||
})
|
})
|
||||||
.when('/manage', {
|
.when('/manage', {
|
||||||
templateUrl: 'views/manage.html',
|
templateUrl: 'views/manage.html',
|
||||||
validate: true
|
logged: true
|
||||||
})
|
})
|
||||||
.otherwise({
|
.otherwise({
|
||||||
templateUrl: 'views/errors/404.html',
|
templateUrl: 'views/errors/404.html',
|
||||||
|
|
@ -90,7 +88,8 @@ angular
|
||||||
if (!localStorage || localStorage.length < 1) {
|
if (!localStorage || localStorage.length < 1) {
|
||||||
$location.path('unsupported');
|
$location.path('unsupported');
|
||||||
} else {
|
} else {
|
||||||
if ((!$rootScope.wallet || !$rootScope.wallet.id) && next.validate) {
|
if (!$rootScope.iden && next.logged) {
|
||||||
|
console.log('not logged... redirecting')
|
||||||
$idle.unwatch();
|
$idle.unwatch();
|
||||||
$location.path('/');
|
$location.path('/');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="backup" ng-controller="MoreController">
|
<div class="backup" ng-controller="ManageController">
|
||||||
<h1 translate>Manage Wallets</h1>
|
<h1 translate>Manage Wallets</h1>
|
||||||
<div class="oh large-12 columns panel">
|
<div class="oh large-12 columns panel">
|
||||||
<h3><i class="fi-download m10r"></i> <span translate>Backup</span> </h3>
|
<h3><i class="fi-download m10r"></i> <span translate>Manage Wallets</span> </h3>
|
||||||
<p translate class="large-8 columns text-gray">It's important to backup your profile so that you can recover it in case of disaster. The backup will include all your profile's wallets</p>
|
<p translate class="large-8 columns text-gray">It's important to backup your profile so that you can recover it in case of disaster. The backup will include all your profile's wallets</p>
|
||||||
<div class="large-4 columns">
|
<div class="large-4 columns">
|
||||||
<a translate class="button primary expand" ng-click="downloadBackup()">Backup profile</a>
|
<a translate class="button primary expand" ng-click="downloadBackup()">Backup profile</a>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue