Sha256: c40a1b88145bfb6d2ce480d007cba1fe2183775cf24c4088232ceaf099ef0e43

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 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"
    - else
      input name="#{upload_name}_id" data-item="id" type="hidden"
    .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.6 app/views/uploadbox/images/_uploader.html.slim