demarches-normaliennes/app/views/administrateurs/procedures/_publication_form.html.haml
Kara Diaby 5f1f8b299a layout
2022-06-08 14:38:17 +02:00

24 lines
1.4 KiB
Text

.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
- if !procedure.close? && procedure.draft_changed?
%p.mb-4 Publiez une nouvelle version de votre démarche. Les modifications suivantes seront appliquées :
= render partial: 'revision_changes', locals: { changes: procedure.revision_changes }
- elsif procedure.close? && procedure.draft_changed?
%p.mb-4 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 }
- else
= 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' }