2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-09-08 11:25:39 +02:00
|
|
|
class EditableChamp::DepartementsComponent < EditableChamp::EditableChampBaseComponent
|
2022-08-12 10:45:04 +02:00
|
|
|
include ApplicationHelper
|
2022-12-20 21:29:18 +01:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2023-08-21 16:18:31 +02:00
|
|
|
def dsfr_input_classname
|
|
|
|
'fr-select'
|
|
|
|
end
|
|
|
|
|
2022-12-20 21:29:18 +01:00
|
|
|
def options
|
2024-11-07 10:27:35 +01:00
|
|
|
APIGeoService.departement_options
|
2022-12-20 21:29:18 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def select_options
|
|
|
|
{ selected: @champ.selected }.merge(@champ.mandatory? ? { prompt: '' } : { include_blank: '' })
|
|
|
|
end
|
2022-08-12 10:45:04 +02:00
|
|
|
end
|