Commit 8a9a3e9396c394cd9f4bb291f81bc57c8327a4d7

Authored by Chung Wang

Merge branch 'master' of https://git.ucsd.edu/110swag/flashy-frontend

Showing 4 changed files Side-by-side Diff

... ... @@ -4,7 +4,6 @@
4 4 'flashy.FeedController',
5 5 'flashy.DeckController',
6 6 'flashy.ClassAddController',
7   - 'flashy.ClassDropController',
8 7 'flashy.RequestResetController',
9 8 'flashy.StudyController',
10 9 'flashy.UserService',
... ... @@ -107,12 +106,6 @@
107 106 url: '/addclass',
108 107 templateUrl: 'templates/addclass.html',
109 108 controller: 'ClassAddController'
110   - }).
111   - state('dropclass', {
112   - resolve: auth_resolve,
113   - url: '/settings/dropclass',
114   - templateUrl: 'templates/dropclass.html',
115   - controller: 'ClassDropController'
116 109 }).
117 110 state('deck', {
118 111 resolve: auth_resolve,
... ... @@ -170,7 +170,6 @@
170 170 <script src="scripts/DeckController.js"></script>
171 171 <script src="scripts/RequestResetController.js"></script>
172 172 <script src="scripts/ClassAddController.js"></script>
173   -<script src="scripts/ClassDropController.js"></script>
174 173 <script src="scripts/StudyController.js"></script>
175 174 <script src="scripts/ResetPasswordController.js"></script>
176 175 <script src="scripts/CardListController.js"></script>
scripts/ClassDropController.js View file @ 8a9a3e9
1   -angular.module('flashy.ClassDropController', ['ui.router']).
2   - controller('ClassDropController', function($rootScope, $resource, $scope, $state, $http, UserService) {
3   - $scope.hi = 'hi';
4   - $rootScope.SectionResource = $resource('/api/sections/:sectionId/');
5   - $rootScope.currentSection = {};
6   - $rootScope.UserService = UserService;
7   -
8   - $scope.dropClass = function(section) {
9   - $http.post('/api/sections/' + section.id + '/drop/').
10   - success(function(data) {
11   - console.log(section.short_name + ' dropped');
12   -
13   - Materialize.toast('Dropped', 3000, 'rounded');
14   - }).
15   - error(function(err) {
16   - console.log('no drop for you');
17   - });
18   - };
19   -
20   - });
templates/dropclass.html View file @ 8a9a3e9
1   -<div class="row">
2   - <div class="col s8 offset-s2">
3   - <div class="card-panel" id="dropClassForm">
4   -
5   - <h2>Enrolled Classes</h2>
6   - <div class="row" style="padding: 0px 25px">
7   - <table class="hoverable responsive-table">
8   - <thead>
9   - <tr>
10   - <th data-field="id">Class</th>
11   - <th data-field="drop">Drop?</th>
12   - </tr>
13   - </thead>
14   -
15   - <tbody>
16   - <tr ng-repeat="section in UserService.getUserData().sections">
17   - <td>
18   - <span>{{section.short_name}}</span>
19   - <p>{{section.long_name}}</p>
20   - </td>
21   - <td><a href="" ng-click="dropClass(section)"><i class="mdi-content-clear small"></i></a></td>
22   - </tr>
23   - </tbody>
24   - </table>
25   - </div>
26   - </div>
27   - </div>
28   -</div>