Sha256: 148db78cb1f82c1f1277259d2ad73e5e25509856b4954e03919f7f37cac2ec71

Contents?: true

Size: 1.2 KB

Versions: 6

Compression:

Stored size: 1.2 KB

Contents

<% object_name = form.object.class.name.underscore %>
<% tag = "#{object_name}__#{image_name}" %>

<div class='b9bf30-upload-image-group'>
  <label id='b9bf30-upload-image-label-<%= tag %>'>
    <%= t("activerecord.attributes.#{object_name}.#{image_name}") %>
  </label>
  <div id='b9bf30-upload-image-<%= tag %>'
    class='b9bf30-upload-image'
    data-image-name='<%= image_name %>'
    data-disable-trigger='false'
    data-disable-hover='false'
    style='max-width: <%= width %>px; max-height: <%= height %>px; width: <%= width %>px; height: <%= height %>px;'>
    <% image = form.object.send(image_name) %>
    <% if image.url %>
      <% begin %>
        <%= image_tag image.url(:medium), id: "b9bf30-preview-#{tag}" %>
      <% rescue %>
        <%= image_tag image.url, id: "b9bf30-preview-#{tag}" %>
      <% end %>
    <% else %>
      <img class='b9bf30-blank-image' id='b9bf30-preview-<%= tag %>'></img>
    <% end %>
    <div id='b9bf30-change-shade-<%= tag %>' class='b9bf30-change-shade'>
      <div class='b9bf30-container'><div class='b9bf30-center'>
        <span><%= t('upload_image.actions.change') %></span>
      </div></div>
    </div>
  </div>
</div>
<%= form.file_field image_name, class: 'b9bf30-hide' %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
upload-image-0.1.8 app/views/_upload_image.html.erb
upload-image-0.1.7 app/views/_upload_image.html.erb
upload-image-0.1.6 app/views/_upload_image.html.erb
upload-image-0.1.5 app/views/_upload_image.html.erb
upload-image-0.1.4 app/views/_upload_image.html.erb
upload-image-0.1.3 app/views/_upload_image.html.erb