MS fixing small bugs, adding a very dump list of a groups that a friend is in for you
This commit is contained in:
parent
92a2df5c77
commit
204c910f66
4 changed files with 7 additions and 4 deletions
|
|
@ -14,6 +14,7 @@ class PeopleController < ApplicationController
|
||||||
def show
|
def show
|
||||||
@person = current_user.visible_person_by_id(params[:id])
|
@person = current_user.visible_person_by_id(params[:id])
|
||||||
@profile = @person.profile
|
@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'
|
@posts = Post.where(:person_id => @person.id, :_id.in => current_user.visible_post_ids).paginate :page => params[:page], :order => 'created_at DESC'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ class User
|
||||||
|
|
||||||
key :friend_ids, Array
|
key :friend_ids, Array
|
||||||
key :pending_request_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
|
one :person, :class_name => 'Person', :foreign_key => :owner_id
|
||||||
|
|
||||||
|
|
@ -213,7 +213,7 @@ class User
|
||||||
end
|
end
|
||||||
|
|
||||||
def groups_with_person person
|
def groups_with_person person
|
||||||
id = ensure_bson person.id
|
id = ensure_bson person.object_id
|
||||||
groups.select {|group| group.person_ids.include? id}
|
groups.select {|group| group.person_ids.include? id}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
%h1
|
%h1
|
||||||
= @person.real_name
|
= @person.real_name
|
||||||
- unless @person.id == current_user.person.id
|
- unless @person.id == current_user.person.id
|
||||||
|
|
||||||
.right
|
.right
|
||||||
= link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete, :class => "button"
|
= 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)}"
|
%i= "last seen: #{how_long_ago(@posts.first)}"
|
||||||
%li
|
%li
|
||||||
%i= "friends since: #{how_long_ago(@person)}"
|
%i= "friends since: #{how_long_ago(@person)}"
|
||||||
|
%li
|
||||||
|
="groups: #{@person_groups}"
|
||||||
%li
|
%li
|
||||||
url:
|
url:
|
||||||
= @person.url
|
= @person.url
|
||||||
|
|
@ -31,7 +32,7 @@
|
||||||
%h3= "stream - #{@post_count} item(s)"
|
%h3= "stream - #{@post_count} item(s)"
|
||||||
%ul#stream
|
%ul#stream
|
||||||
- for post in @posts
|
- for post in @posts
|
||||||
= render type_partial(post), :post => post
|
= render type_partial(post), :post => post unless post.class == Album
|
||||||
= will_paginate @posts
|
= will_paginate @posts
|
||||||
- else
|
- else
|
||||||
%h3 no posts to display!
|
%h3 no posts to display!
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,7 @@ h1
|
||||||
:weight 200
|
:weight 200
|
||||||
:color #999
|
:color #999
|
||||||
|
|
||||||
|
|
||||||
h3
|
h3
|
||||||
:position relativex
|
:position relativex
|
||||||
:font
|
:font
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue