Sha256: 9834edbd685b31a188d02003dcfc4ca9447895891d2c82f1c598cd2aabb846b5

Contents?: true

Size: 1.7 KB

Versions: 3

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' %>
        <%= t 'errors.not_found.collection' %>
      </div>
    <% end %>
    <% # /Data table %>
  </section>
</article>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wallaby-6.1.0 app/views/wallaby/resources/index.html.erb
wallaby-6.0.2 app/views/wallaby/resources/index.html.erb
wallaby-6.0.1 app/views/wallaby/resources/index.html.erb