comment on tagged posts wip
This commit is contained in:
parent
9cc7523f0e
commit
a3eeb9f3c1
3 changed files with 4 additions and 4 deletions
|
|
@ -9,7 +9,6 @@ class TagFollowingsController < ApplicationController
|
|||
before_filter :save_sort_order, :only => :index
|
||||
|
||||
def index
|
||||
@commenting_disabled = true
|
||||
@stream = TagStream.new(current_user, :max_time => params[:max_time], :order => sort_order)
|
||||
if params[:only_posts]
|
||||
render :partial => 'shared/stream', :locals => {:posts => @stream.posts}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
ContentUpdater.addCommentToPost("<%= @comment.post.guid %>",
|
||||
"<%= @comment.guid%>",
|
||||
"<%= escape_javascript(render(:partial => 'comments/comment', :locals => { :comment => @comment, :person => current_user.person}))%>");
|
||||
"<%= escape_javascript(render(:partial => 'comments/comment', :locals => { :comment => @comment, :person => current_user.person, :post => @comment.post}))%>");
|
||||
|
|
|
|||
|
|
@ -28,14 +28,15 @@ class TagStream < BaseStream
|
|||
I18n.translate('streams.tags.contacts_title')
|
||||
end
|
||||
|
||||
def can_comment_on?(post)
|
||||
def can_comment?(post)
|
||||
@can_comment_cache ||= {}
|
||||
@can_comment_cache[post.id] ||= contacts_in_stream.find{|contact| contact.person_id == post.author.id}.present?
|
||||
@can_comment_cache[post.id] ||= user.person.id == post.author.id
|
||||
@can_comment_cache[post.id]
|
||||
end
|
||||
|
||||
def contacts_in_stream
|
||||
@contacts_in_stream ||= Contact.where(:user => user, :person => people).all
|
||||
@contacts_in_stream ||= Contact.where(:user_id => user.id, :person_id => people.map{|x| x.id}).all
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
Loading…
Reference in a new issue