83 lines
2.8 KiB
Text
83 lines
2.8 KiB
Text
-# 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() {
|
|
$("#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"
|
|
.edit_pane
|
|
.controls{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}}
|
|
= link_to t('.make_profile_photo'), '#', :class => "make_profile_photo"
|
|
|
|
|
= link_to 'edit', '#', :id => "edit_photo_toggle"
|
|
= image_tag @photo.url(:scaled_full)
|
|
|
|
-else
|
|
= image_tag @photo.url(:scaled_full)
|
|
|
|
#caption
|
|
= @photo.caption
|
|
|
|
%br
|
|
|
|
-if @ownership
|
|
#photo_edit_options
|
|
%h4 Edit photo description / 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;"}
|
|
Original Post
|
|
= link_to '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 Comments
|
|
%div{:id => 'photo_stream', :class => 'stream show'}
|
|
%li.message{:data=>{:guid=>@photo.id}}
|
|
= render "comments/comments", :post => @photo
|