Sha256: 7501928e806a1d322dadfbf9d6ab39081dede28f8257d336caef28058720bfdd

Contents?: true

Size: 849 Bytes

Versions: 119

Compression:

Stored size: 849 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() {
        Turbolinks.visit('<%= redirect_url.html_safe %>');
      }
    };
    Alchemy.Uploader(options);
  });
</script>

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.9 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.8 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.7 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.6 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.0.pre.b app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.5 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.0.14 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.4 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-7.0.0.pre.a app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.0.13 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.3 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.2 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.1 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.1.0 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.0.12 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.0.11 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.0.10 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-5.3.8 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-6.0.9 app/views/alchemy/admin/attachments/_replace_button.html.erb