Commit bbba33088188129d4d637d565c3c738752f6383a
1 parent
4fc1728b4a
Exists in
master
and in
1 other branch
Added addclass stuff with autocomplete prototype
Showing 7 changed files with 87 additions and 29 deletions Side-by-side Diff
config.js
View file @
bbba330
... | ... | @@ -4,11 +4,12 @@ |
4 | 4 | 'flashy.HomeController', |
5 | 5 | 'flashy.FeedController', |
6 | 6 | 'flashy.DeckController', |
7 | - 'flashy.RequestResetController', | |
7 | + 'flashy.ClassAddController', | |
8 | + 'flashy.RequestResetController', | |
8 | 9 | 'ngCookies']). |
9 | 10 | config(['$stateProvider', '$urlRouterProvider', '$httpProvider', |
10 | 11 | '$locationProvider', |
11 | - function($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) { | |
12 | + function ($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) { | |
12 | 13 | 'use strict'; |
13 | 14 | $httpProvider.defaults.withCredentials = true; |
14 | 15 | $httpProvider.defaults.xsrfCookieName = 'csrftoken'; |
15 | 16 | |
... | ... | @@ -41,16 +42,21 @@ |
41 | 42 | templateUrl: 'templates/feed.html', |
42 | 43 | controller: 'FeedController' |
43 | 44 | }). |
45 | + state('addclass', { | |
46 | + url: '/classes/add', | |
47 | + templateUrl: 'templates/addclass.html', | |
48 | + controller: 'ClassAddController' | |
49 | + }). | |
44 | 50 | state('deck', { |
45 | 51 | url: '/deck', |
46 | 52 | templateUrl: 'templates/deck.html', |
47 | 53 | controller: 'DeckController' |
48 | 54 | }). |
49 | - state('requestpasswordreset', { | |
50 | - url: '/requestpasswordreset', | |
51 | - templateUrl: 'templates/requestpasswordreset.html', | |
52 | - controller: 'RequestResetController' | |
53 | - }); | |
55 | + state('requestpasswordreset', { | |
56 | + url: '/requestpasswordreset', | |
57 | + templateUrl: 'templates/requestpasswordreset.html', | |
58 | + controller: 'RequestResetController' | |
59 | + }); | |
54 | 60 | |
55 | 61 | }]); |
flashy.css
View file @
bbba330
... | ... | @@ -40,7 +40,35 @@ |
40 | 40 | |
41 | 41 | .container { |
42 | 42 | position: relative; |
43 | - width: 400px; | |
43 | + width: 600px; | |
44 | 44 | height: 80px; |
45 | +} | |
46 | + | |
47 | +.angucomplete-dropdown { | |
48 | + border-color: #ececec; | |
49 | + border-width: 1px; | |
50 | + border-style: solid; | |
51 | + border-radius: 2px; | |
52 | + /*width: 250px;*/ | |
53 | + padding: 6px; | |
54 | + cursor: pointer; | |
55 | + z-index: 9999; | |
56 | + position: absolute; | |
57 | + /*top: 32px; | |
58 | + left: 0px; | |
59 | + */ | |
60 | + margin-top: -6px; | |
61 | + background-color: #ffffff; | |
62 | +} | |
63 | + | |
64 | +.angucomplete-description { | |
65 | + font-size: 14px; | |
66 | +} | |
67 | + | |
68 | +.angucomplete-row { | |
69 | + padding: 5px; | |
70 | + color: #000000; | |
71 | + margin-bottom: 4px; | |
72 | + clear: both; | |
45 | 73 | } |
gjslint.conf
View file @
bbba330
home.html
View file @
bbba330
... | ... | @@ -18,7 +18,9 @@ |
18 | 18 | <div class="container" ui-view></div> |
19 | 19 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script> |
20 | 20 | <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.14/angular-ui-router.js"></script> |
21 | -<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-cookies.js"></script> | |
21 | +<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-cookies.js"></script> | |
22 | +<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |
23 | +<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> | |
22 | 24 | |
23 | 25 | <script src="config.js"></script> |
24 | 26 | |
... | ... | @@ -28,10 +30,8 @@ |
28 | 30 | <script src="scripts/LogoutController.js"></script> |
29 | 31 | <script src="scripts/DeckController.js"></script> |
30 | 32 | <script src="scripts/RequestResetController.js"></script> |
31 | - | |
32 | - | |
33 | - | |
34 | -<script src="scripts/jquery-2.1.3.min.js"></script> | |
33 | +<script src="scripts/ClassAddController.js"></script> | |
34 | +<script src="http://ghiden.github.io/angucomplete-alt/js/libs/angucomplete-alt.js"></script> | |
35 | 35 | <script src="scripts/bootstrap.js"></script> |
36 | 36 | |
37 | 37 | </body> |
scripts/ClassAddController.js
View file @
bbba330
scripts/FeedController.js
View file @
bbba330
1 | 1 | angular.module('flashy.FeedController', ['ui.router']). |
2 | 2 | |
3 | -controller('FeedController', ['$scope', '$state', function($scope, $state) { | |
4 | - console.log('Hello from feed'); | |
3 | + controller('FeedController', ['$scope', '$state', function ($scope, $state) { | |
4 | + console.log('Hello from feed'); | |
5 | 5 | |
6 | + $scope.createCard = function () { | |
6 | 7 | |
7 | - $scope.createCard = function () { | |
8 | + $(document).ready(function () { | |
9 | + $("#createCardModal").modal('show'); | |
10 | + }); | |
11 | + } | |
8 | 12 | |
9 | - $(document).ready(function () { | |
10 | - $("#createCardModal").modal('show'); | |
11 | - }); | |
12 | - } | |
13 | + $scope.viewDeck = function () { | |
14 | + $state.go('deck'); | |
15 | + console.log("go to deck"); | |
16 | + } | |
13 | 17 | |
14 | - | |
15 | - | |
16 | - $scope.viewDeck = function () { | |
17 | - $state.go('deck'); | |
18 | - console.log("go to deck"); | |
19 | - } | |
20 | - | |
21 | -}]); | |
18 | + }]); |
templates/addclass.html
View file @
bbba330
1 | +<div angucomplete-alt id="classes" | |
2 | + placeholder="Search classes" | |
3 | + pause="100" | |
4 | + selected-object="selectedClass" | |
5 | + remote-url="/api/sections/search/" | |
6 | + remote-url-request-formatter="remoteUrlRequestFn" , | |
7 | + remote-url-data-field="" , | |
8 | + title-field="short_name" , | |
9 | + description-field="long_name", | |
10 | + minlength="2", | |
11 | + pause="0", | |
12 | + input-class="form-control"/> | |
13 | +<div class="result"> | |
14 | + <div class="" ng-show="selectedCountry6"> | |
15 | + You selected <span class="bold-span">{{selectedClass.course_num}}</span> | |
16 | + which | |
17 | + has a country code of <span | |
18 | + class="bold-span">{{selectedClass.instructor}}</span> | |
19 | + </div> | |
20 | +</div> |