diff --git a/app/views/modules/_flash_messages.html.erb b/app/views/modules/_flash_messages.html.erb index 949306053b..ea7932a256 100644 --- a/app/views/modules/_flash_messages.html.erb +++ b/app/views/modules/_flash_messages.html.erb @@ -14,42 +14,48 @@ Unless required by applicable law or agreed to in writing, software distributed --- END LICENSE_HEADER BLOCK --- %> -<% if Settings&.flash_message&.message %> - <% flash[Settings.flash_message.type || :error] = Settings.flash_message.message.html_safe %> -<% end %> +
+ <% if Settings&.repository_read_only_mode && current_ability.can?(:read, Admin::Collection) %> +
+

<%= Settings.repository_read_only_mode_message %>

+
+ <% end %> + + <% if Settings&.flash_message&.message %> + <% flash[Settings.flash_message.type || :error] = Settings.flash_message.message.html_safe %> + <% end %> -<% if defined? flash and !flash.empty? %> -
- <% [:success, :notice, :error, :alert].each do |type| %> - <%- alert_class = case type - when :success then "alert-success" - when :notice then "alert-info" - when :alert then "alert-warning" - when :error then "alert-danger" - else "alert-#{type}" - end - -%> - <% if flash[type] %> -
- - <% Array(flash[type]).each do |msg| %> -

<%= msg %>

- <% end %> -
+ <% if defined? flash and !flash.empty? %> + <% [:success, :notice, :error, :alert].each do |type| %> + <%- alert_class = case type + when :success then "alert-success" + when :notice then "alert-info" + when :alert then "alert-warning" + when :error then "alert-danger" + else "alert-#{type}" + end + -%> + <% if flash[type] %> +
+ + <% Array(flash[type]).each do |msg| %> +

<%= msg %>

+ <% end %> +
+ <% end %> <% end %> <% end %> -
-<% end %> - <% content_for :page_scripts do %> diff --git a/config/settings.yml b/config/settings.yml index 687ea27dcd..b84809d24f 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -135,3 +135,4 @@ derivative: # Does not affect actions that only affect the database # This is useful when running long migrations repository_read_only_mode: false +repository_read_only_mode_message: "🚧 Read-only mode: all content editing has been disabled 🚧"