Merge branch 'master' of github.com:diaspora/diaspora
Conflicts: app/helpers/application_helper.rb app/views/comments/_comment.html.haml app/views/people/_person.html.haml app/views/shared/_stream_element.html.haml
This commit is contained in:
commit
fa66162de5
7 changed files with 33 additions and 16 deletions
|
|
@ -12,6 +12,7 @@ class PeopleController < ApplicationController
|
|||
@aspect = :search
|
||||
|
||||
@people = Person.search(params[:q]).paginate :page => params[:page], :per_page => 25, :order => 'created_at DESC'
|
||||
@requests = Request.all(:to_id.in => @people.map{|p| p.id})
|
||||
|
||||
#only do it if it is an email address
|
||||
if params[:q].try(:match, Devise.email_regexp)
|
||||
|
|
|
|||
|
|
@ -96,7 +96,13 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def person_image_tag(person)
|
||||
image_tag image_or_default(person), :class => "avatar", :alt => person.name, :title => person.name, "data-person_id" => person.id
|
||||
"<img alt='#{person.name}' class='avatar' data-person_id='#{person.id}' src='#{image_or_default(person)}' title='#{person.name}'>".html_safe
|
||||
end
|
||||
|
||||
def person_link(person)
|
||||
"<a href='/people/#{person.id}'>
|
||||
#{person.name}
|
||||
</a>".html_safe
|
||||
end
|
||||
|
||||
def image_or_default(person)
|
||||
|
|
@ -114,7 +120,9 @@ module ApplicationHelper
|
|||
if opts[:to] == :photos
|
||||
link_to person_image_tag(person), person_photos_path(person)
|
||||
else
|
||||
link_to person_image_tag(person), person_path(person)
|
||||
"<a href='/people/#{person.id}'>
|
||||
#{person_image_tag(person)}
|
||||
</a>".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,14 @@ module SocketsHelper
|
|||
}
|
||||
v = render_to_string(:partial => 'shared/stream_element', :locals => post_hash)
|
||||
elsif object.is_a? Person
|
||||
v = render_to_string(:partial => type_partial(object), :locals => {:single_aspect_form => opts[:single_aspect_form], :person => object, :aspects => user.aspects, :current_user => user})
|
||||
person_hash = {
|
||||
:single_aspect_form => opts[:single_aspect_form],
|
||||
:person => object,
|
||||
:aspects => user.aspects,
|
||||
:contact => user.contact_for(object),
|
||||
:request => user.request_for(object),
|
||||
:current_user => user}
|
||||
v = render_to_string(:partial => 'people/person', :locals => person_hash)
|
||||
elsif object.is_a? Comment
|
||||
v = render_to_string(:partial => 'comments/comment', :locals => {:hash => {:comment => object, :person => object.person}})
|
||||
else
|
||||
|
|
|
|||
|
|
@ -4,11 +4,10 @@
|
|||
- comment = hash[:comment]
|
||||
- person = hash[:person]
|
||||
%li.comment{:data=>{:guid=>comment.id}}
|
||||
%a{:href => "/people/#{person.id}"}
|
||||
%img{:src => image_or_default(person), :class => "avatar", :alt => person.name, :title => person.name, "data-person_id" => person.id}
|
||||
=person_image_link(person)
|
||||
.content
|
||||
.from
|
||||
%a{:href => "/people/#{person.id}"}=person.name
|
||||
=person_link(person)
|
||||
= markdownify(comment.text, :youtube_maps => comment[:youtube_titles])
|
||||
%div.time
|
||||
= comment.created_at ? "#{time_ago_in_words(comment.created_at)} #{t('ago')}" : time_ago_in_words(Time.now)
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
.content
|
||||
%span.from
|
||||
= link_to person.name, person_path(person)
|
||||
=person_link(person)
|
||||
|
||||
.right{:style=>"display:inline;"}
|
||||
- if person.id == current_user.person.id
|
||||
- if person.owner_id == current_user.id
|
||||
= t('.thats_you')
|
||||
- elsif current_user.person_objects.include?(person)
|
||||
- elsif contact
|
||||
= t('.already_connected')
|
||||
- elsif current_user.request_for(person)
|
||||
- elsif request
|
||||
= link_to t('.pending_request'), aspects_manage_path
|
||||
- else
|
||||
- single_aspect_form ||= nil
|
||||
|
|
|
|||
|
|
@ -9,6 +9,10 @@
|
|||
|
||||
%ul{:class => 'stream people', :id => 'people_stream'}
|
||||
- for person in @people
|
||||
= render 'people/person', :person => person, :aspects => @aspects
|
||||
= render 'people/person',
|
||||
:person => person,
|
||||
:aspects => @aspects,
|
||||
:contact => @contacts.detect{|contact| contact.person_id == person.id},
|
||||
:request => @requests.detect{|request| request.to_id == person.id}
|
||||
|
||||
= will_paginate @people
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
%li.message{:data=>{:guid=>post.id}}
|
||||
%a{:href => "/people/#{person.id}"}
|
||||
%img{:src => image_or_default(person), :class => "avatar", :alt => person.name, :title => person.name, "data-person_id" => person.id}
|
||||
|
||||
=person_image_link(person)
|
||||
.content
|
||||
.from
|
||||
%a{:href => "/people/#{person.id}"}=person.name
|
||||
=person_link(person)
|
||||
|
||||
- if person.owner_id == current_user.id
|
||||
.aspect
|
||||
|
|
@ -22,7 +20,7 @@
|
|||
.right
|
||||
- reshare_aspects = aspects_without_post(aspects, post)
|
||||
- unless reshare_aspects.empty?
|
||||
= render 'shared/reshare', :current_user => current_user, :aspects => reshare_aspects, :post => post
|
||||
= render 'shared/reshare', :aspects => reshare_aspects, :post => post
|
||||
= link_to t('delete'), status_message_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete"
|
||||
|
||||
= render 'status_messages/status_message', :post => post, :photos => photos
|
||||
|
|
|
|||
Loading…
Reference in a new issue