going to a non-friend's page contains a way to add them.
This commit is contained in:
parent
f2b7e4010e
commit
8ec49e685b
3 changed files with 52 additions and 16 deletions
|
|
@ -16,15 +16,24 @@ class PeopleController < ApplicationController
|
|||
|
||||
def show
|
||||
@aspect = :profile
|
||||
@person = current_user.visible_person_by_id(params[:id])
|
||||
unless @person
|
||||
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
|
||||
else
|
||||
|
||||
@person = Person.find(params[:id].to_id)
|
||||
|
||||
if @person
|
||||
@profile = @person.profile
|
||||
@contact = current_user.contact_for(@person)
|
||||
@aspects_with_person = @contact.aspects if @contact
|
||||
|
||||
if @contact
|
||||
@aspects_with_person = @contact.aspects
|
||||
else
|
||||
@pending_request = current_user.pending_requests.find_by_person_id(@person.id)
|
||||
end
|
||||
|
||||
@posts = current_user.visible_posts(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
||||
respond_with @person
|
||||
else
|
||||
flash[:error] = "Person does not exist!"
|
||||
redirect_to people_path
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
- for aspect in @aspects_with_person
|
||||
%li= link_to aspect.name, aspect
|
||||
|
||||
- if @person != current_user.person && current_user.friends.include?(@person)
|
||||
- if @person != current_user.person && @contact
|
||||
= link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button"
|
||||
|
||||
- if @person == current_user.person
|
||||
|
|
@ -36,17 +36,43 @@
|
|||
|
||||
%br
|
||||
%br
|
||||
%ul
|
||||
%li= link_to 'stream', person_path(@person)
|
||||
%li= link_to 'photos', person_photos_path(@person)
|
||||
- if @person != current_user.person && @contact
|
||||
%ul
|
||||
%li= link_to 'stream', person_path(@person)
|
||||
%li= link_to 'photos', person_photos_path(@person)
|
||||
|
||||
|
||||
.span-15.last
|
||||
- if @posts.count > 0
|
||||
%ul#stream
|
||||
- for post in @posts
|
||||
= render type_partial(post), :post => post unless post.class == Album
|
||||
= will_paginate @posts
|
||||
- else
|
||||
%h3= t('.no_posts')
|
||||
|
||||
- if @contact || current_user.person == @person
|
||||
|
||||
- if @posts.count > 0
|
||||
%ul#stream
|
||||
- for post in @posts
|
||||
= render type_partial(post), :post => post unless post.class == Album
|
||||
= will_paginate @posts
|
||||
- else
|
||||
%h3= t('.no_posts')
|
||||
|
||||
- else
|
||||
|
||||
.floating
|
||||
%h3
|
||||
= "You're currently not friends with #{@person.real_name}"
|
||||
|
||||
|
||||
- unless @pending_request
|
||||
%h3
|
||||
.description
|
||||
If you'd like, you can request to place him/her in one of your aspects.
|
||||
|
||||
= form_for Request.new do |f|
|
||||
= f.select(:aspect_id, @aspects_dropdown_array)
|
||||
= f.hidden_field :destination_url, :value => @person.diaspora_handle
|
||||
= f.submit t('.add_friend')
|
||||
|
||||
- else
|
||||
%h3
|
||||
.description
|
||||
= "You have already sent a request to #{@person.real_name}."
|
||||
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ en:
|
|||
are_you_sure: "Are you sure?"
|
||||
remove_friend: "remove friend"
|
||||
no_posts: "no posts to display!"
|
||||
add_friend: "add friend"
|
||||
edit:
|
||||
cancel: "Cancel"
|
||||
update_profile: "Update Profile"
|
||||
|
|
|
|||
Loading…
Reference in a new issue