Guest User

Untitled

a guest
Oct 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. 'use strict';
  2.  
  3. angular.module('vehiculoApp.controller')
  4.  
  5. /* Controllers */
  6. .controller('LoginCrtl', ['$scope','$rootScope','$http','$location','Data','$modal', function($scope,$rootScope,$http,$location,Data,$modal){
  7. $scope.send = true;
  8. $scope.login = function($user){
  9. if($user && $user.username && $user.password){
  10. Data.login($user)
  11. .success(function(data, status, headers, config){
  12. $rootScope.username = $user.username;
  13. $location.path( "/" );
  14. })
  15. .error(function(data, status, headers, config){
  16. $modal.open({template:'<div class="modal-header"><h3 class="modal-title">Error</h3></div><div class="modal-body">¡Usuario /Contraseña incorrectos!</div>'});
  17. $location.path( "/" );
  18. })
  19. }
  20. }
  21.  
  22. $scope.recoverPass = function($email){
  23. $scope.send = false;
  24. Data.recovePass($email);
  25. }
  26. }]);
  27.  
  28. <div style="background:#fff">
  29.  
  30. <div class="row row-centered" style="background-color: #515151;padding:30px 0">
  31. <div class="text-center" >
  32. <img src="img/logo-im-new.png" alt="IndiceMotor"/>
  33. </div>
  34. </div>
  35. <div class="row " style="margin: 7% auto">
  36. <div class="col-lg-4 col-lg-offset-4 col-md-4 col-md-offset-4 col-xs-12 col-sm-4 col-sm-offset-4">
  37. <form class="form-signin" role="form" style="padding:20px; background:#fff;box-shadow: 0 2px 15px rgba(0, 0, 0, 0.175);" >
  38. <h3 class="box-title"><i class="fa fa-fw fa-user"></i> Introduce tus datos de acceso</h3>
  39. <label for="username" class="label label-primary">Usuario</label><br>
  40. <input id="username" class="form-control" placeholder="Identificador" required autofocus ng_model="user.username"><br>
  41. <label for="password" class="label label-primary">Contraseña</label><br>
  42. <input type="password" id="password" class="form-control" placeholder="Password" required ng_model="user.password"><br>
  43. <button class="btn btn-lg btn-primary btn-block" ng-click="login(user)">Acceder a Indice Motor</button>
  44. <a href="#/recoverPassword" style="padding-top: 23px;display:block;text-align: right;">&iquest;Has olvidado tu contrase&ntilde;a?</a>
  45. </form>
  46.  
  47. </div>
  48. </div>
  49.  
  50. </div>
Add Comment
Please, Sign In to add comment