aspect labels on people#show view
This commit is contained in:
parent
ecfcc96f8e
commit
020cd90341
6 changed files with 106 additions and 62 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
44
app/views/people/_profile_sidebar.haml
Normal file
44
app/views/people/_profile_sidebar.haml
Normal file
|
|
@ -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
|
||||
|
||||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue