2021-11-25 16:26:55 +01:00
|
|
|
= render partial: 'administrateurs/breadcrumbs',
|
2022-08-17 13:53:07 +02:00
|
|
|
locals: { steps: [['Démarches', admin_procedures_path],
|
2022-09-09 13:08:24 +02:00
|
|
|
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
|
2022-08-17 13:53:07 +02:00
|
|
|
[Procedure.human_attribute_name(:jeton_api_particulier), admin_procedure_api_particulier_path(@procedure)],
|
|
|
|
[t('.data_sources')]] }
|
2021-09-13 15:59:58 +02:00
|
|
|
|
|
|
|
.container
|
|
|
|
%h1.page-title= t('.title')
|
|
|
|
|
|
|
|
.container#sources-particulier-form.mb-2
|
|
|
|
= form_with model: @procedure, url: admin_procedure_api_particulier_sources_path, local: true, html: { class: 'form' } do |f|
|
2023-11-15 17:58:26 +01:00
|
|
|
= render Dsfr::AlertComponent.new(state: :info, size: :sm, extra_class_names: 'fr-mb-2w') do |c|
|
|
|
|
- c.body do
|
|
|
|
%p
|
|
|
|
= t('.explication_html')
|
2021-09-13 15:59:58 +02:00
|
|
|
|
|
|
|
- @available_sources.each do |provider_key, scopes|
|
|
|
|
%h2.header-section= t("api_particulier.providers.#{provider_key}.libelle")
|
|
|
|
|
|
|
|
- scopes.each do |scope_key, sources|
|
2023-11-15 17:58:26 +01:00
|
|
|
%h3= t("api_particulier.providers.#{provider_key}.scopes.#{scope_key}.libelle")
|
2021-12-01 10:21:30 +01:00
|
|
|
%ul.procedure-admin-api-particulier-sources{ id: "#{provider_key}-#{scope_key}" }
|
2021-09-13 15:59:58 +02:00
|
|
|
- sources.each do |source_key, enabled_hash|
|
|
|
|
- enabled = (@procedure.api_particulier_sources.dig(provider_key, scope_key)&.include?(source_key)).present?
|
|
|
|
%li
|
|
|
|
%label
|
|
|
|
= check_box_tag "api_particulier_sources[#{provider_key}][#{scope_key}][]", "#{source_key}", enabled
|
|
|
|
#{t("api_particulier.providers.#{provider_key}.scopes.#{scope_key}.#{source_key}")}
|
|
|
|
|
|
|
|
.text-right
|
2023-11-15 17:58:26 +01:00
|
|
|
= f.button t('views.shared.actions.save'), class: 'fr-btn send'
|