diff --git a/flashy.css b/flashy.css index 7363230..255a8bf 100644 --- a/flashy.css +++ b/flashy.css @@ -50,12 +50,7 @@ ul.side-nav.fixed li a { ul.side-nav.fixed li.class a{ font-size:24px; height: 36px; -} - -ul.side-nav.fixed li ul li { - /*line-height: 30px;*/ - /*font-weight:700;*/ - margin-left:20px; + line-height: normal; } ul.side-nav.fixed li a { @@ -159,7 +154,7 @@ ul.side-nav.fixed li a { .center-me { margin: 0 auto; text-align: center; - vertical-align: center; + vertical-align: middle; } .container { diff --git a/scripts/FeedController.js b/scripts/FeedController.js index 9af9d8d..3e2a481 100644 --- a/scripts/FeedController.js +++ b/scripts/FeedController.js @@ -1,46 +1,52 @@ angular.module('flashy.FeedController', ['ui.router']). - controller('FeedController', ['$scope', '$stateParams', '$state', '$http', function($scope, $stateParams, $state, $http) { + controller('FeedController', ['$scope', '$stateParams', '$state', '$http', function ($scope, $stateParams, $state, $http) { console.log('Hello from feed'); sectionId = $stateParams.sectionId; $scope.cards = []; - $scope.cards[0] = {'id': 1, 'title': 'title1', 'content': 'abc'}; - $scope.cards[1] = {'id': 2, 'title': 'title2', 'content': 'xyz'}; + $scope.cards[0] = {'id': 0, 'title': 'title1', 'content': 'abc'}; + $scope.cards[1] = {'id': 1, 'title': 'title2', 'content': 'xyz'}; $scope.cards[2] = {'id': 2, 'title': 'title3', 'content': 'qwe'}; - $http.get('/api/sections/' + sectionId + '/flashcards/'). - success(function(data) { + $http.get('/api/sections/' + sectionId + '/feed/'). + success(function (data) { for (var i = 0; i < data.length; i++) { - cards.push({'title': data[i].title, 'content': data[i].content}); + $scope.cards.push({'title': data[i].title, 'content': data[i].text}); } }). - error(function(err) { - console.log('no'); + error(function (err) { + console.log('pulling feed failed'); }); - $scope.viewDeck = function() { + $scope.viewDeck = function () { $state.go('deck', {sectionId: sectionId}); console.log('go to deck'); }; - $scope.pullCard = function(card) { + $scope.pullCard = function (card) { var index = $scope.cards.indexOf(card); console.log($scope.cards[index]); }; - $scope.pushCard = function() { + $scope.pushCard = function () { console.log('make! card content:' + $scope.text); var pushed = new Date(Date.now()); console.log(pushed.toString()); - + text = $scope.text; // attempt to make card :( - $http.post('/api/flashcards/', {'text': $scope.text, 'pushed': pushed, 'mask': []}). - success(function(data) { - console.log('No way, really?'); + $http.post('/api/flashcards/', { + 'text': $scope.text, + 'material_date': pushed, + 'mask': '[]', + section: sectionId + }). + success(function (data) { + console.log('pushed a card!'); + $scope.cards.push({content: text}); }). - error(function(error) { + error(function (error) { console.log('haha, n00b'); }); @@ -48,10 +54,10 @@ angular.module('flashy.FeedController', ['ui.router']). }; $scope.flashcard = 'hi i am a flashcard. I need to be really long and awesome I ain\'t ' + - 'know how long I am right now. Is it good enough now?????????? Howz about now???'; + 'know how long I am right now. Is it good enough now?????????? Howz about now???'; $scope.text = ''; - $(document).ready(function() { + $(document).ready(function () { // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal({ dismissible: true, // Modal can be dismissed by clicking outside of the modal