-# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - content_for :head do :javascript $(document).ready( function(){ $("#edit_photo_toggle").bind('click', function(evt) { evt.preventDefault(); $("#photo_edit_options").toggle(); $(".edit_photo input[type='text']").first().focus(); }); $('.edit_photo').bind('ajax:loading', function(data, json, xhr) { $("#photo_edit_options").toggle(); $("#photo_spinner").show(); $("#show_photo").find("img").fadeTo(200,0.3); }); $('.edit_photo').bind('ajax:failure', function(data, json, xhr) { alert('Failed to delete photo. Are you sure you own this?'); $("#show_photo").find("img").fadeTo(200,1); $("#photo_spinner").hide(); }); $('.edit_photo').bind('ajax:success', function(data, json, xhr) { json = $.parseJSON(json); $(".edit_photo input[type='text']").val(json['photo']['caption']); $("#caption").html(json['photo']['caption']); $("#show_photo").find("img").fadeTo(200,1); $("#photo_spinner").hide(); }); }); = render 'shared/author_info', :person => @photo.person, :post => @photo .span-14.append-1.last %div{:data=>{:guid=>@photo.id}} #show_photo -if @ownership = image_tag 'ajax-loader.gif', :id => "photo_spinner", :class => "hidden" = image_tag @photo.url(:scaled_full) .photo_options{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_large)}"}} = link_to t('.make_profile_photo'), '#', :class => 'make_profile_photo' | = link_to t('.edit'), '#', :id => "edit_photo_toggle" -else = image_tag @photo.url(:scaled_full) #caption = @photo.caption %br -if @ownership #photo_edit_options %h4= t('.edit_delete_photo') %p = form_for @photo, :remote => true do |p| = p.text_field :caption, :value => @photo.caption = p.submit t('.update_photo') %p = button_to t('.delete_photo'), @photo, :confirm => t('are_you_sure'), :method => :delete .span-9.last - if @photo.status_message_id #original_post_info %h4{:style=>"position:relative;"} = t('.original_post') = link_to t('.view'), @photo.status_message %p = @photo.status_message.message %p - for photo in @photo.status_message.photos = link_to (image_tag photo.url(:thumb_small)), object_path(photo) %h4= t('_comments') - if @photo.status_message_id %div{:id => 'status_message_stream', :class => 'stream show'} %li.message{:data=>{:guid=>@photo.status_message_id}} = render "comments/comments", :post => @photo.status_message - else %div{:id => 'photo_stream', :class => 'stream show'} %li.message{:data=>{:guid=>@photo.id}} = render "comments/comments", :post => @photo