From 020cd90341b7fbfbd2c0bbf7d394c031bfc42849 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 6 Nov 2010 11:09:11 -0700 Subject: [PATCH] aspect labels on people#show view --- app/helpers/people_helper.rb | 10 ++++- app/views/aspects/manage.html.haml | 1 - app/views/people/_profile_sidebar.haml | 44 ++++++++++++++++++++ app/views/people/show.html.haml | 51 +---------------------- config/locales/diaspora/en.yml | 9 ++-- public/stylesheets/sass/application.sass | 53 ++++++++++++++++++++---- 6 files changed, 106 insertions(+), 62 deletions(-) create mode 100644 app/views/people/_profile_sidebar.haml diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 05f53def3..a764add8e 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -10,6 +10,14 @@ module PeopleHelper else I18n.t "people.helper.people_on_pod_are_aware_of" end - end + + def action_link(person, is_contact) + if is_contact + link_to t('.remove_friend'), person, :confirm => t('are_you_sure'), :method => :delete + elsif person == current_user.person + link_to t('.edit_my_profile'), edit_person_path(person) + end + end + end diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 93442db5c..bee17d28a 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -3,7 +3,6 @@ -# the COPYRIGHT file. - content_for :head do - = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'aspect-edit.js' #section_header diff --git a/app/views/people/_profile_sidebar.haml b/app/views/people/_profile_sidebar.haml new file mode 100644 index 000000000..b2897e763 --- /dev/null +++ b/app/views/people/_profile_sidebar.haml @@ -0,0 +1,44 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +#profile + .profile_photo + = person_image_link(person, :to => :photos) + + = action_link(person, is_contact) + + %ul + - if @posts.first + %li + %i= t(".last_seen",:how_long_ago => how_long_ago(@posts.first)) + + - if is_contact + %li + %ul#aspects_for_person + %b in aspects + %br + - for aspect in @aspects_with_person + %li= link_to aspect.name, aspect + + + %ul#profile_information + %li + %b bio + %br + = person.profile.bio + %li + %b gender + %br + = person.profile.gender + %li + %b born + %br + = "#{time_ago_in_words(person.profile.birthday)} ago" if @person.profile.birthday + + - if is_contact + /%li + /%i= t(".friends_since",:how_long_ago => how_long_ago(person)) + + %b.small= person.diaspora_handle + diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 7cd10f6b6..3cf1cead0 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -2,56 +2,9 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -- content_for :page_title do - profile .span-4.append-1.last - - #profile - .profile_photo - = person_image_link(@person, :to => :photos) - - %ul - -unless @posts.first.nil? - %li - %b.small= @person.diaspora_handle - %li - %i= t(".last_seen",:how_long_ago => how_long_ago(@posts.first)) - - - if @is_contact - %li - %i= t(".friends_since",:how_long_ago => how_long_ago(@person)) - %li - .person_aspects - ➔ - %ul - - for aspect in @aspects_with_person - %li= link_to aspect.name, aspect - - - /should be collapsed, either or, or request friend - - - if @is_contact - = link_to t('.remove_friend'), @person, :confirm => t('are_you_sure'), :method => :delete, :class => "button" - - - /profile junk - #profile_information - %ul - %li - %b bio-epic: - = @person.profile.bio - %li - %b gender: - = @person.profile.gender - %li - %b born: - = "#{time_ago_in_words(@person.profile.birthday)} ago" if @person.profile.birthday - %li - %b= link_to t('.edit_my_profile'), edit_person_path(@person) if @person == current_user.person - - - + = render 'profile_sidebar', :person => @person, :is_contact => @is_contact .span-15.last = render 'shared/author_info', :person => @person @@ -60,7 +13,7 @@ - if @posts.count > 0 %ul#stream - for post in @posts - = render type_partial(post), :post => post + = render 'shared/stream_element', :post => post = will_paginate @posts - else %h3= t('.no_posts') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index c70cb8bdf..b4198db86 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -260,13 +260,9 @@ en: new_person: "New Person" back_to_list: "Back to List" show: - last_seen: "last seen: %{how_long_ago}" - friends_since: "friends since: %{how_long_ago}" save: "save" - remove_friend: "remove friend" no_posts: "no posts to display!" add_friend: "add friend" - edit_my_profile: "Edit my profile" not_friends: "You're currently not friends with %{name}" request_people: "If you'd like, you can request to place him/her in one of your aspects." already_requested: "You have already sent a request to %{name}." @@ -296,6 +292,11 @@ en: update: updated: "Profile updated" failed: "Failed to update profile" + profile_sidebar: + remove_friend: "remove friend" + edit_my_profile: "Edit my profile" + last_seen: "last seen: %{how_long_ago}" + friends_since: "friends since: %{how_long_ago}" requests: new_request: add_a_new_friend_to: "Add a new friend to" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index eddc0a483..61a162594 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -572,14 +572,12 @@ ul.comments :margin 0 :padding 0 - #profile_information - ul + ul#profile_information + :margin + :top 1em + > li :margin - :top 1em - li - :margin - :bottom 1em - + :bottom 1em #stream, #profile, @@ -1506,3 +1504,44 @@ h3 span.current_gs_step :padding 12px :color #fff +#profile + ul#aspects_for_person + + > li + + :display inline-block + :padding 4px 2px 0 0 + + a + :border-radius 6px + :padding 2px 4px + :background + :color #eee + :font + :size smaller + :border 1px solid #ccc + :top 1px solid #ddd + :bottom 1px solid #aaa + + :color #777 + :text-shadow 0 1px #fff + + &:hover + :background + :color #ccc + :border 1px solid #999 + :top 1px solid #bbb + :bottom 1px solid #777 + + :color #444 + + &:active + :background + :color #666 + + :border 1px solid #555 + :top 1px solid #777 + :bottom 1px solid #222 + + :color #eee + :text-shadow none