Files
grecia/app/components/admin/geozones/index_component.rb
coslajohn 529357c980 Merge pull request #5390 Geozone Admin maps
This makes it easier to see if Geojson has been imported correctly.
2024-03-21 18:47:37 +01:00

33 lines
617 B
Ruby

class Admin::Geozones::IndexComponent < ApplicationComponent
include Header
attr_reader :geozones
def initialize(geozones)
@geozones = geozones
end
private
def title
t("admin.geozones.index.title")
end
def yes_no_text(condition)
if condition
t("shared.yes")
else
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