From b92e8693f07b85946e60a77b10567a4871ca1392 Mon Sep 17 00:00:00 2001 From: Gabe Rogan Date: Thu, 17 Nov 2016 14:32:59 -0500 Subject: [PATCH] all cleaned up :). a few remnants for demo purposes --- app/app.js | 13 +- app/app.route.js | 65 ++---- app/pages/404/ctrl.js | 7 +- app/pages/404/view.html | 2 + .../style.styl => categories/anotherCtrl.js} | 0 app/pages/categories/ctrl.js | 7 + .../style.styl | 0 app/pages/categories/view.html | 2 + app/pages/community/ctrl.js | 5 - app/pages/community/style.styl | 2 - app/pages/competitions/ctrl.js | 31 --- app/pages/competitions/style.styl | 15 -- app/pages/competitions/view.html | 29 --- app/pages/dashboard/ctrl-comps.js | 4 - app/pages/dashboard/ctrl-dash.js | 4 - app/pages/dashboard/ctrl-featured.js | 4 - app/pages/dashboard/ctrl-news.js | 4 - app/pages/dashboard/ctrl-users.js | 4 - .../view.html => food/anotherCtrl.js} | 0 app/pages/food/ctrl.js | 7 + app/{sandbox => pages/food}/style.styl | 0 app/pages/food/view.html | 2 + app/pages/login/anotherCtrl.js | 0 app/pages/login/ctrl.js | 7 + app/pages/login/style.styl | 0 app/pages/login/view.html | 2 + app/pages/news/ctrl.js | 5 - app/pages/single-competition/ctrl.js | 4 - app/pages/single-competition/view.html | 8 - app/{root-view => root}/_footer.kit | 0 app/{root-view => root}/_header.kit | 2 +- app/{root-view => root}/_nav.kit | 8 +- app/{root-view => root}/index.kit | 0 app/root/root-ctrl.js | 10 + app/{root-view => root}/root.styl | 12 +- .../view.html => sandbox/competition.html} | 0 app/sandbox/ctrl.js | 12 ++ .../news/view.html => sandbox/news.html} | 0 app/sandbox/scrap.html | 10 - .../news/style.styl => sandbox/whatever.styl} | 17 ++ assets/css/main.css | 181 ++++++++--------- assets/js/bundle.js | 185 ++++++------------ assets/styl/reset.styl | 4 + gulpfile.js | 4 +- index.html | 10 +- 45 files changed, 274 insertions(+), 414 deletions(-) rename app/pages/{dashboard/style.styl => categories/anotherCtrl.js} (100%) create mode 100644 app/pages/categories/ctrl.js rename app/pages/{single-competition => categories}/style.styl (100%) create mode 100644 app/pages/categories/view.html delete mode 100644 app/pages/community/ctrl.js delete mode 100644 app/pages/community/style.styl delete mode 100644 app/pages/competitions/ctrl.js delete mode 100644 app/pages/competitions/style.styl delete mode 100644 app/pages/competitions/view.html delete mode 100644 app/pages/dashboard/ctrl-comps.js delete mode 100644 app/pages/dashboard/ctrl-dash.js delete mode 100644 app/pages/dashboard/ctrl-featured.js delete mode 100644 app/pages/dashboard/ctrl-news.js delete mode 100644 app/pages/dashboard/ctrl-users.js rename app/pages/{dashboard/view.html => food/anotherCtrl.js} (100%) create mode 100644 app/pages/food/ctrl.js rename app/{sandbox => pages/food}/style.styl (100%) create mode 100644 app/pages/food/view.html create mode 100644 app/pages/login/anotherCtrl.js create mode 100644 app/pages/login/ctrl.js create mode 100644 app/pages/login/style.styl create mode 100644 app/pages/login/view.html delete mode 100644 app/pages/news/ctrl.js delete mode 100644 app/pages/single-competition/ctrl.js delete mode 100644 app/pages/single-competition/view.html rename app/{root-view => root}/_footer.kit (100%) rename app/{root-view => root}/_header.kit (96%) rename app/{root-view => root}/_nav.kit (86%) rename app/{root-view => root}/index.kit (100%) create mode 100644 app/root/root-ctrl.js rename app/{root-view => root}/root.styl (86%) rename app/{pages/community/view.html => sandbox/competition.html} (100%) rename app/{pages/news/view.html => sandbox/news.html} (100%) rename app/{pages/news/style.styl => sandbox/whatever.styl} (86%) diff --git a/app/app.js b/app/app.js index 4c1d1b3..f176306 100644 --- a/app/app.js +++ b/app/app.js @@ -1,13 +1,4 @@ var app = angular.module('app', ['ngRoute']); -// Root controller -app.controller('root', ['$scope', '$location', function ($scope, $location) { - $scope.page = { - 'title' : 'Root', - 'id' : 'root', - 'blackNav' : false - }; - $scope.go = function ( path ) { - $location.path( path ); - }; -}]); +// Root controllers in /root/ folder +// Page controllers in /pages/[your-page] folder diff --git a/app/app.route.js b/app/app.route.js index 35e7d6c..e27597c 100644 --- a/app/app.route.js +++ b/app/app.route.js @@ -1,68 +1,37 @@ app.config( function ($routeProvider, $locationProvider) { $routeProvider .when('/', { - templateUrl: 'app/pages/news/view.html', - controller: 'NewsCtrl' + templateUrl: 'app/pages/food/view.html', + controller: 'FoodCtrl' }) - // Sandbox - .when('/email', { - templateUrl: 'app/sandbox/email.html', - controller: 'EmailController' + .when('/login', { + templateUrl: 'app/pages/login/view.html', + controller: 'LoginCtrl' }) - // Sandbox - .when('/todo', { - templateUrl: 'app/sandbox/todo.html', - controller: 'TodoController' + .when('/categories', { + templateUrl: 'app/pages/categories/view.html', + controller: 'CategoryCtrl' }) - .when('/news', { - templateUrl: 'app/pages/news/view.html', - controller: 'NewsCtrl' + .when('/food', { + templateUrl: 'app/pages/food/view.html', + controller: 'FoodCtrl' }) - .when('/community', { - templateUrl: 'app/pages/community/view.html', - controller: 'CommunityCtrl' + // Sandbox Demo + .when('/news', { + templateUrl: 'app/sandbox/news.html', + controller: 'NewsCtrl' }) + // Sandbox Demo .when('/competitions', { - templateUrl: 'app/pages/competitions/view.html', + templateUrl: 'app/sandbox/competition.html', controller: 'CompetitionCtrl' }) - .when('/c/:id', { - templateUrl: 'app/pages/single-competition/view.html', - controller: 'SingleCompetitionCtrl' - }) - - // Dashboard ======Below This Point======= - .when('/dashboard', { - templateUrl: 'app/pages/dashboard/view.html', - controller: 'DashboardCtrl' - }) - - .when('/dashboard/news', { - templateUrl: 'app/pages/dashboard/view.html', - controller: 'DashboardNewsCtrl' - }) - - .when('/dashboard/competitions', { - templateUrl: 'app/pages/dashboard/view.html', - controller: 'DashboardCompetitionCtrl' - }) - - .when('/dashboard/featured-user', { - templateUrl: 'app/pages/dashboard/view.html', - controller: 'DashboardFeatureCtrl' - }) - - .when('/dashboard/users', { - templateUrl: 'app/pages/dashboard/view.html', - controller: 'DashboardUserCtrl' - }) - // 404 Not Found .otherwise({ templateUrl: 'app/pages/404/view.html', diff --git a/app/pages/404/ctrl.js b/app/pages/404/ctrl.js index dbec9a8..ced7d2d 100644 --- a/app/pages/404/ctrl.js +++ b/app/pages/404/ctrl.js @@ -1,4 +1,7 @@ app.controller('404Ctrl', ['$scope', function ($scope) { - $scope.test = "Title"; - $scope.test2 = "xxdddd"; + $scope.page.title = '404'; + $scope.page.id = '404'; + $scope.page.yourVar = "globalStuff"; + + $scope.var2 = "localStuff"; }]); diff --git a/app/pages/404/view.html b/app/pages/404/view.html index e69de29..640e8c2 100644 --- a/app/pages/404/view.html +++ b/app/pages/404/view.html @@ -0,0 +1,2 @@ +
+

