Select Thumbnail

Select an image, then click "Finish" to upload and insert it if you are certain your image is already web-ready. Otherwise, click "Next" to crop and resize your image before using it.

<%= form_tag_with_upload_progress({ :action => 'receive_image', :id => @pg, :overwrite => 1 }, { :finish => "if (arguments[0]) { $('filename').value = arguments[0]; $('mainform').onsubmit(); }" }) do -%>
File: <%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %>
Valid image types: jpeg, png, gif
<%= upload_status_tag %>
<%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; $('next_clicked_upload').value = '1'; $('next_clicked').value = '1'; this.disabled = true; this.value = 'Uploading...';" %> <%= submit_tag 'Finish', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %> <%= link_to_function "Cancel", "cancelSelectThumbnail()" %> <%= text_field_tag 'next_clicked_upload', '0', :style => 'display: none' %>
<%- end -%> <%= form_remote_tag(:update => 'select_thumbnail_dialog_content', :html => { :id => 'mainform' }, :url => { :action => 'crop_thumb', :id => @pg }) do -%> <%= text_field_tag 'next_clicked', '0', :style => 'display: none' %> <%= text_field_tag 'filename', '', :style => 'display: none' %> <%- end -%>