From 331ca39d260f407b607540153cdc15eccde98bba Mon Sep 17 00:00:00 2001 From: Melody Date: Mon, 1 Jun 2015 02:20:15 -0700 Subject: [PATCH] Crude Drop Class page --- config.js | 7 +++++++ home.html | 1 + scripts/CardListController.js | 1 - scripts/ClassDropController.js | 20 ++++++++++++++++++++ templates/cardlist.html | 2 +- templates/dropclass.html | 23 +++++++++++++++++++++++ 6 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 scripts/ClassDropController.js create mode 100644 templates/dropclass.html diff --git a/config.js b/config.js index a286816..9937d43 100644 --- a/config.js +++ b/config.js @@ -5,6 +5,7 @@ angular.module('flashy', [ 'flashy.FeedController', 'flashy.DeckController', 'flashy.ClassAddController', + 'flashy.ClassDropController', 'flashy.RequestResetController', 'flashy.StudyController', 'flashy.UserService', @@ -108,6 +109,12 @@ angular.module('flashy', [ templateUrl: 'templates/addclass.html', controller: 'ClassAddController' }). + state('dropclass', { + resolve: auth_resolve, + url: '/settings/dropclass', + templateUrl: 'templates/dropclass.html', + controller: 'ClassDropController' + }). state('deck', { resolve: auth_resolve, url: '/deck/{sectionId}', diff --git a/home.html b/home.html index 86b042a..b198a6c 100644 --- a/home.html +++ b/home.html @@ -164,6 +164,7 @@ + diff --git a/scripts/CardListController.js b/scripts/CardListController.js index 631d9f0..35679e2 100644 --- a/scripts/CardListController.js +++ b/scripts/CardListController.js @@ -199,7 +199,6 @@ filter('displayCard', function($sce) { if (start != card.mask.length - 1) cardText = cardText.concat(card.text.substring(start)); - //cardText = cardText.concat(""); return $sce.trustAsHtml(cardText); }; }); diff --git a/scripts/ClassDropController.js b/scripts/ClassDropController.js new file mode 100644 index 0000000..6dc901c --- /dev/null +++ b/scripts/ClassDropController.js @@ -0,0 +1,20 @@ +angular.module('flashy.ClassDropController', ['ui.router']). + controller('ClassDropController', function($rootScope, $resource, $scope, $state, $http, UserService) { + $scope.hi = "hi"; + $rootScope.SectionResource = $resource('/api/sections/:sectionId/'); + $rootScope.currentSection = {}; + $rootScope.UserService = UserService; + + $scope.dropClass = function(section) { + $http.post('/api/sections/' + section.id + '/drop/'). + success(function(data) { + console.log(section.short_name + ' dropped'); + + Materialize.toast('Dropped', 3000, 'rounded'); + }). + error(function(err) { + console.log('no drop for you'); + }); + }; + + }); diff --git a/templates/cardlist.html b/templates/cardlist.html index 038353a..b30dcc7 100644 --- a/templates/cardlist.html +++ b/templates/cardlist.html @@ -58,7 +58,7 @@ -
+
  • Week {{weeknum}}

  • diff --git a/templates/dropclass.html b/templates/dropclass.html new file mode 100644 index 0000000..cadeb30 --- /dev/null +++ b/templates/dropclass.html @@ -0,0 +1,23 @@ +
    + +

    Enrolled Classes

    + + + + + + + + + + + + + + + +
    NameDrop?
    + {{section.short_name}} +

    {{section.long_name}}

    +
    +
    -- 1.9.1