diff --git a/home.html b/home.html index 3ee4c9e..893b6d4 100644 --- a/home.html +++ b/home.html @@ -4,7 +4,7 @@ - + diff --git a/scripts/ClassAddController.js b/scripts/ClassAddController.js index 6fc0130..c0740e1 100644 --- a/scripts/ClassAddController.js +++ b/scripts/ClassAddController.js @@ -1,18 +1,18 @@ angular.module('flashy.ClassAddController', ['ui.router', 'angucomplete-alt', 'ngMaterial']). - controller('ClassAddController', ['$scope', '$state', '$http', function ($scope, $state, $http) { + controller('ClassAddController', ['$scope', '$state', '$http', function($scope, $state, $http) { - $scope.trySearch = function (searchText) { + $scope.trySearch = function(searchText) { return $http.get('/api/sections/search/', { params: { q: searchText } - }).then(function (response) { + }).then(function(response) { return response.data; - }) + }); }; - $scope.searchText = ""; + $scope.searchText = ''; /*$scope.trySearch = function() { $http.get('/api/sections/search', [$scope.searchText]). diff --git a/scripts/DeckController.js b/scripts/DeckController.js index dbe657a..6108541 100644 --- a/scripts/DeckController.js +++ b/scripts/DeckController.js @@ -1,43 +1,43 @@ var app = angular.module('flashy.DeckController', ['ui.router']); app.controller('DeckController', ['$scope', '$http', function($scope, $http) { - - + + $scope.cards = []; - - $scope.cards[0] = { "id": 1, "title": "title1", "content": "abc" }; - $scope.cards[1] = { "id": 2, "title": "title2", "content": "xyz" }; - $scope.cards[2] = { "id": 2, "title": "title3", "content": "qwe" }; + $scope.cards[0] = { 'id': 1, 'title': 'title1', 'content': 'abc' }; + $scope.cards[1] = { 'id': 2, 'title': 'title2', 'content': 'xyz' }; + $scope.cards[2] = { 'id': 2, 'title': 'title3', 'content': 'qwe' }; - $scope.removeCard = function (item) { + + $scope.removeCard = function(item) { var index = $scope.cards.indexOf(item); - $scope.cards.splice(index, 1); + $scope.cards.splice(index, 1); - alert("removed card"); - } + alert('removed card'); + }; $http.get('/api/sections/{pk}/deck'). - success(function (data) { + success(function(data) { for (var i = 0; i < data.length; i++) { - cards.push({ "title": data[i].title, "content": data[i].content }); + cards.push({ 'title': data[i].title, 'content': data[i].content }); } }). - error(function (data) { + error(function(data) { - console.log("no cards?!!"); + console.log('no cards?!!'); }); - + diff --git a/scripts/FeedController.js b/scripts/FeedController.js index 47a2a87..5e36375 100644 --- a/scripts/FeedController.js +++ b/scripts/FeedController.js @@ -20,19 +20,19 @@ angular.module('flashy.FeedController', ['ui.router']). console.log(pushed.toString()); // attempt to make card :( - $http.post('/api/flashcards/', {"text": $scope.text, "pushed": pushed, "mask": []}). + $http.post('/api/flashcards/', {'text': $scope.text, 'pushed': pushed, 'mask': []}). success(function(data) { - console.log("No way, really?"); + console.log('No way, really?'); }). error(function(error) { - console.log("haha, n00b"); + console.log('haha, n00b'); }); $scope.create = false; // hide make flashcard - $scope.text = ""; + $scope.text = ''; }; - $scope.flashcard = "hi i am a flashcard"; - $scope.text = ""; + $scope.flashcard = 'hi i am a flashcard'; + $scope.text = ''; }]); diff --git a/scripts/LoginController.js b/scripts/LoginController.js index 41633ba..cffbc51 100644 --- a/scripts/LoginController.js +++ b/scripts/LoginController.js @@ -1,38 +1,38 @@ angular.module('flashy.LoginController', ['ui.router']). controller('LoginController', ['$scope', '$state', '$http', 'UserService', - function ($scope, $state, $http, UserService) { + function($scope, $state, $http, UserService) { 'use strict'; $scope.uniqueError = false; $scope.loginError = false; - $scope.login = function (email, password) { + $scope.login = function(email, password) { $http.post('/api/login', JSON.stringify({ 'email': email, 'password': password })). - success(function (data) { + success(function(data) { UserService.getUserData(); $state.go('feed'); console.log(data); }). - error(function (data, status, header, config) { + error(function(data, status, header, config) { if (data.detail) { // assume 'invalid email or pass' $scope.loginError = true; } console.log(data); }); }; - $scope.signUp = function (email, password) { + $scope.signUp = function(email, password) { $http.post('/api/register', JSON.stringify({ 'email': email, 'password': password })). - success(function (data) { + success(function(data) { $state.go('feed'); console.log(data); }). - error(function (data, status, headers, config) { + error(function(data, status, headers, config) { console.log(data.email); if (data.email == 'This field is required.') { $scope.invalid = true; @@ -46,7 +46,7 @@ angular.module('flashy.LoginController', ['ui.router']). }); }; - $scope.triggerPasswordReset = function () { + $scope.triggerPasswordReset = function() { $state.go('requestpasswordreset'); }; } diff --git a/scripts/RootController.js b/scripts/RootController.js index 27ad04d..e2738c1 100644 --- a/scripts/RootController.js +++ b/scripts/RootController.js @@ -1,6 +1,6 @@ angular.module('flashy.RootController', ['ui.router']). - controller('RootController', ['$scope', '$state', 'UserService', function ($scope, $state, UserService) { + controller('RootController', ['$scope', '$state', 'UserService', function($scope, $state, UserService) { if (UserService.isLoggedIn()) $state.go('login'); else $state.go('addclass'); }]); diff --git a/templates/addclass.html b/templates/addclass.html index 6b33731..f85d86e 100644 --- a/templates/addclass.html +++ b/templates/addclass.html @@ -1,22 +1,29 @@ -
-
- -
- - - {{item.long_name}} - - - No matching classes found. - - +
+ +
+ + + +
+ + +
+
{{item.short_name}}: {{item.course_title}} ({{item.instructor}})
+
{{item.lecture_times}}
+
+
+ + No classes match "{{searchText}}". + +
+
-
+
\ No newline at end of file