From 71bb80f95df4cf3ca2d4a6557070161421d61756 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 27 Dec 2016 14:16:35 +0100 Subject: [PATCH] Only allow to change maintenance messages in maintenance screen. --- .../app/controllers/_settings/area_logo.coffee | 1 + .../app/controllers/maintenance.coffee | 2 ++ .../app/views/generic/login_preview.jst.eco | 17 +++++++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_settings/area_logo.coffee b/app/assets/javascripts/app/controllers/_settings/area_logo.coffee index 7f10c5058..55a8be865 100644 --- a/app/assets/javascripts/app/controllers/_settings/area_logo.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area_logo.coffee @@ -17,6 +17,7 @@ class App.SettingsAreaLogo extends App.Controller localElement.find('.js-loginPreview').html( App.view('generic/login_preview')( logoUrl: @logoUrl() logoChange: true + maintananceChange: false )) @html localElement diff --git a/app/assets/javascripts/app/controllers/maintenance.coffee b/app/assets/javascripts/app/controllers/maintenance.coffee index 874a2ae21..a13ac5ad6 100644 --- a/app/assets/javascripts/app/controllers/maintenance.coffee +++ b/app/assets/javascripts/app/controllers/maintenance.coffee @@ -22,6 +22,8 @@ class Index extends App.ControllerSubContent localElement = $(App.view('maintenance')()) localElement.find('.js-loginPreview').html( App.view('generic/login_preview')( logoUrl: @logoUrl() + logoChange: false + maintananceChange: true )) localElement.find('.js-textarea').ce({ diff --git a/app/assets/javascripts/app/views/generic/login_preview.jst.eco b/app/assets/javascripts/app/views/generic/login_preview.jst.eco index e985dd4a3..f68f60434 100644 --- a/app/assets/javascripts/app/views/generic/login_preview.jst.eco +++ b/app/assets/javascripts/app/views/generic/login_preview.jst.eco @@ -1,13 +1,14 @@
+ <% if @maintananceChange: %> + <% if @C('maintenance_mode'): %> +
<%- @T('Zammad is currently in maintenance mode. Only administrators can login. Please wait until the maintenance window is over.') %>
+ <% end %> - <% if @C('maintenance_mode'): %> -
<%- @T('Zammad is currently in maintenance mode. Only administrators can login. Please wait until the maintenance window is over.') %>
- <% end %> - - <% if !@logoChange || @C('maintenance_login'): %> -
- -
+ <% if !@logoChange || @C('maintenance_login'): %> +
+ +
+ <% end %> <% end %>