consul/consul

View on GitHub
app/components/admin/geozones/index_component.html.erb

Summary

Maintainability
Test Coverage
<%= header do %>
  <%= link_to t("admin.geozones.index.create"), new_admin_geozone_path %>
<% end %>

<table>
  <thead>
    <tr>
      <th><%= t("admin.geozones.geozone.name") %></th>
      <th><%= t("admin.geozones.geozone.external_code") %></th>
      <th><%= t("admin.geozones.geozone.census_code") %></th>
      <th><%= t("admin.geozones.geozone.coordinates") %></th>
      <th><%= t("admin.geozones.geozone.geojson") %></th>
      <th><%= t("admin.actions.actions") %></th>
    </tr>
  </thead>

  <tbody>
    <% geozones.each do |geozone| %>
      <tr id="<%= dom_id(geozone) %>">
        <td><%= geozone.name %></td>
        <td><%= geozone.external_code %></td>
        <td><%= geozone.census_code %></td>
        <td><%= yes_no_text(geozone.html_map_coordinates.present?) %></td>
        <td><%= yes_no_text(geozone.geojson.present?) %></td>
        <td>
          <%= render Admin::TableActionsComponent.new(geozone) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<section>
  <h3><%= t("admin.geozones.index.geojson_map") %></h3>
  <p class="help-text"><%= t("admin.geozones.index.geojson_map_help") %></p>

  <%= render Shared::MapLocationComponent.new(nil, geozones_data: geozones_data) %>
</section>