Merge pull request #5390 Geozone Admin maps

This makes it easier to see if Geojson has been imported correctly.
This commit is contained in:
coslajohn
2024-03-21 17:47:37 +00:00
committed by GitHub
parent 82c24a7ef3
commit 529357c980
5 changed files with 35 additions and 0 deletions

View File

@@ -29,3 +29,10 @@
<% 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>

View File

@@ -19,4 +19,14 @@ class Admin::Geozones::IndexComponent < ApplicationComponent
t("shared.no")
end
end
def geozones_data
geozones.map do |geozone|
{
outline_points: geozone.outline_points,
color: geozone.color,
headings: [link_to(geozone.name, edit_admin_geozone_path(geozone))]
}
end
end
end