From dcecd85b252f0abe5ea08ed233ab3b2506918fb8 Mon Sep 17 00:00:00 2001 From: "skparkk@gmail.com" Date: Wed, 18 Mar 2015 11:07:13 -0400 Subject: [PATCH 1/3] Adding in detail footer for projects --- .../detail/projects.detail.controller.js | 24 ++++++-- .../app/projects/detail/projects.detail.html | 48 ++++++++++++++++ .../app/projects/detail/projects.detail.scss | 52 ++++++++++++++++++ .../filter/projects.filter.controller.spec.js | 2 +- .../projects/list/projects.list.controller.js | 3 + client/app/projects/list/projects.list.html | 2 +- .../assets/images/icon_view_all_projects.png | Bin 0 -> 1132 bytes 7 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 client/assets/images/icon_view_all_projects.png diff --git a/client/app/projects/detail/projects.detail.controller.js b/client/app/projects/detail/projects.detail.controller.js index 939d712..7a1e1e2 100644 --- a/client/app/projects/detail/projects.detail.controller.js +++ b/client/app/projects/detail/projects.detail.controller.js @@ -13,15 +13,17 @@ angular.module('espnCreativeworksShowcaseApp') }; $scope.project = Project.get({ id: $stateParams.id }); - + $scope.project.$promise.then(function (project){ Page.meta.title = project.meta.title || (project.title + ' Project Details'); Page.meta.description = project.meta.description || fullDescriptionFilter(project.description, { plaintext: true }); $scope.project.hero.file.transformedUrl = $.cloudinary.url($scope.project.hero.file.public_id, { secure: true, transformation: 'project_detail_hero' }); - $scope.project.$executions = Project.executions({ id: project._id }); + + $scope.project.$executions = Project.executions({ id: project._id }); return $scope.project.$executions.$promise; + }).then(function (executions){ - $scope.project.$tags = []; + $scope.project.$tags = []; angular.forEach(executions, function (execution){ angular.forEach(execution.tags, function (tag){ @@ -34,9 +36,21 @@ angular.module('espnCreativeworksShowcaseApp') angular.forEach(execution.videos, function (video){ video.embed.trustedHtml = $sce.trustAsHtml(video.embed.html) - }); - + }); }); + + $scope.project.$related = $scope.project.related; + return $scope.project.$related.$promise; + + }).then(function(){ + $scope.project.$related = []; + + for(var i = 0; i < $scope.project.related.length; i++){ + $scope.project.$rel = Project.get({ id: $scope.project.related[i] }); + $scope.project.$related.push($scope.project.$rel); + console.log($scope.project.$rel); + } + }); }]); diff --git a/client/app/projects/detail/projects.detail.html b/client/app/projects/detail/projects.detail.html index 928f23c..49429a6 100644 --- a/client/app/projects/detail/projects.detail.html +++ b/client/app/projects/detail/projects.detail.html @@ -68,4 +68,52 @@

+
+
+ + + +
+
+ diff --git a/client/app/projects/detail/projects.detail.scss b/client/app/projects/detail/projects.detail.scss index b3a04fd..c67d214 100644 --- a/client/app/projects/detail/projects.detail.scss +++ b/client/app/projects/detail/projects.detail.scss @@ -86,6 +86,58 @@ body.project-detail { font-style: italic; font-weight: 300; } + + .footer { + background-color: #fff; + color: #000; + padding: 20px 0px; + + .title { + text-transform: uppercase; + font-size: 11px; + font-weight: bold; + } + + .footer-tags { + .tags { + padding-top: 20px; + } + .tag-text { + font-style: italic; + } + } + .related-projects { + border-left: 1px solid rgb(0, 0, 0); + border-left: 1px solid rgba(0, 0, 0, 0.3); + border-right: 1px solid rgb(0, 0, 0); + border-right: 1px solid rgba(0, 0, 0, 0.3); + + .project { + padding: 20px 20px 0 20px; + } + } + .footer-view-all { + .icon { + padding-top: 20px; + } + img { + height: 35px; + } + } + + .card-header { + font-family: $espn-font-family-headings; + color: #000; + text-transform: uppercase; + margin: 5px 0 0 0 !important; + } + .card-desc { + font-family: $font-family-sans-serif; + color: #b7b7b7; + font-style: italic; + font-size: 12px; + } + } } @media (min-width: $screen-md-min){ diff --git a/client/app/projects/filter/projects.filter.controller.spec.js b/client/app/projects/filter/projects.filter.controller.spec.js index 2a498c2..0e8090b 100644 --- a/client/app/projects/filter/projects.filter.controller.spec.js +++ b/client/app/projects/filter/projects.filter.controller.spec.js @@ -10,7 +10,7 @@ describe('Controller: ProjectsFilterCtrl', function () { // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); - ProjectsFilterCtrl = $controller('ProjectsListCtrl', { + ProjectsFilterCtrl = $controller('ProjectsFilterCtrl', { $scope: scope }); })); diff --git a/client/app/projects/list/projects.list.controller.js b/client/app/projects/list/projects.list.controller.js index 63f108e..10246d6 100644 --- a/client/app/projects/list/projects.list.controller.js +++ b/client/app/projects/list/projects.list.controller.js @@ -96,6 +96,9 @@ angular.module('espnCreativeworksShowcaseApp') if ($scope.filters.active[key] && project[key]){ var filterIds = _.map($scope.filters.active[key], function (item){ return item._id; }) , projectKeyIds = _.map(project[key], function (item){ return item._id; }); + + console.log("filterIds: " + filterIds); + console.log("projectKeyIds: " + projectKeyIds); // check each project keyId against those in the filter // if found, set result to true diff --git a/client/app/projects/list/projects.list.html b/client/app/projects/list/projects.list.html index 3741009..3f31ce1 100644 --- a/client/app/projects/list/projects.list.html +++ b/client/app/projects/list/projects.list.html @@ -9,7 +9,7 @@

Work

-
+