show photos from cubbies in the streams
This commit is contained in:
parent
9b941e6520
commit
41e1d0dd86
4 changed files with 9 additions and 4 deletions
|
|
@ -31,7 +31,7 @@ class AspectsController < ApplicationController
|
|||
|
||||
@aspect_ids = @aspects.map { |a| a.id }
|
||||
posts = current_user.visible_posts(:by_members_of => @aspect_ids,
|
||||
:type => 'StatusMessage',
|
||||
:type => ['StatusMessage','Bookmark'],
|
||||
:order => session[:sort_order] + ' DESC',
|
||||
:max_time => params[:max_time].to_i
|
||||
).includes(:comments, :mentions, :likes, :dislikes)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class BookmarksController < ApplicationController
|
|||
def create
|
||||
@bookmark = Bookmark.from_activity(params[:activity])
|
||||
@bookmark.author = current_user.person
|
||||
@bookmark.public = true
|
||||
|
||||
if @bookmark.save
|
||||
Rails.logger.info("event=create type=bookmark")
|
||||
|
|
|
|||
|
|
@ -86,10 +86,10 @@ class PeopleController < ApplicationController
|
|||
else
|
||||
@commenting_disabled = false
|
||||
end
|
||||
@posts = current_user.posts_from(@person).where(:type => "StatusMessage").includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time))
|
||||
@posts = current_user.posts_from(@person).where(:type => ["StatusMessage", "Bookmark"]).includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time))
|
||||
else
|
||||
@commenting_disabled = true
|
||||
@posts = @person.posts.where(:type => "StatusMessage", :public => true).includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time)).order('posts.created_at DESC')
|
||||
@posts = @person.posts.where(:type => ["StatusMessage", "Bookmark"], :public => true).includes(:comments).limit(15).where(StatusMessage.arel_table[:created_at].lt(max_time)).order('posts.created_at DESC')
|
||||
end
|
||||
|
||||
@posts = PostsFake.new(@posts)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@
|
|||
.from
|
||||
= person_link(post.author, :class => 'author')
|
||||
%time.time.timeago{:datetime => post.created_at, :integer => time_for_sort(post).to_i}
|
||||
|
||||
- if post.model.instance_of?(Bookmark)
|
||||
= image_tag post.image_url
|
||||
- else
|
||||
= render 'status_messages/status_message', :post => post, :photos => post.photos
|
||||
|
||||
.info
|
||||
|
|
|
|||
Loading…
Reference in a new issue