diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 4019b871c..8b6ae849b 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -14,6 +14,7 @@ class PeopleController < ApplicationController def show @person = current_user.visible_person_by_id(params[:id]) @profile = @person.profile + @person_groups = current_user.groups_with_person(@person) @posts = Post.where(:person_id => @person.id, :_id.in => current_user.visible_post_ids).paginate :page => params[:page], :order => 'created_at DESC' diff --git a/app/models/user.rb b/app/models/user.rb index b9beb0409..a0f06cb5c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,7 +8,7 @@ class User key :friend_ids, Array key :pending_request_ids, Array - key :visible_post_ids, Array + key :_post_ids, Array one :person, :class_name => 'Person', :foreign_key => :owner_id @@ -213,7 +213,7 @@ class User end def groups_with_person person - id = ensure_bson person.id + id = ensure_bson person.object_id groups.select {|group| group.person_ids.include? id} end diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 39c60ec7e..8bf59a1aa 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -6,7 +6,6 @@ %h1 = @person.real_name - unless @person.id == current_user.person.id - .right = link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button" @@ -16,6 +15,8 @@ %i= "last seen: #{how_long_ago(@posts.first)}" %li %i= "friends since: #{how_long_ago(@person)}" + %li + ="groups: #{@person_groups}" %li url: = @person.url @@ -31,7 +32,7 @@ %h3= "stream - #{@post_count} item(s)" %ul#stream - for post in @posts - = render type_partial(post), :post => post + = render type_partial(post), :post => post unless post.class == Album = will_paginate @posts - else %h3 no posts to display! diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b603e790e..c549fffae 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -185,6 +185,7 @@ h1 :weight 200 :color #999 + h3 :position relativex :font