Commit 742c7cd5f8e6029542158eba73b2429faecb70ae
1 parent
a2c4eb4fdf
Exists in
master
and in
1 other branch
'fixed' autocomplete. css still broke
Showing 3 changed files with 39 additions and 29 deletions Inline Diff
home.html
View file @
742c7cd
<!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> | |
<link type="text/css" rel="stylesheet" href="styles/materialize.min.css" media="screen,projection"/> | 5 | 5 | <link type="text/css" rel="stylesheet" href="styles/materialize.min.css" media="screen,projection"/> | |
<!--<link rel="stylesheet" href="styles/bootstrap-3.3.4-dist/css/bootstrap.css"/>--> | 6 | 6 | <!--<link rel="stylesheet" href="styles/bootstrap-3.3.4-dist/css/bootstrap.css"/>--> | |
7 | <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.3/angular-material.min.css"> | |||
8 | ||||
<link rel="stylesheet" href="flashy.css"/> | 7 | 9 | <link rel="stylesheet" href="flashy.css"/> | |
</head> | 8 | 10 | </head> | |
9 | 11 | |||
<body ng-controller="RootController"> | 10 | 12 | <body ng-controller="RootController"> | |
11 | 13 | |||
<ul id="nav" class="side-nav fixed"> | 12 | 14 | <ul id="nav" class="side-nav fixed"> | |
<li class="bold"><a ui-sref="login">Login</a></li> | 13 | 15 | <li class="bold"><a ui-sref="login">Login</a></li> | |
<li class="bold"><a ui-sref="addclass">Add Class</a></li> | 14 | 16 | <li class="bold"><a ui-sref="addclass">Add Class</a></li> | |
</ul> | 15 | 17 | </ul> | |
<div class="container" ui-view></div> | 16 | 18 | <div class="container" ui-view></div> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script> | 17 | 19 | <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> | 18 | 20 | <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> | 19 | 21 | <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> | 20 | 22 | <script src="//code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script type="text/javascript" src="scripts/materialize.min.js"></script> | 21 | 23 | <script type="text/javascript" src="scripts/materialize.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.0/angular-material.min.js"></script> | 22 | 24 | <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> | 23 | 25 | <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> | 24 | 26 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script> | |
25 | 27 | |||
<script src="config.js"></script> | 26 | 28 | <script src="config.js"></script> | |
27 | 29 | |||
<script src="scripts/FeedController.js"></script> | 28 | 30 | <script src="scripts/FeedController.js"></script> | |
<script src="scripts/RootController.js"></script> | 29 | 31 | <script src="scripts/RootController.js"></script> | |
<script src="scripts/LoginController.js"></script> | 30 | 32 | <script src="scripts/LoginController.js"></script> | |
<script src="scripts/LogoutController.js"></script> | 31 | 33 | <script src="scripts/LogoutController.js"></script> | |
<script src="scripts/DeckController.js"></script> | 32 | 34 | <script src="scripts/DeckController.js"></script> | |
<script src="scripts/RequestResetController.js"></script> | 33 | 35 | <script src="scripts/RequestResetController.js"></script> | |
<script src="scripts/ClassAddController.js"></script> | 34 | 36 | <script src="scripts/ClassAddController.js"></script> | |
<script src="scripts/StudyController.js"></script> | 35 | 37 | <!--<script src="scripts/StudyController.js"></script>--> | |
<script src="scripts/UserService.js"></script> | 36 | 38 | <script src="scripts/UserService.js"></script> | |
<script src="//ghiden.github.io/angucomplete-alt/js/libs/angucomplete-alt.js"></script> | 37 | 39 | <script src="//ghiden.github.io/angucomplete-alt/js/libs/angucomplete-alt.js"></script> |
scripts/ClassAddController.js
View file @
742c7cd
angular.module('flashy.ClassAddController', ['ui.router', 'angucomplete-alt', 'ngMaterial']). | 1 | 1 | angular.module('flashy.ClassAddController', ['ui.router', 'angucomplete-alt', 'ngMaterial']). | |
2 | 2 | |||
controller('ClassAddController', ['$scope', '$state', '$http', function($scope, $state, $http) { | 3 | 3 | controller('ClassAddController', ['$scope', '$state', '$http', function ($scope, $state, $http) { | |
4 | 4 | |||
$scope.trySearch = function() { | 5 | 5 | $scope.trySearch = function (searchText) { | |
return $http.get('/api/sections/search').then(function(response){ | 6 | 6 | return $http.get('/api/sections/search/', { | |
return response.data; | 7 | 7 | params: { | |
})}; | 8 | 8 | q: searchText | |
9 | } | |||
10 | }).then(function (response) { | |||
11 | return response.data; | |||
12 | }) | |||
13 | }; | |||
9 | 14 | |||
$scope.searchText = ""; | 10 | 15 | $scope.searchText = ""; | |
11 | 16 | |||
/*$scope.trySearch = function() { | 12 | 17 | /*$scope.trySearch = function() { | |
$http.get('/api/sections/search', [$scope.searchText]). | 13 | 18 | $http.get('/api/sections/search', [$scope.searchText]). | |
success(function(data) { | 14 | 19 | success(function(data) { | |
return data; | 15 | 20 | return data; | |
}). | 16 | 21 | }). | |
error(function(err) { | 17 | 22 | error(function(err) { | |
console.log('you eejit'); | 18 | 23 | console.log('you eejit'); | |
}); | 19 | 24 | }); | |
};*/ | 20 | 25 | };*/ | |
21 | 26 | |||
}]); | 22 | 27 | }]); | |
23 | 28 | |||
templates/addclass.html
View file @
742c7cd
<!DOCTYPE html> | 1 | |||
<div layout="column"> | 2 | 1 | <div layout="column"> | |
<md-content layout-padding layout="column"> | 3 | 2 | <div> | |
<form> | 4 | 3 | <md-content layout-padding layout="column"> | |
4 | <form> | |||
<md-autocomplete flex | 5 | 5 | <md-autocomplete flex | |
nd-no-cache="noCache" | 6 | 6 | nd-no-cache="noCache" | |
md-selected-item="selectedItem" | 7 | 7 | md-selected-item="selectedItem" | |
md-search-text="searchText" | 8 | 8 | md-search-text="searchText" | |
md-items="item in trySearch(searchText)" | 9 | 9 | md-items="item in trySearch(searchText)" | |
md-item-text="item.display" | 10 | 10 | md-item-text="item.short_name" | |
md-floating-label="Search Classes"> | 11 | 11 | md-floating-label="Search Classes"> | |
<span md-highlight-text="searchText">{{item.display}}</span> | 12 | 12 | <md-item-template> | |
<md-not-found> | 13 | 13 | <span md-highlight-text="searchText">{{item.long_name}}</span> | |
No matches found. | 14 | 14 | </md-item-template> | |
</md-not-found> | 15 | 15 | <md-not-found> | |
16 | No matching classes found. | |||
17 | </md-not-found> | |||
</md-autocomplete> | 16 | 18 | </md-autocomplete> | |
</form> | 17 | 19 | </form> | |
</md-content> | 18 | 20 | </md-content> | |
21 | </div> | |||
</div> | 19 | 22 | </div> | |
20 | 23 | |||