prey/gdpr_rails

View on GitHub
app/views/policy_manager/terms/index.html.erb

Summary

Maintainability
Test Coverage
<h2><%= I18n.t("terms_app.terms.index.title") %></h2>

<div class="float-right">
  <%= link_to I18n.t("terms_app.terms.index.button"), new_category_term_path(params[:category_id]), class: "btn btn-success" %>
</div>

<div class="table-responsive">
  <table class="table table-striped table-sm">
  <thead>
    <tr>
      <th><%= I18n.t("terms_app.terms.index.table.description") %></th>
      <th><%= I18n.t("terms_app.terms.index.table.category") %></th>
      <th><%= I18n.t("terms_app.terms.index.table.updated_at") %></th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @terms.each do |term| %>
      <tr>
        <td><%= truncate(term.description, length: 170, separator: " ", omission: '...') %></td>        
        <td><%= term.rule.name %></td>
        <td><%= term.updated_at %></td>
        <td><%= link_to I18n.t("terms_app.terms.index.table.show"), category_term_path(term.rule.name,term) %></td>
        <td><%= link_to I18n.t("terms_app.terms.index.table.edit"), edit_category_term_path(term.rule.name,term) %></td>
        <td><%= link_to I18n.t("terms_app.terms.index.table.destroy"), category_term_path(term.rule.name, term), method: :delete, data: { confirm: I18n.t("terms_app.misc.are_you_sure") } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

</div>