Sha256: e55106973467dee9a24d69cc4e3b226d70416492846394b72e611ef4b565542f

Contents?: true

Size: 898 Bytes

Versions: 21

Compression:

Stored size: 898 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 :file_change %>
  <% 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() {
        Alchemy.pleaseWaitOverlay();
        window.location.href = '<%= redirect_url.html_safe %>';
      }
    };
    Alchemy.Uploader(options);
  });
</script>

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.7 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.6 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.5 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.4 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.3 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.5 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.2 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.1 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.4 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.0 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.3 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.2 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.0.rc2 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.0.rc1 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.1 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-4.0.0.beta app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.6.0 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.5.0 app/views/alchemy/admin/attachments/_replace_button.html.erb
alchemy_cms-3.5.0.rc2 app/views/alchemy/admin/attachments/_replace_button.html.erb