diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index cc5afedcc..a66a4b7de 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -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) diff --git a/app/controllers/bookmarks_controller.rb b/app/controllers/bookmarks_controller.rb index 1635e1736..f3e1826cb 100644 --- a/app/controllers/bookmarks_controller.rb +++ b/app/controllers/bookmarks_controller.rb @@ -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") diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 7b8b74df1..78711df0b 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -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) diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index ad7e06344..d1a576947 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -22,7 +22,11 @@ .from = person_link(post.author, :class => 'author') %time.time.timeago{:datetime => post.created_at, :integer => time_for_sort(post).to_i} - = render 'status_messages/status_message', :post => post, :photos => post.photos + + - if post.model.instance_of?(Bookmark) + = image_tag post.image_url + - else + = render 'status_messages/status_message', :post => post, :photos => post.photos .info - if post.public?