From 32cc97c7f5ccad0bc9e5cb7cea32dc34ba4d5e67 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Fri, 8 May 2015 13:18:31 +0200 Subject: [PATCH] basic profile bar --- app/modules/profile/includes/profile-bar.jade | 41 ------------------- .../profile-bar/profile-bar.controller.coffee | 9 ++++ .../profile-bar/profile-bar.directive.coffee | 9 ++++ .../profile/profile-bar/profile-bar.jade | 40 ++++++++++++++++++ app/modules/profile/profile.jade | 2 +- 5 files changed, 59 insertions(+), 42 deletions(-) delete mode 100644 app/modules/profile/includes/profile-bar.jade create mode 100644 app/modules/profile/profile-bar/profile-bar.controller.coffee create mode 100644 app/modules/profile/profile-bar/profile-bar.directive.coffee create mode 100644 app/modules/profile/profile-bar/profile-bar.jade diff --git a/app/modules/profile/includes/profile-bar.jade b/app/modules/profile/includes/profile-bar.jade deleted file mode 100644 index fde3251b..00000000 --- a/app/modules/profile/includes/profile-bar.jade +++ /dev/null @@ -1,41 +0,0 @@ -section.profile-bar - div.profile-image-wrapper - img.profile-img(src="http://i.imgur.com/gPiHzHN.jpg", alt="{{ user.nickname }}") - div.edit-profile(title="{{ 'USER.PROFILE.EDIT' | translate }}") - a.profile-edition(title="{{ 'USER.PROFILE.EDIT' | translate }}", href="") - span.icon.icon-edit - span(translate="USER.PROFILE.EDIT") - a.button-green - span(translate="USER.PROFILE.FOLLOW") - div.profile-data - h1 Silvia Rodríguez - // If user has no defined role in its profile use all its project defined roles followed by an & - h2 Backend Developer & Stackeholder - div.location - include ../../../svg/location.svg - span Madrid - // Remove Abuse Flag when a user is seeing itself - a.flag(href="", title="{{ 'USER.PROFILE.REPORT' | translate }}") - include ../../../svg/flag.svg - // These values in profile stats are not defined yet in UX. Please ask - div.profile-stats - div.stat - span.stat-number 3 - span.stat-name(translate="USER.PROFILE.PROJECTS") - div.stat - span.stat-number 67 - span.stat-name(translate="USER.PROFILE.CLOSED_US") - div.stat - span.stat-number 34 - span.stat-name(translate="USER.PROFILE.CONTACTS") - // TODO Hide until organizations come - div.profile-organizations - h3 Organizations - div.profile-organizations-wrapper - div.organization - div.organization - div.organization - div.organization - - div.profile-quote - span "Small minds talk about people, average minds discuss events, great minds discuss ideas" diff --git a/app/modules/profile/profile-bar/profile-bar.controller.coffee b/app/modules/profile/profile-bar/profile-bar.controller.coffee new file mode 100644 index 00000000..25701f9a --- /dev/null +++ b/app/modules/profile/profile-bar/profile-bar.controller.coffee @@ -0,0 +1,9 @@ +class ProfileBarController + @.$inject = [ + "$tgAuth" + ] + + constructor: (@auth) -> + @.user = @auth.getUser() + +angular.module("taigaProfile").controller("ProfileBar", ProfileBarController) diff --git a/app/modules/profile/profile-bar/profile-bar.directive.coffee b/app/modules/profile/profile-bar/profile-bar.directive.coffee new file mode 100644 index 00000000..2c5e053e --- /dev/null +++ b/app/modules/profile/profile-bar/profile-bar.directive.coffee @@ -0,0 +1,9 @@ +ProfileBarDirective = () -> + return { + templateUrl: "profile/profile-bar/profile-bar.html", + controller: "ProfileBar", + controllerAs: "vm" + } + + +angular.module("taigaProfile").directive("tgProfileBar", ProfileBarDirective) diff --git a/app/modules/profile/profile-bar/profile-bar.jade b/app/modules/profile/profile-bar/profile-bar.jade new file mode 100644 index 00000000..a568a9e3 --- /dev/null +++ b/app/modules/profile/profile-bar/profile-bar.jade @@ -0,0 +1,40 @@ +section.profile-bar + div.profile-image-wrapper + img.profile-img(ng-src="{{user.big_photo}}", alt="{{ user.full_name }}") + div.edit-profile(title="{{ 'USER.PROFILE.EDIT' | translate }}") + a.profile-edition(title="{{ 'USER.PROFILE.EDIT' | translate }}", tg-nav="user-settings-user-profile") + span.icon.icon-edit + span(translate="USER.PROFILE.EDIT") + // a.button-green + // span(translate="USER.PROFILE.FOLLOW") + div.profile-data + h1 {{vm.user.full_name}} + h2 Backend Developer & Stackeholder + // div.location + // include ../../../svg/location.svg + // span Madrid + // Remove Abuse Flag when a user is seeing itself + // a.flag(href="", title="{{ 'USER.PROFILE.REPORT' | translate }}") + // include ../../../svg/flag.svg + // These values in profile stats are not defined yet in UX. Please ask + // div.profile-stats + // div.stat + // span.stat-number 3 + // span.stat-name(translate="USER.PROFILE.PROJECTS") + // div.stat + // span.stat-number 67 + // span.stat-name(translate="USER.PROFILE.CLOSED_US") + // div.stat + // span.stat-number 34 + // span.stat-name(translate="USER.PROFILE.CONTACTS") + // TODO Hide until organizations come + // div.profile-organizations + // h3 Organizations + // div.profile-organizations-wrapper + // div.organization + // div.organization + // div.organization + // div.organization + + div.profile-quote + span "Small minds talk about people, average minds discuss events, great minds discuss ideas" diff --git a/app/modules/profile/profile.jade b/app/modules/profile/profile.jade index f7a6bd2e..07059af6 100644 --- a/app/modules/profile/profile.jade +++ b/app/modules/profile/profile.jade @@ -1,6 +1,6 @@ include ../../partials/includes/components/beta div.profile.centered - include includes/profile-bar + div(tg-profile-bar) div.main div.timeline-wrapper(tg-profile-tabs) div(tg-profile-tab="activity", tab-title="{{'USER.PROFILE.ACTIVITY_TAB' | translate}}", tab-icon="icon-timeline", tab-active)