osunyorg/admin

View on GitHub
app/views/server/blocks/index.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, "#{@templates.total_count} #{Communication::Block.model_name.human(count: @templates.total_count).downcase}" %>

<div class="table-responsive">
  <table class="<%= table_classes %>">
    <thead>
      <tr>
        <th><%= t('server_admin.blocks.title') %></th>
        <th><%= t('server_admin.blocks.quantity') %></th>
      </tr>
    </thead>
    <tbody>
      <% @templates.each do |template| %>
        <tr>
          <td><%= link_to t("enums.communication.block.template_kind.#{template}"), server_block_path(template) %></td>
          <td><%= Communication::Block.send("template_#{template}").count %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

<%= paginate @templates %>