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:
commit
22a36c18ff
13 changed files with 28 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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? }
|
||||
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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']] }
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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']] }
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue