Commit a97841dff44e8cfe8b77a8789f9157003efbd15d
1 parent
f555fa186d
Exists in
master
and in
1 other branch
Make submit the default action for the reset password page
Showing 3 changed files with 28 additions and 31 deletions Inline Diff
home.html
View file @
a97841d
<!DOCTYPE html> | 1 | 1 | <!DOCTYPE html> | |
<html ng-app="flashy"> | 2 | 2 | <html ng-app="flashy"> | |
<base href="/app/"> | 3 | 3 | <base href="/app/"> | |
<head> | 4 | 4 | <head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | 5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | |
<link rel="stylesheet" | 6 | 6 | <link rel="stylesheet" | |
href="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.0/angular-material.min.css"> | 7 | 7 | href="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.0/angular-material.min.css"> | |
8 | 8 | |||
<link rel="stylesheet" href="styles/flashier.css"/> | 9 | 9 | <link rel="stylesheet" href="styles/flashier.css"/> | |
<link rel="stylesheet" href="styles/flashy.css"/> | 10 | 10 | <link rel="stylesheet" href="styles/flashy.css"/> | |
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:200,200italic,300,600,400,900,700,400italic,700italic,300italic,600italic' | 11 | 11 | <link href='https://fonts.googleapis.com/css?family=Titillium+Web:200,200italic,300,600,400,900,700,400italic,700italic,300italic,600italic' | |
rel='stylesheet' type='text/css'> | 12 | 12 | rel='stylesheet' type='text/css'> | |
<title>Flashy</title> | 13 | 13 | <title>Flashy</title> | |
</head> | 14 | 14 | </head> | |
<body ng-controller="RootController"> | 15 | 15 | <body ng-controller="RootController"> | |
<header> | 16 | 16 | <header> | |
<nav> | 17 | 17 | <nav> | |
<div class="nav-wrapper"> | 18 | 18 | <div class="nav-wrapper"> | |
<a ng-show="UserService.isLoggedIn()" href="#" data-activates="mobile-demo" | 19 | 19 | <a ng-show="UserService.isLoggedIn()" href="#" data-activates="mobile-demo" | |
class="left button-collapse hide-on-med-and-up"><i | 20 | 20 | class="left button-collapse hide-on-med-and-up"><i | |
class="mdi-navigation-menu"></i></a> | 21 | 21 | class="mdi-navigation-menu"></i></a> | |
<ul ng-show="currentSection.id && UserService.isLoggedIn()" class="left hide-on-small-and-down"> | 22 | 22 | <ul ng-show="currentSection.id && UserService.isLoggedIn()" class="left hide-on-small-and-down"> | |
<li ui-sref-active="active"><a ui-sref="feed({sectionId:currentSection.id})" class="tooltipped" | 23 | 23 | <li ui-sref-active="active"><a ui-sref="feed({sectionId:currentSection.id})" class="tooltipped" | |
data-position="bottom" | 24 | 24 | data-position="bottom" | |
data-delay="50" data-tooltip="Feed"><i | 25 | 25 | data-delay="50" data-tooltip="Feed"><i | |
class="mdi-action-view-module"></i></a></li> | 26 | 26 | class="mdi-action-view-module"></i></a></li> | |
<li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | 27 | 27 | <li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | |
data-position="bottom" | 28 | 28 | data-position="bottom" | |
data-delay="50" data-tooltip="Deck"><i | 29 | 29 | data-delay="50" data-tooltip="Deck"><i | |
class="mdi-action-view-carousel"></i></a></li> | 30 | 30 | class="mdi-action-view-carousel"></i></a></li> | |
<li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | 31 | 31 | <li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | |
data-position="bottom" | 32 | 32 | data-position="bottom" | |
data-delay="50" data-tooltip="Card List"><i | 33 | 33 | data-delay="50" data-tooltip="Card List"><i | |
class="mdi-action-view-list"></i></a></li> | 34 | 34 | class="mdi-action-view-list"></i></a></li> | |
</ul> | 35 | 35 | </ul> | |
<a href="#" class="brand-logo center">Flashy</a> | 36 | 36 | <a href="#" class="brand-logo center">Flashy</a> | |
37 | 37 | |||
<ul ng-show="UserService.isLoggedIn()" ng-cloak id="nav-mobile" class="right hide-on-small-and-down"> | 38 | 38 | <ul ng-show="UserService.isLoggedIn()" ng-cloak id="nav-mobile" class="right hide-on-small-and-down"> | |
<!-- User's classes dropdown --> | 39 | 39 | <!-- User's classes dropdown --> | |
<ul id="dropdown1" class="dropdown-content"> | 40 | 40 | <ul id="dropdown1" class="dropdown-content"> | |
<li ui-sref-active="active" ng-repeat="section in UserService.getUserData().sections"> | 41 | 41 | <li ui-sref-active="active" ng-repeat="section in UserService.getUserData().sections"> | |
<a class="class bold" ui-sref="feed({sectionId:section.id})">{{section.short_name}}<span class="badge">hi</span></a> | 42 | 42 | <a ui-sref="feed({sectionId:section.id})">{{section.short_name}}</a> | |
</li> | 43 | 43 | </li> | |
<li class="divider"></li> | 44 | 44 | <li class="divider"></li> | |
<li><a ui-sref="addclass">Add Class</a></li> | 45 | 45 | <li><a ui-sref="addclass">Add Class</a></li> | |
</ul> | 46 | 46 | </ul> | |
<li><a style="width:150px;" class="dropdown-button ng-cloak" href="#!" data-activates="dropdown1">{{currentSection.id?currentSection.short_name:"Classes"}}<i | 47 | 47 | <li><a style="width:175px;" class="dropdown-button ng-cloak" href="#!" data-activates="dropdown1">{{currentSection.id?currentSection.short_name:"Classes"}}<i | |
class="mdi-navigation-arrow-drop-down right"></i></a></li> | 48 | 48 | class="mdi-navigation-arrow-drop-down right"></i></a></li> | |
<li><a ui-sref="study">Study</a></li> | 49 | 49 | <li><a ui-sref="study">Study</a></li> | |
<li><a ui-sref="logout">Logout</a></li> | 50 | 50 | <li><a ui-sref="logout">Logout</a></li> | |
</ul> | 51 | 51 | </ul> | |
52 | 52 | |||
<!-- Slide-in side-nav for small screens --> | 53 | 53 | <!-- Slide-in side-nav for small screens --> | |
<ul ng-show="UserService.isLoggedIn()" class="side-nav" id="mobile-demo"> | 54 | 54 | <ul ng-show="UserService.isLoggedIn()" class="side-nav" id="mobile-demo"> | |
<span ng-show="currentSection.id"> | 55 | 55 | <span ng-show="currentSection.id"> | |
<li ui-sref-active="active"><a ui-sref="feed({sectionId:currentSection.id})" class="tooltipped" | 56 | 56 | <li ui-sref-active="active"><a ui-sref="feed({sectionId:currentSection.id})" class="tooltipped" | |
><i | 57 | 57 | ><i | |
class="mdi-action-view-module left"></i>Feed</a></li> | 58 | 58 | class="mdi-action-view-module left"></i>Feed</a></li> | |
<li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | 59 | 59 | <li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | |
><i | 60 | 60 | ><i | |
class="mdi-action-view-carousel left"></i>Deck</a></li> | 61 | 61 | class="mdi-action-view-carousel left"></i>Deck</a></li> | |
<li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | 62 | 62 | <li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | |
><i | 63 | 63 | ><i | |
class="mdi-action-view-list left"></i>Card List</a> | 64 | 64 | class="mdi-action-view-list left"></i>Card List</a> | |
</li> | 65 | 65 | </li> | |
<hr> | 66 | 66 | <hr> | |
</span> | 67 | 67 | </span> | |
<!-- Collapsible menu for all the User's classes --> | 68 | 68 | <!-- Collapsible menu for all the User's classes --> | |
<ul class="collapsible" data-collapsible="accordion"> | 69 | 69 | <ul class="collapsible" data-collapsible="accordion"> | |
<li class="bold"> | 70 | 70 | <li class="bold"> | |
<a class="collapsible-header black-text"> | 71 | 71 | <a class="collapsible-header black-text"> | |
Classes<i | 72 | 72 | Classes<i | |
class="mdi-navigation-arrow-drop-down right"></i> | 73 | 73 | class="mdi-navigation-arrow-drop-down right"></i> | |
</a> | 74 | 74 | </a> | |
</li> | 75 | 75 | </li> | |
<div class="collapsible-body" style="display: block"> | 76 | 76 | <div class="collapsible-body" style="display: block"> | |
<ul> | 77 | 77 | <ul> | |
<li ui-sref-active="active" ng-repeat="section in UserService.getUserData().sections"> | 78 | 78 | <li ui-sref-active="active" ng-repeat="section in UserService.getUserData().sections"> | |
<a class="class bold" ui-sref="feed({sectionId:section.id})">{{section.short_name}}</a> | 79 | 79 | <a class="class bold" ui-sref="feed({sectionId:section.id})">{{section.short_name}}</a> | |
</li> | 80 | 80 | </li> | |
<hr> | 81 | 81 | <hr> | |
<li><a ui-sref="addclass"><i class="tiny mdi-content-add">Add Class</i></a></li> | 82 | 82 | <li><a ui-sref="addclass"><i class="tiny mdi-content-add">Add Class</i></a></li> | |
</ul> | 83 | 83 | </ul> | |
</div> | 84 | 84 | </div> | |
</ul> | 85 | 85 | </ul> | |
<li><a ui-sref="study">Study</a></li> | 86 | 86 | <li><a ui-sref="study">Study</a></li> | |
<li><a ui-sref="logout">Logout</a></li> | 87 | 87 | <li><a ui-sref="logout">Logout</a></li> | |
</ul> | 88 | 88 | </ul> | |
</div> | 89 | 89 | </div> | |
</nav> | 90 | 90 | </nav> | |
91 | 91 | |||
</header> | 92 | 92 | </header> | |
93 | 93 | |||
94 | 94 | |||
<!-- Menu Bar --> | 95 | 95 | <!-- Menu Bar --> | |
<main ui-view></main> | 96 | 96 | <main ui-view></main> | |
97 | 97 | |||
98 | 98 | |||
<footer class="page-footer"> | 99 | 99 | <footer class="page-footer"> | |
<div class="footer-copyright"> | 100 | 100 | <div class="footer-copyright"> | |
<div class="container"> | 101 | 101 | <div class="container"> | |
© 2015 Team Swag | 102 | 102 | © 2015 Team Swag | |
<a class="grey-text text-lighten-4 right" href="mailto:halp@flashy.cards">Concerns? Contact us by email!</a> | 103 | 103 | <a class="grey-text text-lighten-4 right" href="mailto:halp@flashy.cards">Concerns? Contact us by email!</a> | |
</div> | 104 | 104 | </div> | |
</div> | 105 | 105 | </div> | |
</footer> | 106 | 106 | </footer> | |
107 | 107 | |||
</body> | 108 | 108 | </body> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script> | 109 | 109 | <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.14/angular-ui-router.js"></script> | 110 | 110 | <script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.14/angular-ui-router.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-cookies.js"></script> | 111 | 111 | <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-cookies.js"></script> | |
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script> | 112 | 112 | <script src="//code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script type="text/javascript" src="scripts/materialize.js"></script> | 113 | 113 | <script type="text/javascript" src="scripts/materialize.js"></script> | |
<script type="text/javascript" src="scripts/jquery.collapsible.js"></script> | 114 | 114 | <script type="text/javascript" src="scripts/jquery.collapsible.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.0/angular-material.min.js"></script> | 115 | 115 | <script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.0/angular-material.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script> | 116 | 116 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script> | 117 | 117 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-resource.min.js"></script> | 118 | 118 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-resource.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.4/angular-filter.js"></script> | 119 | 119 | <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.4/angular-filter.js"></script> | |
120 | 120 | |||
121 | 121 | |||
<script src="config.js"></script> | 122 | 122 | <script src="config.js"></script> | |
123 | 123 | |||
<!-- Controllers --> | 124 | 124 | <!-- Controllers --> | |
<script src="scripts/FeedController.js"></script> | 125 | 125 | <script src="scripts/FeedController.js"></script> | |
<script src="scripts/RootController.js"></script> | 126 | 126 | <script src="scripts/RootController.js"></script> | |
<script src="scripts/LoginController.js"></script> | 127 | 127 | <script src="scripts/LoginController.js"></script> | |
<script src="scripts/LogoutController.js"></script> | 128 | 128 | <script src="scripts/LogoutController.js"></script> | |
<script src="scripts/DeckController.js"></script> | 129 | 129 | <script src="scripts/DeckController.js"></script> | |
<script src="scripts/RequestResetController.js"></script> | 130 | 130 | <script src="scripts/RequestResetController.js"></script> | |
<script src="scripts/ClassAddController.js"></script> | 131 | 131 | <script src="scripts/ClassAddController.js"></script> | |
<script src="scripts/StudyController.js"></script> | 132 | 132 | <script src="scripts/StudyController.js"></script> | |
<script src="scripts/ResetPasswordController.js"></script> | 133 | 133 | <script src="scripts/ResetPasswordController.js"></script> |
scripts/RequestResetController.js
View file @
a97841d
angular.module('flashy.RequestResetController', ['ui.router']). | 1 | 1 | angular.module('flashy.RequestResetController', ['ui.router']). | |
2 | 2 | |||
controller('RequestResetController', ['$scope', '$state', '$http', | 3 | 3 | controller('RequestResetController', function($scope, $state, $http) { | |
function($scope, $state, $http) { | 4 | 4 | $scope.success = false; | |
'use strict'; | 5 | 5 | $scope.error = false; | |
$scope.success = false; | 6 | 6 | $scope.resetPass = function(email) { | |
$scope.error = false; | 7 | 7 | $http.post('/api/request_password_reset/', {email: email}). | |
$scope.resetPass = function(email) { | 8 | 8 | success(function(data) { | |
$http.post('/api/request_password_reset/', JSON.stringify({ | 9 | 9 | $scope.success = true; | |
'email': email | 10 | 10 | //$state.go('requestresetsuccess'); | |
})). | 11 | 11 | console.log('SUCCESS'); | |
success(function(data) { | 12 | 12 | console.log(data); | |
$scope.success = true; | 13 | 13 | }). | |
//$state.go('requestresetsuccess'); | 14 | 14 | error(function(data, status, header, config) { | |
console.log('SUCCESS'); | 15 | 15 | if (data.email) { | |
console.log(data); | 16 | 16 | $scope.error = true; | |
}). | 17 | 17 | } | |
error(function(data, status, header, config) { | 18 | 18 | console.log('ERROR'); | |
if (data.email) { | 19 | 19 | console.log(data); | |
$scope.error = true; | 20 | 20 | }); | |
} | 21 | 21 | }; | |
console.log('ERROR'); | 22 | |||
console.log(data); | 23 | |||
}); | 24 | |||
}; | 25 | |||
26 | 22 | |||
$scope.cancelReset = function() { | 27 | 23 | $scope.cancelReset = function() { | |
$state.go('login'); | 28 | 24 | $state.go('login'); | |
}; | 29 | 25 | }; | |
}]); | 30 | 26 | }); | |
31 | 27 | |||
templates/requestpasswordreset.html
View file @
a97841d
<div class="row" ng-show="success"> | 1 | 1 | <div class="row" ng-show="success"> | |
<h1>Request sent!</h1> | 2 | 2 | <h1>Request sent!</h1> | |
<h1>Check your email in a few minutes.</h1> | 3 | 3 | <h1>Check your email in a few minutes.</h1> | |
</div> | 4 | 4 | </div> | |
5 | 5 | |||
<div class="row" ng-hide="success"> | 6 | 6 | <div class="row" ng-hide="success"> | |
<div class="offset-s2 col s8"> | 7 | 7 | <div class="offset-s2 col s8"> | |
<div class="card"> | 8 | 8 | <div class="card"> | |
<form class="col s12" name="passreset_form"> | 9 | 9 | <form class="col s12" name="passreset_form"> | |
<div class="card-content"> | 10 | 10 | <div class="card-content"> | |
<h2>Reset Password</h2> | 11 | 11 | <h2>Reset Password</h2> | |
</div> | 12 | 12 | </div> | |
13 | 13 | |||
<div class="divider"></div> | 14 | 14 | <div class="divider"></div> | |
<div name="passreset" class="card-content"> | 15 | 15 | <div name="passreset" class="card-content"> | |
<div class="section"> | 16 | 16 | <div class="section"> | |
<div ng-show="error" role="error"> | 17 | 17 | <div ng-show="error" role="error"> | |
<i style="color:#8E2323" class="mdi-alert-error"></i> | 18 | 18 | <i style="color:#8E2323" class="mdi-alert-error"></i> | |
<span style="color:#8E2323">Enter a valid email!</span> | 19 | 19 | <span style="color:#8E2323">Enter a valid email!</span> | |
</div> | 20 | 20 | </div> | |
</div> | 21 | 21 | </div> | |
<!--FORM INPUT--> | 22 | 22 | <!--FORM INPUT--> | |
<div class="input-field"> | 23 | 23 | <div class="input-field"> | |
<label for="email">Enter Your Email</label> | 24 | 24 | <label for="email">Enter Your Email</label> | |
<input id="email" type="email" class="form-control" ng-model="user_email" placeholder="" required /> | 25 | 25 | <input id="email" type="email" class="form-control" ng-model="user_email" placeholder="" required /> | |
</div> | 26 | 26 | </div> | |
</div> | 27 | 27 | </div> | |
28 | 28 | |||
<div class="card-action"> | 29 | 29 | <div class="card-action"> | |
30 | <button class="btn waves-effect waves-light green right" type="submit" name="action" | |||
31 | ng-click="resetPass(user_email)">Reset</button> | |||
<button class="btn waves-effect waves-light red" type="submit" name="action" | 30 | 32 | <button class="btn waves-effect waves-light red" type="submit" name="action" | |
ng-click="cancelReset()">Cancel</button> | 31 | 33 | ng-click="cancelReset()">Cancel</button> | |
<button class="btn waves-effect waves-light green right" type="submit" name="action" | 32 | 34 | ||
ng-click="resetPass(user_email)">Reset</button> | 33 | |||
</div> | 34 | 35 | </div> | |
</form> | 35 | 36 | </form> | |
</div> | 36 | 37 | </div> |