Sha256: 61a1a039928c35c3271ef0550b07d51b7fb8df5a73a7f8e0781c717b961cdb7b

Contents?: true

Size: 1.37 KB

Versions: 10

Compression:

Stored size: 1.37 KB

Contents

<%
  # headmin/fields/repeater/row
  # accepts block: yes
  # parameters:
  #   form: Form object
  #   pass_thru: (string) Pass thru for add button if needed

  draggable = form.object.respond_to?(:position)
  destroyable = form.object.respond_to?(:destroy)
%>

<div class="repeater-row list-group-item"
     data-repeater-target="row"
     data-row-index="<%= form.options[:child_index] %>"
     data-new-record="<%= form.object.new_record? %>"
>

  <%= form.hidden_field :id %>
  <%= form.hidden_field :_destroy if destroyable %>
  <%= form.hidden_field :position if draggable %>
  <%= yield if block_given? %>

  <!--  Drag handle -->
  <% if draggable %>
    <div class="repeater-row-handle">
      <%= bootstrap_icon('grip-vertical') %>
    </div>
  <% end %>

  <!--  Add button-->
  <a href="#"
     class="repeater-row-add btn btn-link"
     title="<%= t('.add') %>"
     data-repeater-target="addButton"
     data-popup-target="button"
     data-popup-id="<%= "repeater-buttons-#{repeater_id}" %>"
     data-popup-pass-thru="<%= pass_thru %>"
     data-action="click->repeater#resetButtonIndices click->popup#open"
  >
    <%= bootstrap_icon('plus-circle') %>
  </a>

  <!--  Remove button-->
  <a href="#"
     class="repeater-row-remove btn btn-link"
     title="<%= t('.remove') %>"
     data-action="click->repeater#removeRow"
  >
    <%= bootstrap_icon('dash-circle') %>
  </a>
</div>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
headmin-0.2.9 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.8 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.7 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.6 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.5 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.4 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.3 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.2 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.1 app/views/headmin/forms/repeater/_row.html.erb
headmin-0.2.0 app/views/headmin/forms/repeater/_row.html.erb