Sha256: 82f4c59fc9b51d5df3c403d5767adcd6291e5fbb41f2537454d4c7c293e42c3b

Contents?: true

Size: 1.7 KB

Versions: 6

Compression:

Stored size: 1.7 KB

Contents

<%
# decorate first on every page or partial
decorated_collection = decorate collection
%>
<article class="resources">
  <div class="resources__header">
    <h1><%= to_model_label(current_model_class) %></h1>
    <%= render 'index_query' %>
    <%= render 'index_filters' %>
    <%= render 'index_pagination' %>
  </div>
  <%= render 'flash_messages' %>

  <section>
    <% # Data table %>
    <% if decorated_collection.present? %>
      <% field_names = current_model_decorator.index_field_names %>
      <div class="resources__container">
        <table class="resources__data">
          <thead>
            <tr>
              <% field_names.each do |field_name| %>
                <%= content_tag :th, class: sort_link_builder.current_sort[field_name] do %>
                  <%= sort_link_builder.build field_name %>
                <% end %>
              <% end %>
              <th>&nbsp;</th>
            </tr>
          </thead>
          <tbody>
            <% decorated_collection.each do |decorated| %>
              <tr>
                <% field_names.each do |field_name| %>
                  <td>
                    <%= type_render decorated.index_type_of(field_name), object: decorated, field_name: field_name %>
                  </td>
                <% end %>
                <td class="resource__actions">
                  <%= render 'resource_actions', decorated: decorated %>
                </td>
              </tr>
            <% end %>
          </tbody>
        </table>
      </div>
    <% else %>
      <div class="resources__not-found">
        <%= image_tag 'wallaby/not_found.png' %>
        <%= wt 'errors.not_found.collection' %>
      </div>
    <% end %>
    <% # /Data table %>
  </section>
</article>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wallaby-6.1.6 app/views/wallaby/resources/index.html.erb
wallaby-6.1.5 app/views/wallaby/resources/index.html.erb
wallaby-6.1.4 app/views/wallaby/resources/index.html.erb
wallaby-6.1.3 app/views/wallaby/resources/index.html.erb
wallaby-6.1.2 app/views/wallaby/resources/index.html.erb
wallaby-6.1.1 app/views/wallaby/resources/index.html.erb