From d3d7131c8dbb8a805475e55291f15090bff1eb0a Mon Sep 17 00:00:00 2001 From: danielvincent <danielgrippi@gmail.com> Date: Wed, 20 Oct 2010 13:47:16 -0700 Subject: [PATCH] stream using data-guid for messages. view fix in photo show --- app/views/js/_websocket_js.haml | 2 +- app/views/photos/_photo.haml | 4 ++-- app/views/photos/show.html.haml | 10 +++++++--- app/views/status_messages/_status_message.html.haml | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 3c88de4538..78312f5fee 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -37,7 +37,7 @@ }); function processRetraction(post_id){ - $('#' + post_id ).fadeOut(500).remove(); + $("*[data-guid='"+post_id+"']").fadeOut(400, function(){$(this).remove()}); if($("#stream")[0].childElementCount == 0){ $("#no_posts").fadeIn(200); } diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 5b7d8462e0..e3f1a5573f 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -2,7 +2,7 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%li.message{:id => post.id} +%li.message{:data=>{:guid=>post.id}} = person_image_tag(post.person) @@ -20,7 +20,7 @@ - if current_user.owns?(post) .right - = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" + = link_to t('.delete'), photo_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" =t('.posted_a_new_photo_to') = link_to post.album.name, object_path(post.album) diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 58f6a97bd6..f714d9783f 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -76,9 +76,13 @@ %div{:id => @photo.id} #show_photo - .edit_pane - .controls{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}} - = link_to 'make profile photo', '#', :class => "make_profile_photo" + + -if current_user.owns? @photo + .edit_pane + .controls{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}} + = link_to 'make profile photo', '#', :class => "make_profile_photo" + = linked_scaled_photo @photo, @album + -else = linked_scaled_photo @photo, @album .caption -if current_user.owns? @photo diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 47485d6856..7e065b475f 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -2,7 +2,7 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} +%li.message{ :data=>{:guid=>post.id}, :class => ("mine" if current_user.owns?(post))} = person_image_link(post.person) -- GitLab