diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index 78b8de72c..d964ed530 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -3,7 +3,10 @@ class AppsController < ApplicationController @app = 'cubbies' @posts = ActivityStreams::Photo max_time = params[:max_time] ? Time.at(params[:max_time].to_i) : Time.now - @posts = @posts.where(ActivityStreams::Photo.arel_table[:created_at].lt(max_time)).where(:public => true).order('posts.created_at DESC').limit(15).includes(:author) + @posts = @posts.where(ActivityStreams::Photo.arel_table[:created_at].lt(max_time) + ).where(:public => true + ).order('posts.created_at DESC' + ).includes(:author => :profile).limit(30) @commenting_disabled = true @people = [] @people_count = 0 diff --git a/app/views/apps/show.html.haml b/app/views/apps/show.html.haml index 0d2633de6..6635d9323 100644 --- a/app/views/apps/show.html.haml +++ b/app/views/apps/show.html.haml @@ -17,15 +17,15 @@ %h1 = "#{@app}" -#main_stream.stream +#main_stream.stream.canvas - if @posts.length > 0 - .canvas.stream - - for post in @posts - .image-element.stream-element - .hold-me - = link_to(image_tag(post.image_url), object_path(post)) - .via - = post.author.name + - for post in @posts + .image-element.stream_element + .hold-me + = link_to(image_tag(post.image_url), object_path(post)) + .via + = post.author.name + .time{:integer => post.created_at.to_i} #pagination =link_to(t('more'), next_page_path, :class => 'paginate') diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index def4b94d4..e3cd9bde6 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -2928,7 +2928,9 @@ h1.tag :width 98% .canvas - .image-element + .image-element, + .stream_element + :border none :padding 20px :height 170px :width 170px diff --git a/spec/factories.rb b/spec/factories.rb index db83249dc..a8cdb72de 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -103,10 +103,11 @@ end Factory.define(:activity_streams_photo, :class => ActivityStreams::Photo) do |p| p.association(:author, :factory => :person) p.image_url "http://example.com/awesome.png" - p.image_height 9001 - p.image_width 4 + p.image_height 900 + p.image_width 400 p.object_url "http://example.com/awesome_things.gif" p.objectId "http://example.com/awesome_things.gif" p.actor_url "http://notcubbi.es/cubber" p.provider_display_name "not cubbies" + p.public true end