Sha256: 12b459525274b6569f40cd3ed30d5918a4d723dfb552cb9b7203e43e7e88a74a
Contents?: true
Size: 1.53 KB
Versions: 1
Compression:
Stored size: 1.53 KB
Contents
= form.fields_for :image do .uploadbox-image-uploader data-component="ImageUploader" - if namespace input name="[#{namespace}]#{upload_name}_id" data-item="id" type="hidden" value="#{resource.send(upload_name).try :id}" - else input name="#{upload_name}_id" data-item="id" type="hidden" value="#{resource.send(upload_name).try :id}" .fileupload data-provides="fileupload" class="fileupload-#{(resource.send(upload_name).present? or default) ? 'exists' : 'new'}" .fileupload-preview.thumbnail data-version="#{version}" data-width="#{width}" data-height="#{height}" style="width: #{width}px; height: #{height}px;" - if resource.send(upload_name).present? = img resource.send(upload_name).send(version) - elsif default = image_tag default, width: width, height: height .fileupload-actions span.btn.btn-file span.fileupload-new = choose_label span.fileupload-exists = update_label input type="file" data-url="#{uploadbox.images_path}" name="image[file]" input type="hidden" name="image[imageable_type]" value="#{resource.class}" input type="hidden" name="image[upload_name]" value="#{upload_name}" - if removable - if resource.send(upload_name).present? = link_to destroy_label, uploadbox.image_path(resource.send(upload_name)), class: 'btn fileupload-exists', remote: true, method: :delete - else = link_to destroy_label, '#', class: 'btn fileupload-exists', remote: true, method: :delete
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
uploadbox-0.0.7 | app/views/uploadbox/images/_uploader.html.slim |