Files
grecia/app/components/admin/geozones/index_component.rb
Javi Martín d18c627392 Add and apply Layout/EmptyLinesAfterModuleInclusion rule
This rule was added in rubocop 1.79. We were inconsistent about it, so
we're adding it to get more consistency.
2025-11-05 14:27:12 +01:00

36 lines
674 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