diaspora/app/views/people/_profile_sidebar.html.haml
Steffen van Bergerem d73da263d9 Unify profile sidebar
2013-08-19 14:57:42 +02:00

80 lines
2.8 KiB
Text

-# Copyright (c) 2010-2011, 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, :size => :thumb_large, :to => :photos)
- if user_signed_in?
- if person != current_user.person
= sharing_message(@person, @contact)
- if @contact && @contact.receiving?
%br
= 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), :class => 'button', :rel => 'facebox'
%br
%br
-if contact.sharing? || person == current_user.person
%ul#profile_information
- unless person.bio.blank?
%li
%h4
=t('.bio')
%div{ :class => direction_for(person.bio) }
= markdownify(person.profile.bio, :oembed => true, :newlines => true)
- unless person.profile.location.blank?
%li
%h4
=t('.location')
%div{ :class => direction_for(person.location) }
= markdownify(person.location, :oembed => true, :newlines => true)
- unless person.gender.blank?
%li
%h4
=t('.gender')
= person.gender
- unless person.birthday.blank?
%li
%h4
=t('.born')
= birthday_format(person.birthday)
- if @photos.present?
%li#image_list
%h4
= t('.photos')
.item_count
= "#{@photos.count}"
- @photos.limit(8).each do |photo|
= image_tag(photo.url(:thumb_small))
%br
= link_to t('layouts.header.view_all'), person_photos_path(person)
- if person == current_user.person
%li#image_list
%h4
= t('_contacts')
.item_count
= all_contacts_count
.section.contact_pictures
- current_user.contacts.limit(8).each do |contact|
= person_image_link contact.person, :size => :thumb_small
%p.see_all= link_to t('layouts.header.view_all'), contacts_path
- elsif @contact.persisted? && @contacts_of_contact_count > 0
%li#contacts_of_contact
%h4
= t('_contacts')
.item_count
= @contacts_of_contact_count
.section.contact_pictures
-@contacts_of_contact.limit(8).each do |person|
= person_image_link person, :size => :thumb_small
%p.see_all= link_to t('layouts.header.view_all'), person_contacts_path(@person)
%br
%br