noesya/osuny

View on GitHub
app/views/admin/communication/blocks/templates/definitions/_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-list' %>
  </div>
</div>

<draggable :list="data.elements" handle=".dragHandle" class="mb-3">
  <div v-for="(element, index) in data.elements" class="d-flex draggable-item">
    <div>
      <a class="btn ps-0 pt-0 dragHandle">
        <i class="<%= Icon::DRAG %> handle"></i>
      </a>
    </div>
    <div class="flex-fill">
      <div class="row pure__row--small mb-n3">
        <div class="col-lg-5">
          <%= block_component_edit block, :title, template: @element %>
        </div>
        <div class="col-lg-7">
          <%= block_component_edit block, :description, template: @element, summernote_config: 'mini-list' %>
        </div>
      </div>
    </div>
    <div>
      <a  class="btn btn-sm text-danger ms-3"
          v-on:click="data.elements.splice(data.elements.indexOf(element), 1)"
          title="<%= t '.remove_definition' %>">
          <i class="<%= Icon::DELETE %>"></i>
      </a>
    </div>
  </div>
</draggable>
<%= block_component_add_element block, t('.add_definition') %>