You've reached pages/404/view.html by going to an invalid link.

diff --git a/app/pages/dashboard/style.styl b/app/pages/categories/anotherCtrl.js similarity index 100% rename from app/pages/dashboard/style.styl rename to app/pages/categories/anotherCtrl.js diff --git a/app/pages/categories/ctrl.js b/app/pages/categories/ctrl.js new file mode 100644 index 0000000..38bbe26 --- /dev/null +++ b/app/pages/categories/ctrl.js @@ -0,0 +1,7 @@ +app.controller('CategoryCtrl', ['$scope', function ($scope) { + $scope.page.title = 'Categories'; + $scope.page.id = 'cat'; + $scope.page.yourVar = "globalStuff"; + + $scope.var2 = "localStuff"; +}]); diff --git a/app/pages/single-competition/style.styl b/app/pages/categories/style.styl similarity index 100% rename from app/pages/single-competition/style.styl rename to app/pages/categories/style.styl diff --git a/app/pages/categories/view.html b/app/pages/categories/view.html new file mode 100644 index 0000000..0481886 --- /dev/null +++ b/app/pages/categories/view.html @@ -0,0 +1,2 @@ +
+

You've reached pages/categories/view.html.

diff --git a/app/pages/community/ctrl.js b/app/pages/community/ctrl.js deleted file mode 100644 index 8b7faca..0000000 --- a/app/pages/community/ctrl.js +++ /dev/null @@ -1,5 +0,0 @@ -app.controller('CommunityCtrl', ['$scope', function ($scope) { - $scope.page.title = 'Community'; - $scope.page.id = 'comm'; - $scope.page.blackNav = true; -}]); diff --git a/app/pages/community/style.styl b/app/pages/community/style.styl deleted file mode 100644 index 65c7174..0000000 --- a/app/pages/community/style.styl +++ /dev/null @@ -1,2 +0,0 @@ -// .asdf - // @extend .competition-cards diff --git a/app/pages/competitions/ctrl.js b/app/pages/competitions/ctrl.js deleted file mode 100644 index c7e342f..0000000 --- a/app/pages/competitions/ctrl.js +++ /dev/null @@ -1,31 +0,0 @@ -app.controller('CompetitionCtrl', ['$scope', function ($scope) { - $scope.page.title = 'Competitions'; - $scope.page.id = 'comps'; - $scope.page.blackNav = true; -}]); - - -/* if timeToView | timeToVote -Show DOM image grid. Load with images - -if timeToVote -Add vote buttons -vote onClick: fill(heartUI). Add {username: true} to photo/votes -firebase/comps/Time/votes { - myUsername { -- rule: limit count here to 5 - userID-I-VotedFor: true - } -} - -if timeToEnter -Show enter DOM -upload onSubmit, add pic to firebase storage && firebase/competitions/Time/photos -firebase/comps/Time/photos { - myUsername { - photoURL: firebaseStorageurl.com/asdf -- write rule, only write to your id -} -} - -if id-not-found in firebaseObject -Show DOM template: "Sorry, no competition with that name" -*/ diff --git a/app/pages/competitions/style.styl b/app/pages/competitions/style.styl deleted file mode 100644 index 480371c..0000000 --- a/app/pages/competitions/style.styl +++ /dev/null @@ -1,15 +0,0 @@ -.spacer - height: 80px - -.competition-cards - display: flex - flex-flow: row wrap - justify-content: space-around - padding: 6em 2em - .card.small - flex: 0 400px - height: auto - margin: 1.5em .5em - .img - height: 200px - background-size: cover diff --git a/app/pages/competitions/view.html b/app/pages/competitions/view.html deleted file mode 100644 index db77b32..0000000 --- a/app/pages/competitions/view.html +++ /dev/null @@ -1,29 +0,0 @@ -
-
-
-
- Card Title -
-
- -
-
-
- Card Title -
-
- -
-
-
- Card Title -
-
- -
-
-
- Card Title -
-
-
diff --git a/app/pages/dashboard/ctrl-comps.js b/app/pages/dashboard/ctrl-comps.js deleted file mode 100644 index c628543..0000000 --- a/app/pages/dashboard/ctrl-comps.js +++ /dev/null @@ -1,4 +0,0 @@ -app.controller('DashboardCompetitionCtrl', ['$scope', function ($scope) { - $scope.test = "Title"; - $scope.test2 = "xxdddd"; -}]); diff --git a/app/pages/dashboard/ctrl-dash.js b/app/pages/dashboard/ctrl-dash.js deleted file mode 100644 index 80838e6..0000000 --- a/app/pages/dashboard/ctrl-dash.js +++ /dev/null @@ -1,4 +0,0 @@ -app.controller('DashboardCtrl', ['$scope', function ($scope) { - $scope.test = "Title"; - $scope.test2 = "xxdddd"; -}]); diff --git a/app/pages/dashboard/ctrl-featured.js b/app/pages/dashboard/ctrl-featured.js deleted file mode 100644 index 8fe25a8..0000000 --- a/app/pages/dashboard/ctrl-featured.js +++ /dev/null @@ -1,4 +0,0 @@ -app.controller('DashboardFeatureCtrl', ['$scope', function ($scope) { - $scope.test = "Title"; - $scope.test2 = "xxdddd"; -}]); diff --git a/app/pages/dashboard/ctrl-news.js b/app/pages/dashboard/ctrl-news.js deleted file mode 100644 index fc780d1..0000000 --- a/app/pages/dashboard/ctrl-news.js +++ /dev/null @@ -1,4 +0,0 @@ -app.controller('DashboardNewsCtrl', ['$scope', function ($scope) { - $scope.test = "Title"; - $scope.test2 = "xxdddd"; -}]); diff --git a/app/pages/dashboard/ctrl-users.js b/app/pages/dashboard/ctrl-users.js deleted file mode 100644 index 15c5aef..0000000 --- a/app/pages/dashboard/ctrl-users.js +++ /dev/null @@ -1,4 +0,0 @@ -app.controller('DashboardUserCtrl', ['$scope', function ($scope) { - $scope.test = "Title"; - $scope.test2 = "xxdddd"; -}]); diff --git a/app/pages/dashboard/view.html b/app/pages/food/anotherCtrl.js similarity index 100% rename from app/pages/dashboard/view.html rename to app/pages/food/anotherCtrl.js diff --git a/app/pages/food/ctrl.js b/app/pages/food/ctrl.js new file mode 100644 index 0000000..199a701 --- /dev/null +++ b/app/pages/food/ctrl.js @@ -0,0 +1,7 @@ +app.controller('FoodCtrl', ['$scope', function ($scope) { + $scope.page.title = 'Food'; + $scope.page.id = 'food'; + $scope.page.yourVar = "globalStuff"; + + $scope.var2 = "localStuff"; +}]); diff --git a/app/sandbox/style.styl b/app/pages/food/style.styl similarity index 100% rename from app/sandbox/style.styl rename to app/pages/food/style.styl diff --git a/app/pages/food/view.html b/app/pages/food/view.html new file mode 100644 index 0000000..f45f070 --- /dev/null +++ b/app/pages/food/view.html @@ -0,0 +1,2 @@ +
+

