c26a701a17
* remove the autocomplete menu * use ujs to pre-validate the procedure * tweak the UI
13 lines
573 B
Text
13 lines
573 B
Text
#publish-buttons
|
|
= button_tag "Annuler", class: %w(btn btn-default), data: { dismiss: :modal }
|
|
|
|
- procedure.validate(:publication)
|
|
- errors = procedure.errors
|
|
-# Ignore the :taken error if the path can be claimed
|
|
- if errors.details[:path]&.pluck(:error)&.include?(:taken) && procedure.path_available?(administrateur, procedure.path)
|
|
- errors.delete(:path)
|
|
|
|
- options = { class: %w(btn btn-success), id: 'publish' }
|
|
- if errors.details[:path].present?
|
|
- options[:disabled] = :disabled
|
|
= submit_tag procedure_modal_text(@procedure, :submit), options
|