Sha256: 2ee3a53e5b9d69607df0dc801fd0dc8038da1541e407af9f5d80addbe2178778

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

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)
- if field.optional? && field.errors.blank? && file && field.delete_method
  %a.btn.btn-info{:href => '#', :'data-toggle' => '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.method_name}"
  = form.check_box(field.delete_method, :style => 'display:none;' )
- if field.cache_method
  = form.hidden_field(field.cache_method)
= form.javascript_for(field) do
  :plain
    $("#{form.jquery_namespace(field)} .delete input[type='checkbox']").live('click', function() {
      $(this).parents('.input').first().children('.toggle').toggle('slow');
    });

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
obitum-rails_admin-0.0.5 app/views/rails_admin/main/_form_file_upload.html.haml
drewda_rails_admin-0.0.1 app/views/rails_admin/main/_form_file_upload.html.haml
obitum-rails_admin-0.0.4 app/views/rails_admin/main/_form_file_upload.html.haml
obitum-rails_admin-0.0.3 app/views/rails_admin/main/_form_file_upload.html.haml
obitum-rails_admin-0.0.2 app/views/rails_admin/main/_form_file_upload.html.haml