Refactor publish dialog
This commit is contained in:
parent
559984c351
commit
b57c22cafe
13 changed files with 90 additions and 72 deletions
24
app/helpers/procedure_helper.rb
Normal file
24
app/helpers/procedure_helper.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
module ProcedureHelper
|
||||
def procedure_lien(procedure)
|
||||
if procedure.procedure_path.present?
|
||||
if procedure.brouillon_avec_lien?
|
||||
commencer_test_url(procedure_path: procedure.path)
|
||||
else
|
||||
commencer_url(procedure_path: procedure.path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def procedure_libelle(procedure)
|
||||
parts = [procedure.libelle]
|
||||
if procedure.brouillon?
|
||||
parts << '(brouillon)'
|
||||
end
|
||||
parts.join(' ')
|
||||
end
|
||||
|
||||
def procedure_modal_text(procedure, key)
|
||||
action = procedure.archivee? ? :reopen : :publish
|
||||
t(action, scope: [:modal, :publish, key])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue