Sha256: bac2cec3c1584a883568a73524634d54206d757fc699bd1f52f652e27828315e

Contents?: true

Size: 1.41 KB

Versions: 4

Compression:

Stored size: 1.41 KB

Contents


- key = Rails.application.config.session_options[:key]

:javascript
	$(document).ready(function() {
		
		var uploadify_script_data = {
			'#{key}' : '#{cookies[key]}',
			'#{request_forgery_protection_token}' : '#{form_authenticity_token}',
			'_http_accept': 'application/javascript'
		};
	
		$('#uploadify').uploadify({
			swf             : '#{asset_path("uploadify.swf")}',
			uploader        : '#{event_photos_path(@event)}',
			formData			  : uploadify_script_data,
			buttonClass     : 'btn btn-primary',
			buttonText      : 'Ajouter des photos',
			buttonCursor    : 'hand',
			cancelImg       : '/images/uploadify-cancel.png',
			height          : 17,
			auto            : true,
			multi           : true,
			removeCompleted : true,
			queueID					: 'queue',
			onUploadSuccess : function(file, data, response) {
				$('.photos_list')[0].innerHTML = data;
			},
			onUploadError : function(file, errorCode, errorMsg, errorString) {
				alert('Le fichier ' + file.name + ' n\'a pas pu être téléchargé: ' + errorString);
			}
		});
	});

%h1= @event.title

.head_bar
	= fields_for PhotosManager::Photo.new, :html => {:multipart => true} do |f|
		= f.file_field :image, :id => "uploadify"
	
#queue.uploadify-queue

.photos_list
	- unless @event.photos.empty?
		= render :partial => 'photos_manager/photos/listing', :locals => { :photos => @photos }

#photos_modal.modal.hide






Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
photos_manager-0.0.5 app/views/photos_manager/events/show.html.haml
photos_manager-0.0.4 app/views/photos_manager/events/show.html.haml
photos_manager-0.0.3 app/views/photos_manager/events/show.html.haml
photos_manager-0.0.2 app/views/photos_manager/events/show.html.haml