From 4cc88232a3ed20dc9e94464402035d9f4600c9c9 Mon Sep 17 00:00:00 2001 From: Helana Nosrat Date: Sat, 3 Dec 2016 00:55:42 -0600 Subject: [PATCH 1/5] fixed html buttons and login --- .gitignore | 6 +++--- css/main.css | 3 ++- javascripts/AppConfig.js | 10 ++++++---- javascripts/AppConstants.js | 4 +++- javascripts/app.js | 1 + javascripts/controllers/AuthCtrl.js | 13 ++++++------ javascripts/factories/AuthFactory.js | 4 +++- partials/auth.html | 30 ++++++++-------------------- partials/login | 17 ---------------- partials/navbar.html | 2 +- partials/pin-new.html | 0 11 files changed, 34 insertions(+), 56 deletions(-) delete mode 100644 partials/login delete mode 100644 partials/pin-new.html diff --git a/.gitignore b/.gitignore index 27b1935..4914910 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -*.DS_Store +.DS_Store lib/node_modules/ lib/bower_components/ -*javascripts/AppConstants.js -npm-debug.log +javascripts/AppConstants.js + diff --git a/css/main.css b/css/main.css index 0727f69..75a51db 100644 --- a/css/main.css +++ b/css/main.css @@ -1,4 +1,4 @@ -body { +/*body { background-image: url("img/cork.jpg"); font-family: 'Yanone Kaffeesatz', sans-serif; font-size: 2em; @@ -8,3 +8,4 @@ h1 { font-family: 'Anton', sans-serif; font-size: 1.5em; } +*/ \ No newline at end of file diff --git a/javascripts/AppConfig.js b/javascripts/AppConfig.js index dded909..9d4e57a 100644 --- a/javascripts/AppConfig.js +++ b/javascripts/AppConfig.js @@ -6,14 +6,14 @@ let isAuth = (AuthFactory) => new Promise((resolve, reject) => { } else { reject(); } -}); +}) app.run(function($rootScope, $location, FIREBASE_CONFIG, AuthFactory){ firebase.initializeApp(FIREBASE_CONFIG); $rootScope.$on('$routeChangeStart', function(event, currRoute, prevRoute){ + let logged = AuthFactory.isAuthenticated(); - let appTo; if(currRoute.originalPath){ @@ -33,7 +33,7 @@ app.config(function($routeProvider){ $routeProvider .when('/auth', { templateUrl: 'partials/auth.html', - controller:'AuthCtrl' + controller:'AuthCtrl', }) .when('/boards/list', { templateUrl: 'partials/general-view.html', @@ -61,4 +61,6 @@ app.config(function($routeProvider){ resolve: {isAuth} }) .otherwise('/auth'); -}); \ No newline at end of file +}); + +console.log("AppConfig loaded"); \ No newline at end of file diff --git a/javascripts/AppConstants.js b/javascripts/AppConstants.js index 9d17b21..2863415 100644 --- a/javascripts/AppConstants.js +++ b/javascripts/AppConstants.js @@ -6,4 +6,6 @@ app.constant("FIREBASE_CONFIG", { databaseURL: "https://pinthis-fe275.firebaseio.com", storageBucket: "pinthis-fe275.appspot.com", messagingSenderId: "918121387819" -}); \ No newline at end of file +}); + +console.log("AppConstantsCompleted"); \ No newline at end of file diff --git a/javascripts/app.js b/javascripts/app.js index 3c73363..01ef943 100644 --- a/javascripts/app.js +++ b/javascripts/app.js @@ -2,3 +2,4 @@ var app = angular.module("PinThisApp", ["ngRoute"]); + diff --git a/javascripts/controllers/AuthCtrl.js b/javascripts/controllers/AuthCtrl.js index 770d0bf..5329435 100644 --- a/javascripts/controllers/AuthCtrl.js +++ b/javascripts/controllers/AuthCtrl.js @@ -5,7 +5,7 @@ app.controller("AuthCtrl", function($scope, $rootScope, AuthFactory, UserFactory $scope.setRegisterContainer = false; - if($location.path() == "/logout"){ + if($location.path() === "/logout"){ AuthFactory.logout(); $rootScope.user ={}; $location.url("/auth"); @@ -23,11 +23,6 @@ app.controller("AuthCtrl", function($scope, $rootScope, AuthFactory, UserFactory }); }; - $scope.setLoginContainer = function(){ - $scope.loginContainer = true; - $scope.registerContainer = false; - - }; $scope.setRegisterContainer = function(){ $scope.loginContainer = false; @@ -35,6 +30,12 @@ app.controller("AuthCtrl", function($scope, $rootScope, AuthFactory, UserFactory }; + $scope.setLoginContainer = function(){ + $scope.loginContainer = true; + $scope.registerContainer = false; + + }; + $scope.registerUser = function(registerNewUser){ AuthFactory.registerWithEmail(registerNewUser).then(function(didRegister){ registerNewUser.uid = didRegister.uid; diff --git a/javascripts/factories/AuthFactory.js b/javascripts/factories/AuthFactory.js index ed3b5f3..681965f 100644 --- a/javascripts/factories/AuthFactory.js +++ b/javascripts/factories/AuthFactory.js @@ -59,4 +59,6 @@ app.factory("AuthFactory", function($q, $http, $rootScope, FIREBASE_CONFIG) { }; return {isAuthenticated:isAuthenticated, getUser:getUser, logout:logout, registerWithEmail:registerWithEmail, authenticate:authenticate, authenticateGoogle: authenticateGoogle}; -}); \ No newline at end of file +}); + +console.log("AuthFactory loaded"); \ No newline at end of file diff --git a/partials/auth.html b/partials/auth.html index f537e90..201661d 100644 --- a/partials/auth.html +++ b/partials/auth.html @@ -1,55 +1,41 @@ -
+
- - -
+ +
- -
-
-
- -
- - +
-
-
- +
-
- -
- - -
+ +
\ No newline at end of file diff --git a/partials/login b/partials/login deleted file mode 100644 index ec8771f..0000000 --- a/partials/login +++ /dev/null @@ -1,17 +0,0 @@ -
-
diff --git a/partials/navbar.html b/partials/navbar.html index a910803..5af9fcd 100644 --- a/partials/navbar.html +++ b/partials/navbar.html @@ -8,7 +8,7 @@ - Todo App + Pin This
- +
Submit Login @@ -36,6 +36,5 @@ Submit Registration
- \ No newline at end of file diff --git a/partials/board-new.html b/partials/board-new.html index febd545..e2c92ad 100644 --- a/partials/board-new.html +++ b/partials/board-new.html @@ -1,12 +1,12 @@ -

New Todo

+

My Boards

- +
- +
diff --git a/partials/board-view.html b/partials/board-view.html index ba5509e..9447f6a 100644 --- a/partials/board-view.html +++ b/partials/board-view.html @@ -1,4 +1,4 @@

Board: {{selectedBoard.pin}}

- +

Helana's Boards: {{selectedBoard.assignedTo}}

-

My Pins: {{selectedBoard.isSelected}}

+

My Boards: {{selectedBoard.isSelected}}

diff --git a/partials/general-view.html b/partials/general-view.html index baeb4d1..7bcbf46 100644 --- a/partials/general-view.html +++ b/partials/general-view.html @@ -1,5 +1,5 @@
-
+
@@ -13,10 +13,7 @@

Boards

- -
-
{{board.assignedTo}}
@@ -25,10 +22,10 @@

Boards

My Boards

-
+
-
+
{{board.assignedTo}}
diff --git a/partials/navbar.html b/partials/navbar.html index 5af9fcd..40d103a 100644 --- a/partials/navbar.html +++ b/partials/navbar.html @@ -1,6 +1,5 @@