You've reached pages/food/view.html.

diff --git a/app/pages/login/anotherCtrl.js b/app/pages/login/anotherCtrl.js new file mode 100644 index 0000000..e69de29 diff --git a/app/pages/login/ctrl.js b/app/pages/login/ctrl.js new file mode 100644 index 0000000..d8e34b5 --- /dev/null +++ b/app/pages/login/ctrl.js @@ -0,0 +1,7 @@ +app.controller('LoginCtrl', ['$scope', function ($scope) { + $scope.page.title = 'Login'; + $scope.page.id = 'login'; + $scope.page.yourVar = "globalStuff"; + + $scope.var2 = "localStuff"; +}]); diff --git a/app/pages/login/style.styl b/app/pages/login/style.styl new file mode 100644 index 0000000..e69de29 diff --git a/app/pages/login/view.html b/app/pages/login/view.html new file mode 100644 index 0000000..182622f --- /dev/null +++ b/app/pages/login/view.html @@ -0,0 +1,2 @@ +
+

You've reached pages/login/view.html.

diff --git a/app/pages/news/ctrl.js b/app/pages/news/ctrl.js deleted file mode 100644 index 3b1400f..0000000 --- a/app/pages/news/ctrl.js +++ /dev/null @@ -1,5 +0,0 @@ -app.controller('NewsCtrl', ['$scope', function ($scope) { - $scope.page.title = 'News'; - $scope.page.id = 'news'; - $scope.page.blackNav = false; -}]); diff --git a/app/pages/single-competition/ctrl.js b/app/pages/single-competition/ctrl.js deleted file mode 100644 index dce26ea..0000000 --- a/app/pages/single-competition/ctrl.js +++ /dev/null @@ -1,4 +0,0 @@ -app.controller('SingleCompetitionCtrl', ['$scope', function ($scope) { - $scope.test = "Title"; - $scope.test2 = "xxdddd"; -}]); diff --git a/app/pages/single-competition/view.html b/app/pages/single-competition/view.html deleted file mode 100644 index ce0de8d..0000000 --- a/app/pages/single-competition/view.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/app/root-view/_footer.kit b/app/root/_footer.kit similarity index 100% rename from app/root-view/_footer.kit rename to app/root/_footer.kit diff --git a/app/root-view/_header.kit b/app/root/_header.kit similarity index 96% rename from app/root-view/_header.kit rename to app/root/_header.kit index c30bdcd..433acc8 100644 --- a/app/root-view/_header.kit +++ b/app/root/_header.kit @@ -21,6 +21,6 @@ - {{page.title}} | Flash + {{page.title}} | F2E diff --git a/app/root-view/_nav.kit b/app/root/_nav.kit similarity index 86% rename from app/root-view/_nav.kit rename to app/root/_nav.kit index c76d989..3c3f200 100644 --- a/app/root-view/_nav.kit +++ b/app/root/_nav.kit @@ -1,4 +1,4 @@ -