add restore default buttons

This commit is contained in:
Matias Alejo Garcia 2014-11-12 21:31:07 -03:00
commit 5113e8b292
2 changed files with 25 additions and 5 deletions

View file

@ -1,13 +1,10 @@
'use strict';
angular.module('copayApp.controllers').controller('SettingsController', function($scope, $rootScope, $window, $location, controllerUtils, notification) {
angular.module('copayApp.controllers').controller('SettingsController', function($scope, $rootScope, $window, $route, $location, $anchorScroll, controllerUtils, notification) {
controllerUtils.redirIfLogged();
$scope.title = 'Settings';
$scope.defaultLanguage = config.defaultLanguage || 'en';
$scope.insightLivenet = config.network.livenet.url;
@ -102,4 +99,13 @@ angular.module('copayApp.controllers').controller('SettingsController', function
var hashIndex = window.location.href.indexOf('#!/');
window.location = window.location.href.substr(0, hashIndex);
};
$scope.reset = function() {
localStorage.removeItem('config');
$location.hash('top');
$anchorScroll();
$scope.message= 'Settings were reset to defaults';
};
});

View file

@ -1,12 +1,19 @@
<div class="settings" ng-controller="SettingsController">
<div class="large-4 large-centered medium-6 medium-centered columns">
<div class="logo-setup">
<div class="logo-setup" id="top">
<img src="img/logo-negative-beta.svg" alt="Copay" width="146" height="59">
<div ng-include="'views/includes/version.html'"></div>
</div>
<div class="box-setup">
<h1>{{title|translate}}</h1>
<form name="settingsForm">
<p class="text-primary size-14"
ng-show="message">
<i class="fi-check"></i>
{{message|translate}}
</p>
<fieldset>
<legend translate>Language</legend>
<select class="form-control" ng-model="selectedLanguage" ng-options="o.name for o in availableLanguages" required>
@ -52,6 +59,13 @@
<i class="fi-arrow-left"></i>
<span translate>Back</span>
</a>
<div class="right m10r">
<a class="button-setup text-gray" href="" ng-click="reset()">
<i class="fi-page-delete"></i>
<span translate>Reset settings</span>
</a>
</div>
</div>
</div>
</div>