Merge pull request #8243 from tchak/fix-back-links

fix(admin): go to the right tab when click on breadcrumb link
This commit is contained in:
Paul Chavard 2022-12-13 23:52:03 +01:00 committed by GitHub
commit 22a36c18ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 28 additions and 12 deletions

View file

@ -66,4 +66,20 @@ module ProcedureHelper
minutes = (seconds / 60.0).round
[1, minutes].max
end
def admin_procedures_back_path(procedure)
statut = if procedure.discarded?
'supprimees'
else
case procedure.aasm_state
when 'brouillon'
'brouillons'
when 'close', 'depubliee'
'archivees'
else
'publiees'
end
end
admin_procedures_path(statut:)
end
end

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Configuration des annotations privées']], preview: true }

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Configuration des champs']], preview: @procedure.draft_revision.valid? }

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
["#{@procedure.libelle.truncate_words(10)} - archiver"]],
metadatas: true }

View file

@ -1,7 +1,7 @@
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Description']] }
.procedure-form

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Jeton']] }

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Modifications']] }
.container

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['MonAvis']] }

View file

@ -1,7 +1,7 @@
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
['Nouvelle']] }
.procedure-form

View file

@ -1,6 +1,6 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Publication']] }
.container

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
["#{@procedure.libelle.truncate_words(10)}"]],
metadatas: true }

View file

@ -1,5 +1,5 @@
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Transfert']] }
.container

View file

@ -1,7 +1,7 @@
- content_for(:root_class, 'scroll-margins-for-sticky-footer')
= render partial: 'administrateurs/breadcrumbs',
locals: { steps: [['Démarches', admin_procedures_path],
locals: { steps: [['Démarches', admin_procedures_back_path(@procedure)],
[@procedure.libelle.truncate_words(10), admin_procedure_path(@procedure)],
['Description']] }
.container