Show warnings in edit forms.

Make all edit forms show warnings in addition to errors. Also render
warnings and errors using DText.

Currently this only affects artists and wiki pages because they're the
only pages that have warnings.
This commit is contained in:
evazion
2022-03-18 16:48:02 -05:00
parent 912e996027
commit 512c72bbc9

View File

@@ -252,7 +252,11 @@ module ApplicationHelper
simple_form_for(model, **options) do |form|
if model.try(:errors).try(:any?)
concat tag.div(model.errors.full_messages.join("; "), class: "notice notice-error notice-small")
concat tag.div(format_text(model.errors.full_messages.join("; ")), class: "notice notice-error notice-small prose")
end
if model.try(:warnings).try(:any?)
concat tag.div(format_text(model.warnings.full_messages.join("; ")), class: "notice notice-info notice-small prose")
end
block.call(form)