demarches-normaliennes/app/views/administrateurs/procedures/_publication_form.html.haml

26 lines
1.3 KiB
Text
Raw Normal View History

.card.mb-4
%h2.card-title Publiez votre démarche
= form_tag admin_procedure_publish_path(procedure_id: procedure.id), method: :put, class: 'form' do
- publication_errors = procedure_publication_errors(procedure)
- if publication_errors.present?
.card.warning
.card-title Des problèmes empêchent la publication de la démarche
- publication_errors.each do |_attribute, full_messages|
%p= full_messages.to_sentence
2022-10-19 09:28:23 +02:00
- if procedure.draft_changed?
- if procedure.close?
%p.mb-2 Publiez une nouvelle version de votre démarche. Les modifications suivantes seront appliquées :
= render partial: 'revision_changes', locals: { changes: procedure.revision_changes }
= render partial: 'publication_form_inputs', locals: { procedure: procedure, closed_procedures: @closed_procedures }
2022-06-02 15:26:12 +02:00
2022-10-19 09:28:23 +02:00
- else
%p.mb-2 Publiez une nouvelle version de votre démarche. Les modifications suivantes seront appliquées :
= render partial: 'revision_changes', locals: { changes: procedure.revision_changes }
2022-06-02 15:26:12 +02:00
2021-06-18 11:15:10 +02:00
- else
2022-06-02 15:26:12 +02:00
= render partial: 'publication_form_inputs', locals: { procedure: procedure, closed_procedures: @closed_procedures }
.flex.justify-end
= submit_tag procedure_publish_label(procedure, :submit), { disabled: publication_errors.present?, class: "button primary", id: 'publish' }