Commit b485ee35d5fbc20360258c1ee5711696bb0d5605
1 parent
35387f3081
Exists in
master
and in
1 other branch
more tweaks
Showing 5 changed files with 43 additions and 44 deletions Inline Diff
home.html
View file @
b485ee3
<!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="user" href="#" data-activates="mobile-demo" class="left button-collapse hide-on-med-and-up"><i | 19 | 19 | <a ng-show="UserService.isLoggedIn()" href="#" data-activates="mobile-demo" class="left button-collapse hide-on-med-and-up"><i | |
class="mdi-navigation-menu"></i></a> | 20 | 20 | class="mdi-navigation-menu"></i></a> | |
<ul ng-show="currentSection.id && UserService.isLoggedIn()" class="left hide-on-small-and-down"> | 21 | 21 | <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" | 22 | 22 | <li ui-sref-active="active"><a ui-sref="feed({sectionId:currentSection.id})" class="tooltipped" | |
data-position="bottom" | 23 | 23 | data-position="bottom" | |
data-delay="50" data-tooltip="Feed"><i | 24 | 24 | data-delay="50" data-tooltip="Feed"><i | |
class="mdi-action-view-module"></i></a></li> | 25 | 25 | class="mdi-action-view-module"></i></a></li> | |
<li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | 26 | 26 | <li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | |
data-position="bottom" | 27 | 27 | data-position="bottom" | |
data-delay="50" data-tooltip="Deck"><i | 28 | 28 | data-delay="50" data-tooltip="Deck"><i | |
class="mdi-action-view-carousel"></i></a></li> | 29 | 29 | class="mdi-action-view-carousel"></i></a></li> | |
<li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | 30 | 30 | <li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | |
data-position="bottom" | 31 | 31 | data-position="bottom" | |
data-delay="50" data-tooltip="Card List"><i | 32 | 32 | data-delay="50" data-tooltip="Card List"><i | |
class="mdi-action-view-list"></i></a></li> | 33 | 33 | class="mdi-action-view-list"></i></a></li> | |
</ul> | 34 | 34 | </ul> | |
<a href="#" class="brand-logo center">Flashy</a> | 35 | 35 | <a href="#" class="brand-logo center">Flashy</a> | |
36 | 36 | |||
<ul ng-show="UserService.isLoggedIn()" id="nav-mobile" class="right hide-on-small-and-down"> | 37 | 37 | <ul ng-show="UserService.isLoggedIn()" id="nav-mobile" class="right hide-on-small-and-down"> | |
<!-- User's classes dropdown --> | 38 | 38 | <!-- User's classes dropdown --> | |
<ul id="dropdown1" class="dropdown-content"> | 39 | 39 | <ul id="dropdown1" class="dropdown-content"> | |
<li ui-sref-active="active" ng-repeat="section in UserService.getUserData().sections"> | 40 | 40 | <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> | 41 | 41 | <a class="class bold" ui-sref="feed({sectionId:section.id})">{{section.short_name}}</a> | |
</li> | 42 | 42 | </li> | |
<li class="divider"></li> | 43 | 43 | <li class="divider"></li> | |
<li><a ui-sref="addclass">Add Class</a></li> | 44 | 44 | <li><a ui-sref="addclass">Add Class</a></li> | |
</ul> | 45 | 45 | </ul> | |
<li><a class="dropdown-button ng-cloak" href="#!" data-activates="dropdown1">{{currentSection.id?currentSection.short_name:"Classes"}}<i | 46 | 46 | <li><a 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> | 47 | 47 | class="mdi-navigation-arrow-drop-down right"></i></a></li> | |
<li><a ui-sref="study">Study</a></li> | 48 | 48 | <li><a ui-sref="study">Study</a></li> | |
<li><a ui-sref="logout">Logout</a></li> | 49 | 49 | <li><a ui-sref="logout">Logout</a></li> | |
</ul> | 50 | 50 | </ul> | |
51 | 51 | |||
<!-- Slide-in side-nav for small screens --> | 52 | 52 | <!-- Slide-in side-nav for small screens --> | |
<ul class="side-nav" id="mobile-demo"> | 53 | 53 | <ul ng-show="UserService.isLoggedIn()" class="side-nav" id="mobile-demo"> | |
<span ng-show="currentSection.id && UserService.isLoggedIn()"> | 54 | 54 | <span ng-show="currentSection.id"> | |
<li ui-sref-active="active"><a ui-sref="feed({sectionId:currentSection.id})" class="tooltipped" | 55 | 55 | <li ui-sref-active="active"><a ui-sref="feed({sectionId:currentSection.id})" class="tooltipped" | |
><i | 56 | 56 | ><i | |
class="mdi-action-view-module left"></i>Feed</a></li> | 57 | 57 | class="mdi-action-view-module left"></i>Feed</a></li> | |
<li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | 58 | 58 | <li ui-sref-active="active"><a ui-sref="deck({sectionId:currentSection.id})" class="tooltipped" | |
><i | 59 | 59 | ><i | |
class="mdi-action-view-carousel left"></i>Deck</a></li> | 60 | 60 | class="mdi-action-view-carousel left"></i>Deck</a></li> | |
<li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | 61 | 61 | <li ui-sref-active="active"><a ui-sref="cardlist({sectionId:currentSection.id})" class="tooltipped" | |
><i | 62 | 62 | ><i | |
class="mdi-action-view-list left"></i>Card List</a> | 63 | 63 | class="mdi-action-view-list left"></i>Card List</a> | |
</li> | 64 | 64 | </li> | |
<hr> | 65 | 65 | <hr> | |
</span> | 66 | 66 | </span> | |
<!-- Collapsible menu for all the User's classes --> | 67 | 67 | <!-- Collapsible menu for all the User's classes --> | |
<ul class="collapsible" data-collapsible="accordion"> | 68 | 68 | <ul class="collapsible" data-collapsible="accordion"> | |
<li class="bold"> | 69 | 69 | <li class="bold"> | |
<a class="collapsible-header black-text"> | 70 | 70 | <a class="collapsible-header black-text"> | |
Classes<i | 71 | 71 | Classes<i | |
class="mdi-navigation-arrow-drop-down right"></i> | 72 | 72 | class="mdi-navigation-arrow-drop-down right"></i> | |
</a> | 73 | 73 | </a> | |
</li> | 74 | 74 | </li> | |
<div class="collapsible-body" style="display: block"> | 75 | 75 | <div class="collapsible-body" style="display: block"> | |
<ul> | 76 | 76 | <ul> | |
<li ui-sref-active="active" ng-repeat="section in sections"> | 77 | 77 | <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> | 78 | 78 | <a class="class bold" ui-sref="feed({sectionId:section.id})">{{section.short_name}}</a> | |
</li> | 79 | 79 | </li> | |
<hr> | 80 | 80 | <hr> | |
<li><a ui-sref="addclass"><i class="tiny mdi-content-add"> Add Class</i></a></li> | 81 | 81 | <li><a ui-sref="addclass"><i class="tiny mdi-content-add"> Add Class</i></a></li> | |
</ul> | 82 | 82 | </ul> | |
</div> | 83 | 83 | </div> | |
</ul> | 84 | 84 | </ul> | |
<li><a ui-sref="study">Study</a></li> | 85 | 85 | <li><a ui-sref="study">Study</a></li> | |
<li><a ui-sref="logout">Logout</a></li> | 86 | 86 | <li><a ui-sref="logout">Logout</a></li> | |
</ul> | 87 | 87 | </ul> | |
</div> | 88 | 88 | </div> | |
</nav> | 89 | 89 | </nav> | |
90 | 90 | |||
</header> | 91 | 91 | </header> | |
92 | 92 | |||
93 | 93 | |||
<!-- Menu Bar --> | 94 | 94 | <!-- Menu Bar --> | |
<main ui-view></main> | 95 | 95 | <main ui-view></main> | |
<footer class="page-footer"> | 96 | 96 | <footer class="page-footer"> | |
<div class="footer-copyright"> | 97 | 97 | <div class="footer-copyright"> | |
<div class="container"> | 98 | 98 | <div class="container"> | |
Concerns? Contact us by <a class="grey-text text-lighten-4" href="mailto:halp@flashy.cards">email</a>! | 99 | 99 | Concerns? Contact us by <a class="grey-text text-lighten-4" href="mailto:halp@flashy.cards">email</a>! | |
</div> | 100 | 100 | </div> | |
</div> | 101 | 101 | </div> | |
</footer> | 102 | 102 | </footer> | |
</body> | 103 | 103 | </body> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script> | 104 | 104 | <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> | 105 | 105 | <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> | 106 | 106 | <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> | 107 | 107 | <script src="//code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script type="text/javascript" src="scripts/materialize.js"></script> | 108 | 108 | <script type="text/javascript" src="scripts/materialize.js"></script> | |
<script type="text/javascript" src="scripts/jquery.collapsible.js"></script> | 109 | 109 | <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> | 110 | 110 | <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> | 111 | 111 | <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> | 112 | 112 | <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> | 113 | 113 | <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> | 114 | 114 | <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.4/angular-filter.js"></script> | |
115 | 115 | |||
116 | 116 | |||
<script src="config.js"></script> | 117 | 117 | <script src="config.js"></script> | |
118 | 118 | |||
<!-- Controllers --> | 119 | 119 | <!-- Controllers --> | |
<script src="scripts/FeedController.js"></script> | 120 | 120 | <script src="scripts/FeedController.js"></script> | |
<script src="scripts/RootController.js"></script> | 121 | 121 | <script src="scripts/RootController.js"></script> | |
<script src="scripts/LoginController.js"></script> | 122 | 122 | <script src="scripts/LoginController.js"></script> | |
<script src="scripts/LogoutController.js"></script> | 123 | 123 | <script src="scripts/LogoutController.js"></script> | |
<script src="scripts/DeckController.js"></script> | 124 | 124 | <script src="scripts/DeckController.js"></script> | |
<script src="scripts/RequestResetController.js"></script> | 125 | 125 | <script src="scripts/RequestResetController.js"></script> | |
<script src="scripts/ClassAddController.js"></script> | 126 | 126 | <script src="scripts/ClassAddController.js"></script> | |
<script src="scripts/StudyController.js"></script> | 127 | 127 | <script src="scripts/StudyController.js"></script> | |
<script src="scripts/ResetPasswordController.js"></script> | 128 | 128 | <script src="scripts/ResetPasswordController.js"></script> | |
<script src="scripts/CardListController.js"></script> | 129 | 129 | <script src="scripts/CardListController.js"></script> | |
<script src="scripts/VerifyEmailController.js"></script> | 130 | 130 | <script src="scripts/VerifyEmailController.js"></script> | |
<!--<script src="scripts/SidebarController.js"></script>--> | 131 | 131 | <!--<script src="scripts/SidebarController.js"></script>--> | |
132 | 132 | |||
<!-- Services --> | 133 | 133 | <!-- Services --> |
scripts/LoginController.js
View file @
b485ee3
angular.module('flashy.LoginController', ['ui.router']). | 1 | 1 | angular.module('flashy.LoginController', ['ui.router']). | |
2 | 2 | |||
controller('LoginController', ['$rootScope', '$scope', '$state', '$http', 'UserService', | 3 | 3 | controller('LoginController', ['$rootScope', '$scope', '$state', '$http', 'UserService', | |
function($rootScope, $scope, $state, $http, UserService) { | 4 | 4 | function($rootScope, $scope, $state, $http, UserService) { | |
'use strict'; | 5 | 5 | 'use strict'; | |
// If we're logged in, there's nothing to do here | 6 | 6 | // If we're logged in, there's nothing to do here | |
if (UserService.isLoggedIn()) $state.go('addclass'); | 7 | 7 | if (UserService.isLoggedIn()) $state.go('addclass'); | |
$scope.uniqueError = false; | 8 | 8 | $scope.uniqueError = false; | |
$scope.loginError = false; | 9 | 9 | $scope.loginError = false; | |
$scope.login = function(email, password) { | 10 | 10 | $scope.login = function(email, password) { | |
$http.post('/api/login/', JSON.stringify({ | 11 | 11 | $http.post('/api/login/', JSON.stringify({ | |
'email': email, | 12 | 12 | 'email': email, | |
'password': password | 13 | 13 | 'password': password | |
})). | 14 | 14 | })). | |
success(function(data) { | 15 | 15 | success(function(data) { | |
UserService.setUserData(data); | 16 | 16 | UserService.login(data); | |
if (angular.isDefined($scope.returnToState)) | 17 | 17 | if (angular.isDefined($scope.returnToState)) | |
$state.go($scope.returnToState.name, $scope.returnToStateParams); | 18 | 18 | $state.go($scope.returnToState.name, $scope.returnToStateParams); | |
else $state.go('addclass'); | 19 | 19 | else $state.go('addclass'); | |
console.log(data); | 20 | 20 | console.log(data); | |
}). | 21 | 21 | }). | |
error(function(data, status, header, config) { | 22 | 22 | error(function(data, status, header, config) { | |
if (data.detail) { // assume 'invalid email or pass' | 23 | 23 | if (data.detail) { // assume 'invalid email or pass' | |
$scope.loginError = true; | 24 | 24 | $scope.loginError = true; | |
} | 25 | 25 | } | |
console.log(data); | 26 | 26 | console.log(data); | |
}); | 27 | 27 | }); | |
}; | 28 | 28 | }; | |
$scope.signUp = function(email, password) { | 29 | 29 | $scope.signUp = function(email, password) { | |
$http.post('/api/register/', JSON.stringify({ | 30 | 30 | $http.post('/api/register/', JSON.stringify({ | |
'email': email, | 31 | 31 | 'email': email, | |
'password': password | 32 | 32 | 'password': password | |
})). | 33 | 33 | })). | |
success(function(data) { | 34 | 34 | success(function(data) { | |
console.log(data); | 35 | 35 | console.log(data); | |
if (angular.isDefined($scope.returnToState)) | 36 | 36 | if (angular.isDefined($scope.returnToState)) | |
$state.go($scope.returnToState.name, $scope.returnToStateParams); | 37 | 37 | $state.go($scope.returnToState.name, $scope.returnToStateParams); | |
else $state.go('addclass'); | 38 | 38 | else $state.go('addclass'); | |
39 | 39 | |||
}). | 40 | 40 | }). | |
error(function(data, status, headers, config) { | 41 | 41 | error(function(data, status, headers, config) { | |
console.log(data.email); | 42 | 42 | console.log(data.email); | |
if (data.email == 'This field is required.') { | 43 | 43 | if (data.email == 'This field is required.') { | |
$scope.invalid = true; | 44 | 44 | $scope.invalid = true; | |
$scope.uniqueError = false; | 45 | 45 | $scope.uniqueError = false; | |
} else if (data.email == 'This field must be unique.') { | 46 | 46 | } else if (data.email == 'This field must be unique.') { | |
// assume 'email not unique' error | 47 | 47 | // assume 'email not unique' error | |
$scope.uniqueError = true; | 48 | 48 | $scope.uniqueError = true; | |
$scope.invalid = false; | 49 | 49 | $scope.invalid = false; | |
} | 50 | 50 | } | |
console.log(data); | 51 | 51 | console.log(data); | |
}); | 52 | 52 | }); | |
53 | 53 | |||
}; | 54 | 54 | }; | |
$scope.triggerPasswordReset = function() { | 55 | 55 | $scope.triggerPasswordReset = function() { | |
$state.go('requestpasswordreset'); | 56 | 56 | $state.go('requestpasswordreset'); | |
}; | 57 | 57 | }; | |
$(document).ready(function() { | 58 | 58 | $(document).ready(function() { | |
$('ul.tabs').tabs(); | 59 | 59 | $('ul.tabs').tabs(); | |
}); | 60 | 60 | }); |
scripts/UserService.js
View file @
b485ee3
angular.module('flashy.UserService', ['ui.router']). | 1 | 1 | angular.module('flashy.UserService', ['ui.router']). | |
service('UserService', function($rootScope, $http, $q) { | 2 | 2 | service('UserService', function($rootScope, $http, $q) { | |
var deferred = $q.defer(); | 3 | 3 | var deferred = $q.defer(); | |
var _user = false; | 4 | 4 | var _user = false; | |
$http.get('/api/me/').success(function(data) { | 5 | 5 | $http.get('/api/me/').success(function(data) { | |
console.log('user is logged in!'); | 6 | 6 | console.log('user is logged in!'); | |
_user = data; | 7 | 7 | _user = data; | |
deferred.resolve(data); | 8 | 8 | deferred.resolve(data); | |
}).error(function(data) { | 9 | 9 | }).error(function(data) { | |
console.log(data); | 10 | 10 | console.log(data); | |
console.log('not logged in yet: ' + data.detail); | 11 | 11 | console.log('not logged in yet: ' + data.detail); | |
deferred.resolve({email: false}); | 12 | 12 | _user = {email:false}; | |
13 | deferred.resolve(_user); | |||
}); | 13 | 14 | }); | |
14 | 15 | |||
this.isResolved = function() { | 15 | 16 | this.isResolved = function() { | |
return !!_user; | 16 | 17 | return !!_user; | |
}; | 17 | 18 | }; | |
this.getUserData = function() { | 18 | 19 | this.getUserData = function() { | |
if (this.isResolved()) return _user; | 19 | 20 | if (this.isResolved()) return _user; | |
else return deferred.promise; | 20 | 21 | else return deferred.promise; | |
}; | 21 | 22 | }; | |
this.setUserData = function(data) { | 22 | 23 | this.login = function(data) { | |
_user = data; | 23 | 24 | _user = data; | |
deferred.resolve(data); | 24 | 25 | deferred.resolve(data); | |
}; | 25 | 26 | }; | |
this.logout = function() { | 26 | 27 | this.logout = function() { | |
_user = false; | 27 | 28 | _user = false; | |
deferred.resolve({}); | 28 | 29 | deferred.resolve({}); | |
}; | 29 | 30 | }; | |
this.isLoggedIn = function() { | 30 | 31 | this.isLoggedIn = function() { | |
rv = this.isResolved() && _user.email; | 31 | 32 | rv = this.isResolved() && _user.email; | |
return rv; | 32 | 33 | return rv; | |
}; | 33 | 34 | }; | |
}); | 34 | 35 | }); | |
35 | 36 |
templates/addclass.html
View file @
b485ee3
<div class=""> | 1 | 1 | <div class="" style="margin-top:32px;"> | |
<div class="row" style="margin-top:64px;"> | 2 | 2 | <div class="row" style="max-width:800px; width:90%; min-width:512px; margin: 0 auto"> | |
<div class="offset-m2 col m8"> | 3 | 3 | <h2 class="header">Add a class</h2> | |
<h2 class="header">Add a class</h2> | 4 | 4 | <md-content layout-padding="" layout="column" style="overflow:hidden"> | |
<md-content layout-padding="" layout="column" style="overflow:hidden"> | 5 | |||
6 | 5 | |||
<form ng-submit="$event.preventDefault()"> | 7 | 6 | <form ng-submit="$event.preventDefault()"> | |
<div layout="row"> | 8 | 7 | <div layout="row"> | |
<md-autocomplete flex="" | 9 | 8 | <md-autocomplete flex="" | |
md-autofocus="true" | 10 | 9 | md-autofocus="true" | |
md-selected-item="selectedItem" | 11 | 10 | md-selected-item="selectedItem" | |
md-search-text="searchText" | 12 | 11 | md-search-text="searchText" | |
md-items="item in trySearch(searchText)" | 13 | 12 | md-items="item in trySearch(searchText)" | |
md-item-text="item.short_name" | 14 | 13 | md-item-text="item.short_name" | |
md-selected-item-change="selectObject(event)" | 15 | 14 | md-selected-item-change="selectObject(event)" | |
md-autoselect="true" | 16 | 15 | md-autoselect="true" | |
> | 17 | 16 | > | |
<md-item-template> | 18 | 17 | <md-item-template> | |
<div layout="row"> | 19 | 18 | <div layout="row"> | |
<div>{{item.short_name}}: {{item.course_title}} | 20 | 19 | <div>{{item.short_name}}: {{item.course_title}} | |
({{item.instructor}}) | 21 | 20 | ({{item.instructor}}) | |
</div> | 22 | |||
<div style="margin-left:auto;text-align:right;padding-left:30px"> | 23 | |||
{{item.lecture_times}} | 24 | |||
</div> | 25 | |||
</div> | 26 | 21 | </div> | |
</md-item-template> | 27 | 22 | <div style="margin-left:auto;text-align:right;padding-left:30px"> | |
<md-not-found> | 28 | 23 | {{item.lecture_times}} | |
No classes match "{{searchText}}". | 29 | 24 | </div> | |
</md-not-found> | 30 | 25 | </div> | |
</md-autocomplete> | 31 | 26 | </md-item-template> | |
<button class="btn waves-effect waves-light" type="submit" name="add" ng-click="submit()">Add | 32 | 27 | <md-not-found> | |
<i class="mdi-content-add right"></i> | 33 | 28 | No classes match "{{searchText}}". | |
</button> | 34 | 29 | </md-not-found> | |
</div> | 35 | 30 | </md-autocomplete> | |
31 | <button class="btn waves-effect waves-light" type="submit" name="add" ng-click="submit()">Add | |||
32 | <i class="mdi-content-add right"></i> | |||
33 | </button> | |||
34 | </div> | |||
36 | 35 | |||
</form> | 37 | 36 | </form> | |
</md-content> | 38 | 37 | </md-content> | |
</div> | 39 | |||
</div> | 40 | 38 | </div> | |
</div> | 41 | 39 | </div> | |
42 | 40 | |||
templates/login.html
View file @
b485ee3
<div class="" style="margin-top:32px;"> | 1 | 1 | <div class="" style="margin-top:32px;"> | |
<div class="row" style="max-width:500px; width:50%;margin: 0 auto"> | 2 | 2 | <div class="row" style="max-width:512px; width:50%; min-width:256px; margin: 0 auto"> | |
<ul class="tabs"> | 3 | 3 | <ul class="tabs"> | |
<li class="tab col s6"><a href="#register-tab">Sign Up</a></li> | 4 | 4 | <li class="tab col s6"><a href="#register-tab">Sign Up</a></li> | |
<li class="tab col s6"><a class="active" href="#login-tab">Login</a></li> | 5 | 5 | <li class="tab col s6"><a class="active" href="#login-tab">Login</a></li> | |
</ul> | 6 | 6 | </ul> | |
<div class="card"> | 7 | 7 | <div class="card"> | |
<!--LOGIN TAB--> | 8 | 8 | <!--LOGIN TAB--> | |
<div id="login-tab" class="row col s12"> | 9 | 9 | <div id="login-tab" class="row col s12"> | |
<form id="login-form"> | 10 | 10 | <form id="login-form"> | |
<div class="card-content"> | 11 | 11 | <div class="card-content"> | |
<div class="check-element animate-show" role="alert" ng-show="loginError"> | 12 | 12 | <div class="check-element animate-show" role="alert" ng-show="loginError"> | |
<span style="color:#8E2323">Invalid username or password!!</span> | 13 | 13 | <span style="color:#8E2323">Invalid username or password!!</span> | |
</div> | 14 | 14 | </div> | |
15 | 15 | |||
<div class="input-field"> | 16 | 16 | <div class="input-field"> | |
<input id="email" type="email" name="login" class="validate" ng-model="loginEmail" required autofocus | 17 | 17 | <input id="email" type="email" name="login" class="validate" ng-model="loginEmail" required autofocus | |
autocomplete/> | 18 | 18 | autocomplete/> | |
<label for="email">Email</label> | 19 | 19 | <label for="email">Email</label> | |
</div> | 20 | 20 | </div> | |
<div class="input-field"> | 21 | 21 | <div class="input-field"> | |
<input id="password" type="password" name="password" class="validate" ng-model="loginPassword" required/> | 22 | 22 | <input id="password" type="password" name="password" class="validate" ng-model="loginPassword" required/> | |
<label for="password">Password</label> | 23 | 23 | <label for="password">Password</label> | |
</div> | 24 | 24 | </div> | |
</div> | 25 | 25 | </div> | |
<div class="card-action"> | 26 | 26 | <div class="card-action"> | |
<button class="btn waves-effect waves-light col s12" type="submit" name="action" | 27 | 27 | <button class="btn waves-effect waves-light col s12" type="submit" name="action" | |
ng-click="login(loginEmail, loginPassword)">Login | 28 | 28 | ng-click="login(loginEmail, loginPassword)">Login | |
</button> | 29 | 29 | </button> | |
</div> | 30 | 30 | </div> | |
</form> | 31 | 31 | </form> | |
</div> | 32 | 32 | </div> | |
<!--REGISTER TAB--> | 33 | 33 | <!--REGISTER TAB--> | |
<div id="register-tab" class="row col s12"> | 34 | 34 | <div id="register-tab" class="row col s12"> | |
<form> | 35 | 35 | <form> | |
<div class="card-content"> | 36 | 36 | <div class="card-content"> | |
<div class="check-element animate-show" role="alert" ng-show="uniqueError"> | 37 | 37 | <div class="check-element animate-show" role="alert" ng-show="uniqueError"> | |
<span style="color:#8E2323">Invalid username or password!</span> | 38 | 38 | <span style="color:#8E2323">Invalid username or password!</span> | |
</div> | 39 | 39 | </div> | |
<div class="input-field"> | 40 | 40 | <div class="input-field"> | |
<input id="email" type="email" class="validate" ng-model="registerEmail" required/> | 41 | 41 | <input id="email" type="email" class="validate" ng-model="registerEmail" required/> | |
<label for="email">Email</label> | 42 | 42 | <label for="email">Email</label> | |
</div> | 43 | 43 | </div> | |
<div class="input-field"> | 44 | 44 | <div class="input-field"> | |
<input type="password" class="validate" ng-model="registerPassword" required/> | 45 | 45 | <input type="password" class="validate" ng-model="registerPassword" required/> | |
<label for="password">Password</label> | 46 | 46 | <label for="password">Password</label> | |
</div> | 47 | 47 | </div> | |
</div> | 48 | 48 | </div> | |
<div class="card-action"> | 49 | 49 | <div class="card-action"> | |
<button class="btn waves-effect waves-light col s12" type="submit" name="action" | 50 | 50 | <button class="btn waves-effect waves-light col s12" type="submit" name="action" | |
ng-click="signUp(registerEmail, registerPassword)">Register | 51 | 51 | ng-click="signUp(registerEmail, registerPassword)">Register | |
</button> | 52 | 52 | </button> | |
</div> | 53 | 53 | </div> | |
</form> | 54 | 54 | </form> | |
</div> | 55 | 55 | </div> | |
<div class="row offset-s1 col s12"> | 56 | 56 | <div class="row offset-s1 col s12"> | |
<a class="trigger-password-reset" ng-click="triggerPasswordReset()" href="#">Forgot Password?</a> | 57 | 57 | <a class="trigger-password-reset" ng-click="triggerPasswordReset()" href="#">Forgot Password?</a> | |
</div> | 58 | 58 | </div> | |
</div> | 59 | 59 | </div> | |
</div> | 60 | 60 | </div> | |
</div> | 61 | 61 | </div> |