Sha256: 791e8e4e3c871965ed21daa2aa12a3b6ef0a0c4d05fcd50c59fe41e2e298a139

Contents?: true

Size: 844 Bytes

Versions: 19

Compression:

Stored size: 844 Bytes

Contents

<%= form_for [:admin, object], html: {multipart: true, class: 'upload-button'} do |f| %>
  <%= f.file_field file_attribute,
    class: 'fileupload--field',
    name: "#{f.object_name}[#{file_attribute}]",
    id: "replace_#{dom_id(object)}" %>
  <%= label_tag "replace_#{dom_id(object)}", title: Alchemy.t(:replace_file) do %>
    <%= render_icon :sync %>
  <% end %>
<% end %>

<% file_types = local_assigns[:file_types].presence ||
  configuration(:uploader)['allowed_filetypes'][object.class.model_name.collection] || ['*'] %>

<script type='text/javascript'>
  $(function() {
    var options = {
      selector: '#replace_<%= dom_id(object) %>',
      file_types: '<%= file_types.join("|") %>',
      complete: function() {
        Turbo.visit('<%= redirect_url.html_safe %>');
      }
    };
    Alchemy.Uploader(options);
  });
</script>

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
alchemy_cms-7.0.16 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.15 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.14 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.13 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.12 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.11 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.10 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.9 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.8 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.7 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.6 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.5 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.4 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.3 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.2 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.1 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.0 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.0.pre.rc1 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.0.pre.c app/views/alchemy/admin/attachments/_replace_button.html.erb