From a71267f7f937e39d6848ae2869c4e1fd9d02166d Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sun, 1 Feb 2015 23:36:42 +0200 Subject: [PATCH] Home notification for Aguda #7 closed --- www/js/ApiService.js | 2 +- www/js/controllers.js | 15 +++++++++++++++ www/templates/home.html | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/www/js/ApiService.js b/www/js/ApiService.js index aa47364..4657be7 100644 --- a/www/js/ApiService.js +++ b/www/js/ApiService.js @@ -89,7 +89,7 @@ starter.factory('ApiService', ['$http', '$ionicPopup', '$ionicModal', function ( console.log("[JCE] [INFO] : in update - Got Aguda from Facebook!"); if(grades === null){ window.localStorage['newAguda'] = "true"; - window.localStorage['newAguda'] = JSON.stringify(resp.data); + window.localStorage['agudaPosts'] = JSON.stringify(resp.data); }else if(grades === JSON.stringify(resp.data)){ console.log("[JCE] [INFO] : in update - no new newAguda"); }else{ diff --git a/www/js/controllers.js b/www/js/controllers.js index 387050d..8773a33 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -388,6 +388,15 @@ angular.module('starter.controllers', []) $location.path( "/app/jcenews" ); }; + $scope.goToAguda = function(){ + window.localStorage['newAguda'] = "false"; + $scope.newAguda = false; + $ionicViewService.nextViewOptions({ + disableBack: true + }); + $location.path( "/app/aguda" ); + }; + $scope.goToGrades = function(){ var localSettingsStr = window.localStorage['Settings'] || null; if (localSettingsStr !== null){ @@ -425,6 +434,12 @@ angular.module('starter.controllers', []) $scope.newNotes = false; } + if(window.localStorage['newAguda'] == "true"){ + $scope.newAguda = true; + }else{ + $scope.newAguda = false; + } + var userStr = window.localStorage['userInfo'] || null; if(userStr !== null) $scope.userData = JSON.parse(userStr); diff --git a/www/templates/home.html b/www/templates/home.html index c4ef4f9..b3d6bdb 100644 --- a/www/templates/home.html +++ b/www/templates/home.html @@ -39,6 +39,11 @@ יש עדכון בגיליון ציונים + + + פוסט חדש מהאגודה + +