noesya/osuny

View on GitHub
app/views/admin/communication/blocks/templates/files/_edit.html.erb

Summary

Maintainability
Test Coverage
<div class="row pure__row--small">
  <div class="col-xl-6">
    <%= block_component_edit block, :description, summernote_config: 'mini' %>
  </div>
</div>

<%= block_component_add_element block, t('.add_file') %>

<draggable :list="data.elements" handle=".dragHandle" class="row pure__row--small">
  <div v-for="(element, index) in data.elements" class="col-md-4">
    <div class="card">
      <div class="card-header border-bottom">
        <a class="btn ps-0 pt-0 dragHandle">
          <i class="<%= Icon::DRAG %> handle"></i>
        </a>
        <div class="float-end">
          <a  class="btn btn-sm text-danger"
              v-on:click="data.elements.splice(data.elements.indexOf(element), 1)"
              title="<%= t '.remove_file' %>">
              <i class="<%= Icon::DELETE %>"></i>
          </a>
        </div>
      </div>
      <div class="card-body">
        <%= block_component_edit block, :title, template: @element %>
        <%= block_component_edit block, :file, template: @element %>
      </div>
    </div>
  </div>
</draggable>