diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 492a673c6..03f6d0870 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -11,7 +11,7 @@ class PhotosController < ApplicationController def index @aspect = :profile @post_type = :photos - @person = Person.find(params[:person_id].to_id) + @person = Person.find_by_id(params[:person_id]) if @person @profile = @person.profile @@ -24,7 +24,8 @@ class PhotosController < ApplicationController @pending_request = current_user.pending_requests.find_by_person_id(@person.id) end - @posts = current_user.visible_posts(:_type => 'Photo', :person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' + @posts = current_user.raw_visible_posts.all(:_type => 'Photo', :person_id => @person.id, :order => 'created_at DESC').paginate :page => params[:page], :order => 'created_at DESC' + render 'people/show' else diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index c7705fecc..cfc70a5c9 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -56,6 +56,20 @@ = link_to t('.delete_photo'), @photo, :confirm => t('are_you_sure'), :method => :delete, :class => 'button' .span-9.last + + - if @photo.status_message_id + #original_post_info + %h4{:style=>"margin-bottom:5px;position:relative;"} + Original Post + =link_to 'view', @photo.status_message + + %p + = @photo.status_message.message + + - for photo in @photo.status_message.photos + = link_to (image_tag photo.url(:thumb_small)), object_path(photo) + %br + %h4{:style=>"margin-bottom:5px;"} Comments %div{id => 'photo_stream', :class => 'stream show'} %li.message{:data=>{:guid=>@photo.id}} diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index b7a0ce1fc..3ffde4d07 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -9,8 +9,12 @@ #show_text %p = markdownify(@status_message.message) - .time - = how_long_ago(@status_message) + + - for photo in @status_message.photos + = link_to (image_tag photo.url(:thumb_small)), object_path(photo) + + .time + = how_long_ago(@status_message) - if current_user.owns? @status_message = link_to t('.destroy'), @status_message, :confirm => t('are_you_sure'), :method => :delete diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 8125df392..b11da0a45 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -124,7 +124,7 @@ function openVideo(type, videoid, link) { var container = document.createElement('div'), $container = $(container); if(type == 'youtube.com') { - $container.html('Watch this video on Youtube
'); + $container.html('Watch this video on Youtube
'); } else { $container.html('Invalid videotype '+type+' (ID: '+videoid+')'); } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 1fd711c7f..d503f8e08 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -240,12 +240,6 @@ header :-moz-border-radius 5px :border-radius 5px - .stream_photo - img - :height 200px - :width 200px - - .from :font :family 'Helvetica neue', Arial, Helvetica, sans-serif @@ -1329,6 +1323,14 @@ input[type="search"] :size 18px :weight bold + img + :-webkit-box-shadow 0 1px 2px #666 + :-moz-box-shadow 0 1px 2px #666 + + :-webkit-border-radius 5px + :-moz-border-radius 5px + :border-radius 5px + .edit_pane :display inline @@ -1912,3 +1914,21 @@ h3,h4 input :width 100% +#original_post_info + p + :color #999 + + h4 + a + :font + :size 12px + + + img + :-webkit-box-shadow 0 1px 2px #666 + :-moz-box-shadow 0 1px 2px #666 + + :-webkit-border-radius 5px + :-moz-border-radius 5px + :border-radius 5px +