Sha256: d6650bddd8581f48c2252b64894a85b5453b75e67900918e0ba17c070054ac00

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

<% content_for(:upload, true) %>

<div class="cas-attachments dropzone" data-attachable-type="contents" data-attachable-id="<%= @content.id %>">
  <div class="dropzone-description">
    <div class="container">
      Solte seus arquivos para fazer upload.
    </div>
  </div>
  <div class="container">
    <div class="upload-input">
      <%= f.input :file,
        as: :file,
        type: :string,
        label: "Anexos",
        input_html: {
          multiple: "multiple",
          images: "#js-item-images",
        } %>
    </div>

    <script id="cas-attachments-template" type="text/x-custom-template">
      <%= render "form_attachments_template",
        file_id: '',
        file_name: '' %>
    </script>

    <div id="attachments-list">
      <% @content.attachments.order("cas_media_files.order asc").each do |file| %>
        <%= render "form_attachments_template",
          file_id: file.id,
          file_name: file.original_name %>
      <% end %>
    </div>
  </div>
</div>

<% if Rails.env.test? %>
  <%= hidden_field_tag "images[files][0][id]", "", id: "test_file_1" %>
  <%= hidden_field_tag "images[files][1][id]", "", id: "test_file_2" %>
  <%= hidden_field_tag "images[files][2][id]", "", id: "test_file_3" %>
  <%= hidden_field_tag "images[cover_id]", "", id: "test_file_cover_id" %>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cas-cms-1.0.0.alpha2 app/views/cas/sites/sections/contents/_form_attachments.html.erb
cas-cms-1.0.0.alpha1 app/views/cas/sites/sections/contents/_form_attachments.html.erb
cas-cms-0.1.3 app/views/cas/sites/sections/contents/_form_attachments.html.erb
cas-cms-0.1.2 app/views/cas/sites/sections/contents/_form_attachments.html.erb
cas-cms-0.1.1 app/views/cas/sites/sections/contents/_form_attachments.html.erb
cas-cms-0.1.0 app/views/cas/sections/contents/_form_attachments.html.erb