From 875ff4fb447a4a7061a35e71be9e8b07ffc2d286 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Wed, 18 Nov 2015 13:06:22 +0100 Subject: [PATCH] rearrange templates, start unifying avatar --- app/components/org-item.coffee | 1 - app/controllers/top.coffee | 3 ++- app/styles/app.scss | 1 + app/styles/app/layouts/profile.sass | 4 +--- app/styles/app/modules/avatar.sass | 17 +++++++++++++++++ app/templates/profile/accounts.hbs | 29 +++++++++++++---------------- app/templates/top.hbs | 3 ++- app/views/profile-accounts.coffee | 3 ++- 8 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 app/styles/app/modules/avatar.sass diff --git a/app/components/org-item.coffee b/app/components/org-item.coffee index 34b6a84f..64233d3e 100644 --- a/app/components/org-item.coffee +++ b/app/components/org-item.coffee @@ -14,7 +14,6 @@ OrgItemComponent = Ember.Component.extend ).property('account') avatarUrl: (-> - console.log(@get('account')) @get('account.avatarUrl') || false ).property('account') diff --git a/app/controllers/top.coffee b/app/controllers/top.coffee index e532a19c..9c8f4584 100644 --- a/app/controllers/top.coffee +++ b/app/controllers/top.coffee @@ -13,7 +13,8 @@ Controller = Ember.Controller.extend ).property('user.login', 'user.name') gravatarUrl: (-> - "#{location.protocol}//www.gravatar.com/avatar/#{@get('user.gravatarId')}?s=48&d=mm" + if @get('user.gravatarId') + "#{location.protocol}//www.gravatar.com/avatar/#{@get('user.gravatarId')}?s=36&d=mm" ).property('user.gravatarId') defineTowerColor: (broadcastArray) -> diff --git a/app/styles/app.scss b/app/styles/app.scss index d4e03f6b..e82536f8 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -43,6 +43,7 @@ @import "app/modules/forms"; @import "app/modules/notice"; @import "app/modules/build-header"; +@import "app/modules/avatar"; @import "app/layout"; @import "app/layouts/dashboard"; diff --git a/app/styles/app/layouts/profile.sass b/app/styles/app/layouts/profile.sass index b9fcd4d6..e3e84e36 100644 --- a/app/styles/app/layouts/profile.sass +++ b/app/styles/app/layouts/profile.sass @@ -128,9 +128,7 @@ p.profile-user-last .profile-orglist @media #{$large-up} - padding-right: 10em - aside - padding: 0 + padding: 0 3em 0 0 .profile-hooklist @include resetul diff --git a/app/styles/app/modules/avatar.sass b/app/styles/app/modules/avatar.sass new file mode 100644 index 00000000..2931168a --- /dev/null +++ b/app/styles/app/modules/avatar.sass @@ -0,0 +1,17 @@ +%avatar + background-color: hotpink + border-radius: 50% + background-image: linear-gradient(top left, $grey-dark 30%, $grey-medium 40%, $grey-medium 60%, $grey-dark 70%) + +.default-avatar--profile + @extend %avatar + width: 2.6rem + height: 2.6rem + +.default-avatar--topbar + @extend %avatar + width: 2.7rem + height: 2.7rem + display: inline-block + vertical-align: middle + margin-left: 0.3em diff --git a/app/templates/profile/accounts.hbs b/app/templates/profile/accounts.hbs index 66767295..7673c395 100644 --- a/app/templates/profile/accounts.hbs +++ b/app/templates/profile/accounts.hbs @@ -1,22 +1,19 @@ - - diff --git a/app/templates/top.hbs b/app/templates/top.hbs index 162046da..b91d555d 100644 --- a/app/templates/top.hbs +++ b/app/templates/top.hbs @@ -56,7 +56,8 @@ {{/if}} {{#if auth.signedIn}} - {{#link-to "profile" class="navigation-anchor signed-in"}}{{userName}} + {{#link-to "profile" class="navigation-anchor signed-in"}}{{userName}} + {{#if gravatarUrl }}{{else}}
{{/if}} {{/link-to}} {{/if}} {{#if auth.signingIn}} diff --git a/app/views/profile-accounts.coffee b/app/views/profile-accounts.coffee index 67486cbf..20a32553 100644 --- a/app/views/profile-accounts.coffee +++ b/app/views/profile-accounts.coffee @@ -2,7 +2,8 @@ View = BasicView.extend tabBinding: 'controller.tab' - classNames: ['profile-orglist'] + classNames: ['profile-orglist', 'columns', 'medium-4'] + tagName: 'aside' templateName: 'profile/accounts' classAccounts: (-> 'active' if @get('tab') == 'accounts'