Files
grecia/app/components/admin/geozones/index_component.rb
CoslaJohn 624e60eab9 Added layer control to map to allow each geozone display to be toggled on/off
Note we're adding a `name` property to the geozones investments sidebar
map even if we don't render the geozones in the map, in order to
simplify the JavaScript function `geozoneLayers`.
2024-12-23 17:35:33 +01:00

34 lines
647 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))],
name: geozone.name
}
end
end
end