create component for footer
This commit is contained in:
parent
123a038c19
commit
2659d0f966
17 changed files with 49 additions and 97 deletions
10
app/components/procedure/fixed_footer_component.rb
Normal file
10
app/components/procedure/fixed_footer_component.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
class Procedure::FixedFooterComponent < ApplicationComponent
|
||||||
|
def initialize(procedure:, form: nil, is_form_disabled: nil, extra_class_names: nil)
|
||||||
|
@procedure = procedure
|
||||||
|
@form = form
|
||||||
|
@is_form_disabled = is_form_disabled
|
||||||
|
@extra_class_names = extra_class_names
|
||||||
|
end
|
||||||
|
|
||||||
|
attr_reader :form, :is_form_disabled, :extra_class_names
|
||||||
|
end
|
|
@ -0,0 +1,4 @@
|
||||||
|
fr:
|
||||||
|
back: Revenir à l'écran de gestion
|
||||||
|
submit: Enregistrer
|
||||||
|
cancel: Annuler et revenir à l'écran de gestion
|
|
@ -0,0 +1,20 @@
|
||||||
|
- if form
|
||||||
|
.padded-fixed-footer
|
||||||
|
.fixed-footer
|
||||||
|
.fr-container
|
||||||
|
.fr-grid-row
|
||||||
|
%div{ class: "fr-col-12 #{extra_class_names}" }
|
||||||
|
%ul.fr-btns-group.fr-btns-group--inline-md
|
||||||
|
%li
|
||||||
|
= link_to t('.cancel'), admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary', data: { confirm: 'Si vous avez fait des modifications elles ne seront pas sauvegardées.'}
|
||||||
|
%li
|
||||||
|
= form.submit t(".submit"), class: "fr-btn", disabled: is_form_disabled
|
||||||
|
|
||||||
|
- else
|
||||||
|
.padded-fixed-footer
|
||||||
|
.fixed-footer
|
||||||
|
.fr-container
|
||||||
|
.fr-grid-row
|
||||||
|
%div{ class: "fr-col-12 fr-pb-2w #{extra_class_names}" }
|
||||||
|
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left fr-mb-2w' do
|
||||||
|
= t('.back')
|
|
@ -11,8 +11,5 @@
|
||||||
available_instructeur_emails: @available_instructeur_emails,
|
available_instructeur_emails: @available_instructeur_emails,
|
||||||
disabled_as_super_admin: @disabled_as_super_admin }
|
disabled_as_super_admin: @disabled_as_super_admin }
|
||||||
|
|
||||||
.padded-fixed-footer
|
|
||||||
.fixed-footer.fr-pb-2w
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
||||||
.fr-container
|
|
||||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left' do
|
|
||||||
Revenir à l'écran de gestion
|
|
||||||
|
|
|
@ -37,11 +37,4 @@
|
||||||
|
|
||||||
= render Dsfr::RadioButtonListComponent.new(form: f, target: :resume, buttons: resume_buttons)
|
= render Dsfr::RadioButtonListComponent.new(form: f, target: :resume, buttons: resume_buttons)
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f, is_form_disabled: form_disabled?)
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
|
||||||
%li
|
|
||||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'}
|
|
||||||
%li
|
|
||||||
= f.submit t(".submit"), class: "fr-btn", disabled: form_disabled?
|
|
||||||
|
|
|
@ -30,11 +30,4 @@
|
||||||
.procedure-preview
|
.procedure-preview
|
||||||
= render partial: 'users/dossiers/merci', locals: { procedure: @procedure, dossier: nil}
|
= render partial: 'users/dossiers/merci', locals: { procedure: @procedure, dossier: nil}
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f)
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
|
||||||
%li
|
|
||||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'}
|
|
||||||
%li
|
|
||||||
= f.button 'Enregistrer', class: 'fr-btn'
|
|
||||||
|
|
|
@ -108,8 +108,4 @@
|
||||||
%h2.empty-text Aucun expert invité pour le moment.
|
%h2.empty-text Aucun expert invité pour le moment.
|
||||||
%p.empty-text-details Les instructeurs de cette démarche n’ont pas encore fait appel aux experts.
|
%p.empty-text-details Les instructeurs de cette démarche n’ont pas encore fait appel aux experts.
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
||||||
.fixed-footer.fr-pb-2w
|
|
||||||
.fr-container
|
|
||||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left' do
|
|
||||||
Revenir à l'écran de gestion
|
|
||||||
|
|
|
@ -18,10 +18,4 @@
|
||||||
= render Procedure::EmailTemplateCardComponent.new(email_template: mail_template)
|
= render Procedure::EmailTemplateCardComponent.new(email_template: mail_template)
|
||||||
|
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
.fr-grid-row
|
|
||||||
.fr-col-12.fr-pb-2w
|
|
||||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left fr-mb-2w' do
|
|
||||||
Revenir à la démarche
|
|
||||||
|
|
|
@ -20,8 +20,4 @@
|
||||||
%tbody#administrateurs
|
%tbody#administrateurs
|
||||||
= render(Procedure::ProcedureAdministrateurs::AdministrateurComponent.with_collection(@procedure.administrateurs.order('users.email'), procedure: @procedure))
|
= render(Procedure::ProcedureAdministrateurs::AdministrateurComponent.with_collection(@procedure.administrateurs.order('users.email'), procedure: @procedure))
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
||||||
.fixed-footer.fr-pb-2w
|
|
||||||
.fr-container
|
|
||||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left' do
|
|
||||||
Revenir à l'écran de gestion
|
|
||||||
|
|
|
@ -33,10 +33,4 @@
|
||||||
hint: "L’accusé de lecture est à activer uniquement pour les démarches avec voies de recours car il complexifie l’accès à la décision finale pour les usagers",
|
hint: "L’accusé de lecture est à activer uniquement pour les démarches avec voies de recours car il complexifie l’accès à la décision finale pour les usagers",
|
||||||
opt: {"checked" => @procedure.accuse_lecture})
|
opt: {"checked" => @procedure.accuse_lecture})
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, extra_class_names: 'fr-col-offset-md-2 fr-col-md-8' )
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
.fr-grid-row
|
|
||||||
.fr-col-12.fr-col-offset-md-2.fr-col-md-8.fr-pb-2w
|
|
||||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left fr-mb-2w' do
|
|
||||||
Revenir à l'écran de gestion
|
|
||||||
|
|
|
@ -16,13 +16,4 @@
|
||||||
|
|
||||||
= render partial: 'administrateurs/procedures/informations', locals: { f: f }
|
= render partial: 'administrateurs/procedures/informations', locals: { f: f }
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f, extra_class_names: 'fr-col-offset-md-2 fr-col-md-8')
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
.fr-grid-row
|
|
||||||
.fr-col-12.fr-col-offset-md-2.fr-col-md-8
|
|
||||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
|
||||||
%li
|
|
||||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'}
|
|
||||||
%li
|
|
||||||
= f.button 'Enregistrer', class: 'fr-btn'
|
|
||||||
|
|
|
@ -22,11 +22,4 @@
|
||||||
= f.label :api_entreprise_token, "Jeton", class: 'fr-label'
|
= f.label :api_entreprise_token, "Jeton", class: 'fr-label'
|
||||||
= f.password_field :api_entreprise_token, value: @procedure.read_attribute(:api_entreprise_token), class: 'fr-input'
|
= f.password_field :api_entreprise_token, value: @procedure.read_attribute(:api_entreprise_token), class: 'fr-input'
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f)
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
|
||||||
%li
|
|
||||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'}
|
|
||||||
%li
|
|
||||||
= f.button 'Enregistrer', class: 'fr-btn'
|
|
||||||
|
|
|
@ -31,8 +31,4 @@
|
||||||
= render Procedure::RevisionChangesComponent.new changes:, previous_revision:
|
= render Procedure::RevisionChangesComponent.new changes:, previous_revision:
|
||||||
- previous_revision = revision
|
- previous_revision = revision
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
||||||
.fixed-footer.fr-pb-2w
|
|
||||||
.fr-container
|
|
||||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left' do
|
|
||||||
Revenir à l'écran de gestion
|
|
||||||
|
|
|
@ -11,11 +11,4 @@
|
||||||
.fr-container
|
.fr-container
|
||||||
= render partial: 'monavis', locals: { f: f }
|
= render partial: 'monavis', locals: { f: f }
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f)
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
|
||||||
%li
|
|
||||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'}
|
|
||||||
%li
|
|
||||||
= f.button 'Enregistrer', class: 'fr-btn'
|
|
||||||
|
|
|
@ -25,11 +25,4 @@
|
||||||
= b.check_box
|
= b.check_box
|
||||||
= b.label class: "fr-label"
|
= b.label class: "fr-label"
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f)
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
|
||||||
%li
|
|
||||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure), class: 'fr-btn fr-btn--secondary', data: { confirm: 'Êtes-vous sûr de vouloir annuler les modifications effectuées ?'}
|
|
||||||
%li
|
|
||||||
= f.button 'Enregistrer', class: 'fr-btn'
|
|
||||||
|
|
|
@ -34,11 +34,4 @@
|
||||||
- if procedure_id.present?
|
- if procedure_id.present?
|
||||||
= hidden_field_tag :procedure_id, procedure_id
|
= hidden_field_tag :procedure_id, procedure_id
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure, form: f)
|
||||||
.fixed-footer
|
|
||||||
.fr-container
|
|
||||||
%ul.fr-btns-group.fr-btns-group--inline-md
|
|
||||||
%li
|
|
||||||
= link_to "Annuler et revenir à l'écran de gestion", admin_procedure_path(id: @procedure.id), class: "fr-btn fr-btn--secondary"
|
|
||||||
%li
|
|
||||||
= f.submit "Enregistrer", class: "fr-btn"
|
|
||||||
|
|
|
@ -34,8 +34,4 @@
|
||||||
data: { confirm: "Confirmez vous la suppression de #{service.nom}" },
|
data: { confirm: "Confirmez vous la suppression de #{service.nom}" },
|
||||||
class: 'btn btn-link ml-2'
|
class: 'btn btn-link ml-2'
|
||||||
|
|
||||||
.padded-fixed-footer
|
= render Procedure::FixedFooterComponent.new(procedure: @procedure)
|
||||||
.fixed-footer.fr-pb-2w
|
|
||||||
.fr-container
|
|
||||||
= link_to admin_procedure_path(id: @procedure), class: 'fr-link fr-icon-arrow-left-line fr-link--icon-left' do
|
|
||||||
Revenir à l'écran de gestion
|
|
||||||
|
|
Loading…
Reference in a new issue