Files
grecia/app/components/admin/geozones/index_component.rb
Javi Martín 887d0d2419 Use render_map to render the map component
This is done for consistency. We always use `render_map`, but forgot to
do the same in commit 529357c98.
2024-12-23 17:35:33 +01:00

35 lines
673 B
Ruby

class Admin::Geozones::IndexComponent < ApplicationComponent
include Header
attr_reader :geozones
use_helpers :render_map
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