Sha256: 158810132426c11cfe32f7d517caaf25e4696f9ede59d9fcd40d35a4186b4a81
Contents?: true
Size: 1.89 KB
Versions: 4
Compression:
Stored size: 1.89 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> </th> </tr> </thead> <tbody> <% decorated_collection.each do |decorated| %> <tr> <% field_names.each do |field_name| %> <td> <%= render decorated.index_type_of(field_name), object: decorated, field_name: field_name, value: decorated.try(field_name), metadata: decorated.index_metadata_of(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
4 entries across 4 versions & 1 rubygems