Sha256: d7b34554c46a9065276bac4d49ec6635fe92eaa0b14c46a4728339831829e4f6

Contents?: true

Size: 888 Bytes

Versions: 9

Compression:

Stored size: 888 Bytes

Contents

- file = form.object.send(field.method_name).presence

.toggle{style: ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')}
  - if value = field.pretty_value
    = value

  = form.file_field(field.name, field.html_attributes.reverse_merge({ data: { fileupload: true }}))

- if field.optional? && field.errors.blank? && file && field.delete_method
  %a.btn.btn-info.btn-remove-image{href: '#', :'data-toggle' => 'button', role: 'button', onclick: "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false;"}
    %i.icon-white.icon-trash
    = I18n.t('admin.actions.delete.menu').capitalize + " #{field.label.downcase}"

  = form.check_box(field.delete_method, style: 'display:none;')

- if field.cache_method
  = form.hidden_field(field.cache_method)

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
rails_admin-1.3.0 app/views/rails_admin/main/_form_file_upload.html.haml
rails_admin-1.2.0 app/views/rails_admin/main/_form_file_upload.html.haml
rails_admin-1.1.1 app/views/rails_admin/main/_form_file_upload.html.haml
rails_admin-1.1.0 app/views/rails_admin/main/_form_file_upload.html.haml
rails_admin-1.0.0 app/views/rails_admin/main/_form_file_upload.html.haml
rails_admin-1.0.0.rc app/views/rails_admin/main/_form_file_upload.html.haml
rails_admin-0.8.1 app/views/rails_admin/main/_form_file_upload.html.haml
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/app/views/rails_admin/main/_form_file_upload.html.haml
rails_admin-0.7.0 app/views/rails_admin/main/_form_file_upload.html.haml