diff --git a/app/assets/javascripts/app/controllers/_application_controller.coffee b/app/assets/javascripts/app/controllers/_application_controller.coffee index eb08b8509..f8fcd6092 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.coffee @@ -602,6 +602,16 @@ class App.ControllerModal extends App.Controller return @formParam(@container.find('.modal form')) return @formParam(@$('.modal form')) + showAlert: (message, suffix = 'danger') -> + alert = $('
') + .addClass("alert alert--#{suffix}") + .text(message) + + @$('.modal-alerts-container').html(alert) + + clearAlerts: -> + @$('.modal-alerts-container').empty() + localOnShow: (e) => @onShow(e) @@ -650,6 +660,7 @@ class App.ControllerModal extends App.Controller submit: (e) => e.stopPropagation() e.preventDefault() + @clearAlerts() @onSubmit(e) class App.SessionMessage extends App.ControllerModal diff --git a/app/assets/javascripts/app/views/modal.jst.eco b/app/assets/javascripts/app/views/modal.jst.eco index 840f2c27e..23bae4881 100644 --- a/app/assets/javascripts/app/views/modal.jst.eco +++ b/app/assets/javascripts/app/views/modal.jst.eco @@ -11,6 +11,7 @@

<% if @headPrefix: %><%- @T(@headPrefix) %>: <% end %><%- @T(@head) %>

<% end %>
+ diff --git a/app/assets/stylesheets/zammad.scss b/app/assets/stylesheets/zammad.scss index d392b8b77..80785e223 100644 --- a/app/assets/stylesheets/zammad.scss +++ b/app/assets/stylesheets/zammad.scss @@ -6516,6 +6516,10 @@ footer { opacity: 0.18; } + .modal-alerts-container { + padding: 0 23px; + } + .modal-body { padding: 0 23px;