photo show links to original post and siblings. status message shows all photos associated with it. youtube player makes http/s call instead of just http.

This commit is contained in:
danielvincent 2010-11-21 16:08:39 -08:00
parent bd0c21a634
commit 069b372c19
5 changed files with 50 additions and 11 deletions

View file

@ -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

View file

@ -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}}

View file

@ -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

View file

@ -124,7 +124,7 @@ function openVideo(type, videoid, link) {
var container = document.createElement('div'),
$container = $(container);
if(type == 'youtube.com') {
$container.html('<a href="http://www.youtube.com/watch?v='+videoid+'" target="_blank">Watch this video on Youtube</a><br><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/'+videoid+'?fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+videoid+'?fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>');
$container.html('<a href="//www.youtube.com/watch?v='+videoid+'" target="_blank">Watch this video on Youtube</a><br><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/'+videoid+'?fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+videoid+'?fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>');
} else {
$container.html('Invalid videotype <i>'+type+'</i> (ID: '+videoid+')');
}

View file

@ -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