From 512c72bbc9b4320619319fa3265e2b77faa3c4c9 Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 18 Mar 2022 16:48:02 -0500 Subject: [PATCH] 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. --- app/helpers/application_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5407404fd..d31985525 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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)