spinning icon when login

parent 5e8dadf3
No preview for this file type
This diff could not be displayed because it is too large.
...@@ -40,6 +40,7 @@ function LoginCtrl( ...@@ -40,6 +40,7 @@ function LoginCtrl(
} }
$scope.login = function () { $scope.login = function () {
$scope.submitted = true;
$http $http
.post(config.backend + '/sup/login', $scope.credentials) .post(config.backend + '/sup/login', $scope.credentials)
.success(function (data) { .success(function (data) {
...@@ -69,6 +70,7 @@ function LoginCtrl( ...@@ -69,6 +70,7 @@ function LoginCtrl(
$location.path('/students'); $location.path('/students');
}) })
.error(function (err) { .error(function (err) {
$scope.submitted = false;
delete $window.sessionStorage.token; delete $window.sessionStorage.token;
if (err.search("without students") > 0) { if (err.search("without students") > 0) {
$translate('no_students_for_user').then(function (translation) { $translate('no_students_for_user').then(function (translation) {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<!-- Rejilla 3 elementos de igual ancho --> <!-- Rejilla 3 elementos de igual ancho -->
<div class="col-md-4">&nbsp;</div> <div class="col-md-4">&nbsp;</div>
<div class="col-md-4"> <div class="col-md-4">
<div id="login"> <div id="login">
<!-- Logo Pictogram --> <!-- Logo Pictogram -->
<p class="text-center"> <p class="text-center">
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
<p class="text-center"> <p class="text-center">
<button type="submit" class="btn btn-primary" translate>login</button> <button type="submit" class="btn btn-primary" translate>login</button>
</p> </p>
<p class="text-center">
<i ng-class="{'fa fa-spinner fa-spin fa-2x fa-fw margin-bottom': true, 'disabled': !submitted}"></i>
</p>
<p class="text-center"> <p class="text-center">
<a href="/app/#/signin" translate>create_an_account</a> <a href="/app/#/signin" translate>create_an_account</a>
</p> </p>
...@@ -37,10 +39,9 @@ ...@@ -37,10 +39,9 @@
</div> </div>
<div class="col-md-4">&nbsp;</div> <div class="col-md-4">&nbsp;</div>
</div> </div>
<!-- Fin de row --> <!-- Fin de row -->
<footer-translate></footer-translate> <footer-translate></footer-translate>
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
padding: 8px; padding: 8px;
} }
/* For hidding spinner preserving space */
.disabled {
visibility: hidden;
cursor: default;
}
/* For span that are links */ /* For span that are links */
.pointer{ cursor: pointer; } .pointer{ cursor: pointer; }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
@import (less) '../app/bower_components/angular-chart.js/dist/angular-chart.css'; @import (less) '../app/bower_components/angular-chart.js/dist/angular-chart.css';
@import (less) 'cropper.css'; @import (less) 'cropper.css';
@import (less) 'main.css'; @import (less) 'main.css';
@import (less) 'font-awesome.min.css';
@import 'forms.less'; @import 'forms.less';
@import 'picto-grid.less'; @import 'picto-grid.less';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment