diff --git a/app/coffee/modules/profile/main.coffee b/app/coffee/modules/profile/main.coffee index d78c5c45..87b70efa 100644 --- a/app/coffee/modules/profile/main.coffee +++ b/app/coffee/modules/profile/main.coffee @@ -28,8 +28,17 @@ module = angular.module("taigaProfile") ############################################################################# ProfileTabsDirective = () -> + link = ($scope, $el, $attrs) -> - console.log $el + + $scope.tabSelected = 'profile-timeline' + + $scope.toggleTab = -> + target = angular.element(event.currentTarget) + tab = target.data("selected") + target.siblings().removeClass('active') + target.addClass('active') + $scope.tabSelected = tab return {link:link} diff --git a/app/partials/home/home-logged-in.jade b/app/partials/home/home-logged-in.jade index 20760956..90037a43 100644 --- a/app/partials/home/home-logged-in.jade +++ b/app/partials/home/home-logged-in.jade @@ -6,8 +6,8 @@ div.profile.centered include ../includes/modules/profile/profile-content-tabs div.content-wrapper div.content - //include ../includes/modules/profile/profile-timeline - //include ../includes/modules/profile/profile-projects + include ../includes/modules/profile/profile-timeline + include ../includes/modules/profile/profile-projects include ../includes/modules/profile/profile-contacts - //include ../includes/modules/profile/profile-favorites + include ../includes/modules/profile/profile-favorites include ../includes/modules/profile/profile-sidebar diff --git a/app/partials/includes/modules/profile/profile-contacts.jade b/app/partials/includes/modules/profile/profile-contacts.jade index e3ed4c1f..3c647ed9 100644 --- a/app/partials/includes/modules/profile/profile-contacts.jade +++ b/app/partials/includes/modules/profile/profile-contacts.jade @@ -1,4 +1,4 @@ -section.profile-contacts +section.profile-contacts(ng-show="tabSelected == 'profile-contacts'") nav.profile-contact-filters a.active(href="", title="No Filter") all a(href="", title="Only show your team") team diff --git a/app/partials/includes/modules/profile/profile-content-tabs.jade b/app/partials/includes/modules/profile/profile-content-tabs.jade index 968440f0..f55c1c4d 100644 --- a/app/partials/includes/modules/profile/profile-content-tabs.jade +++ b/app/partials/includes/modules/profile/profile-content-tabs.jade @@ -1,13 +1,13 @@ nav.profile-content-tabs - a.tab(href="", title="Activity Tab") + a.tab.active(href="", title="Activity Tab", ng-click="toggleTab()", data-selected="profile-timeline") span.icon.icon-timeline span activity - a.tab(href="", title="Projects Tab") + a.tab(href="", title="Projects Tab", ng-click="toggleTab()", data-selected="profile-projects") span.icon.icon-project span projects - a.tab.active(href="", title="Contacts Tab") + a.tab(href="", title="Contacts Tab", ng-click="toggleTab()", data-selected="profile-contacts") span.icon.icon-team span contacts - a.tab(href="", title="Favorites Tab") + a.tab(href="", title="Favorites Tab", ng-click="toggleTab()", data-selected="profile-favorites") span.icon.icon-star-fill span favorites diff --git a/app/partials/includes/modules/profile/profile-favorites.jade b/app/partials/includes/modules/profile/profile-favorites.jade index f0a723c7..4ecae7bd 100644 --- a/app/partials/includes/modules/profile/profile-favorites.jade +++ b/app/partials/includes/modules/profile/profile-favorites.jade @@ -1,4 +1,4 @@ -section.profile-favorites +section.profile-favorites(ng-show="tabSelected == 'profile-favorites'") nav.profile-favorites-filters a.active(href="", title="No Filter") all a(href="", title="Only show your team") projects diff --git a/app/partials/includes/modules/profile/profile-projects.jade b/app/partials/includes/modules/profile/profile-projects.jade index 496ed6f6..dac39552 100644 --- a/app/partials/includes/modules/profile/profile-projects.jade +++ b/app/partials/includes/modules/profile/profile-projects.jade @@ -1,4 +1,4 @@ -section.profile-projects +section.profile-projects(ng-show="tabSelected == 'profile-projects'") - for (var x = 0; x < 3; x++) div.profile-project-single div.profile-projects-left diff --git a/app/partials/includes/modules/profile/profile-timeline.jade b/app/partials/includes/modules/profile/profile-timeline.jade index f4daf1fb..509569c1 100644 --- a/app/partials/includes/modules/profile/profile-timeline.jade +++ b/app/partials/includes/modules/profile/profile-timeline.jade @@ -1,4 +1,4 @@ -section.profile-timeline +section.profile-timeline(ng-show="tabSelected == 'profile-timeline'") - for (var x = 0; x < 3; x++) // Simple message for favorites, updates, etc. div.activity-simple diff --git a/app/styles/layout/profile.scss b/app/styles/layout/profile.scss index 90d3d1b7..59e64a5b 100644 --- a/app/styles/layout/profile.scss +++ b/app/styles/layout/profile.scss @@ -26,6 +26,16 @@ flex: 1; margin-right: 1rem; max-width: 786px; + section { + opacity: 1; + padding-top: 0; + position: relative; + transition: all .3s cubic-bezier(.09, .43, .35, .95); + &.ng-hide { + opacity: 0; + padding-top: .5vh; + } + } } .profile-sidebar { width: 150px; diff --git a/app/styles/modules/profile/profile-content-tabs.scss b/app/styles/modules/profile/profile-content-tabs.scss index 8c26c58e..67cc0e79 100644 --- a/app/styles/modules/profile/profile-content-tabs.scss +++ b/app/styles/modules/profile/profile-content-tabs.scss @@ -1,22 +1,26 @@ .profile-content-tabs { border-top: 1px solid $whitish; + z-index: 9; .tab { - background: $white; color: $gray-light; display: inline-block; padding: .4rem 1rem; &:hover, &.active { color: $grayer; - .icon { - color: $green-taiga; - } + transition: color .2s linear; } &.active { + background: $white; border-left: 1px solid $whitish; border-right: 1px solid $whitish; position: relative; top: 1px; + transition: color .2s linear; + .icon { + color: $green-taiga; + transition: color .2s linear; + } } } .icon { diff --git a/app/styles/modules/profile/profile-timeline.scss b/app/styles/modules/profile/profile-timeline.scss index e660bb4a..ebd93633 100644 --- a/app/styles/modules/profile/profile-timeline.scss +++ b/app/styles/modules/profile/profile-timeline.scss @@ -1,4 +1,3 @@ - .profile-timeline { border-top: 1px solid $whitish; %profile-activity {