From 0cceb4fdd3f0c579600e5e79f806600a7b607a19 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 5 Aug 2011 15:51:01 -0700 Subject: [PATCH] fixed people/contacts layout; pulled person sub-header into its own partial --- app/views/people/_sub_header.html.haml | 26 ++++++++++++++ app/views/people/contacts.haml | 45 ++---------------------- app/views/people/show.html.haml | 27 +------------- public/stylesheets/sass/application.sass | 7 ++++ 4 files changed, 37 insertions(+), 68 deletions(-) create mode 100644 app/views/people/_sub_header.html.haml diff --git a/app/views/people/_sub_header.html.haml b/app/views/people/_sub_header.html.haml new file mode 100644 index 000000000..0037b832c --- /dev/null +++ b/app/views/people/_sub_header.html.haml @@ -0,0 +1,26 @@ +#author_info + .right + - if user_signed_in? && current_user.person != person + = render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left' + - elsif user_signed_in? && current_user.person == person + = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path, :class => 'button creation' + + %h2 + = person.name + %span.diaspora_handle + = person.diaspora_handle + + .description + - if !person.profile.tag_string.blank? && user_signed_in? && (contact.persisted? || person == current_user.person || incoming_request) + = Diaspora::Taggable.format_tags(person.profile.tag_string) + - if user_signed_in? && person == current_user.person + %span.hover_edit + = link_to t('.edit'), edit_profile_path + - else + - if user_signed_in? && person == current_user.person + %i + = t('.you_have_no_tags') + %span.add_tags + = link_to t('.add_some'), edit_profile_path + +%hr diff --git a/app/views/people/contacts.haml b/app/views/people/contacts.haml index 2ce6bbebc..674d3576b 100644 --- a/app/views/people/contacts.haml +++ b/app/views/people/contacts.haml @@ -9,50 +9,11 @@ - content_for :page_title do = @person.name -.span-8.append-1.last +.span-6 = render :partial => 'people/profile_sidebar', :locals => {:person => @person, :contact => @contact } -.span-15.last - #author_info - - if user_signed_in? && !(@contact.persisted? || current_user.person == @person) - .right - - if @incoming_request - = link_to t('people.show.incoming_request', :name => truncate(@person.name, :length => 20, :separator => ' ', :omission => '')), - {:controller => "contacts", - :action => "new", - :person_id => @person.id}, - :class => 'share_with button', - :rel => 'facebox' - -else - = link_to t('people.show.start_sharing'), - {:controller => "contacts", - :action => "new", - :person_id => @person.id}, - :class => 'share_with button', - :rel => 'facebox' - - if @share_with - = javascript_tag "$(document).ready(function() {jQuery.facebox({ ajax: '#{new_contact_path(:person_id => @person.id)}' });});" - - - - else - - if user_signed_in? && @contact.person && @contact.receiving? - .right - = link_to t('people.show.mention'), new_status_message_path(:person_id => @person.id), :class => 'button', :rel => 'facebox' - - if @contact.mutual? - = link_to t('people.show.message'), new_conversation_path(:contact_id => @contact.id, :name => @contact.person.name, :contact_id => @contact.id), :class => 'button', :rel => 'facebox' - - %h3 - = @person.name - %span.diaspora_handle - = @person.diaspora_handle - .description - - if !@person.profile.tag_string.blank? - = Diaspora::Taggable.format_tags(@person.profile.tag_string) - - if user_signed_in? && @person == current_user.person - %span.hover_edit - = link_to t('people.show.edit'), edit_profile_path - - %hr +.span-18.last + = render 'people/sub_header', :person => @person, :contact => @contact #people_stream.stream - for hash in @hashes diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 95079b1d2..2ef531948 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -24,32 +24,7 @@ .span-18.last .stream_container - #author_info - .right - - if user_signed_in? && current_user.person != @person - = render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left' - - elsif user_signed_in? && current_user.person == @person - = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path, :class => 'button creation' - - %h2 - = @person.name - %span.diaspora_handle - = @person.diaspora_handle - - .description - - if !@person.profile.tag_string.blank? && user_signed_in? && (@contact.persisted? || @person == current_user.person || @incoming_request) - = Diaspora::Taggable.format_tags(@person.profile.tag_string) - - if user_signed_in? && @person == current_user.person - %span.hover_edit - = link_to t('.edit'), edit_profile_path - - else - - if user_signed_in? && @person == current_user.person - %i - = t('.you_have_no_tags') - %span.add_tags - = link_to t('.add_some'), edit_profile_path - - %hr + = render 'people/sub_header', :person => @person, :contact => @contact - if @posts.length > 0 -if @post_type == :photos diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 4ef44423a..d8b6b1700 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -357,6 +357,9 @@ ul.as-selections :margin :bottom 10px :right 10px + h2 + :margin + :bottom 0 &.show a @@ -372,6 +375,10 @@ ul.as-selections .right :top 10px + .description + :margin + :bottom 10px + #conversation_inbox a &:hover :text