Sha256: aeb0f4f12874e2281fff750efb9cc75e857fa0010a283f05586a4cff4f94d285

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

<% content_for :content do %>
  <table class="table table-hover">
    <thead>
      <tr>
        <% @list_fields.each_with_index do |name, index| %>
          <th class="col-md-3 sort-button" data-column="<%=name%>">
            <% unless index == 0 %>
              <span class="line"></span>
            <% end %>
            <span><%= field_to_label(name) + @sortable_service.sorting_sign(name) %></span>
          </th>
        <% end %>

        <th class="col-md-3 align-right">
          <span class="line"></span>
          <span>Management</span>
        </th>
      </tr>
    </thead>

    <% has_position = @sortable_service.has_position? %>
    <tbody data-position='false'>
      <% @items.each_with_index do |item, index| %>
        <tr<%
          if has_position
            %> id='<%= item.position %>'<%
          end
        %> data-id='<%= item.id %>'>
          <% @list_fields.each do |name|
            %><td><%
              td_data = item.send(name)
              if td_data.is_a? Mongoid::Document #rm_todo remove hard code, extract helper (data adapter)
                concat link_to td_data.to_s, admin_edit_uri(td_data)
              else
                concat td_data
              end
            %></td>
          <% end %>
          <td>
            <ul class="actions">
              <li><%= button_to 'Unlink',
                admin_unlink_uri(item, params[:parent], params[:parent_id]), {
                :method => :patch,
                :form => {:class => 'delete-item-form'}
              } %></li>
            </ul>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <%= render 'rademade_admin/_blocks/pagination' %>

<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rademade_admin-0.0.1 app/views/rademade_admin/_layouts/inner/related_index_table.html.erb