From: Dimitar <19364673+Dimitar5555@users.noreply.github.com> Date: Sun, 22 Jan 2023 10:25:42 +0000 (+0200) Subject: Facelift offline.html and use Bootstrap classes for "notifications" X-Git-Tag: live~1236^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/318064b2a7f4b39119dfab02c712832c0f8c5859?ds=sidebyside;hp=--cc Facelift offline.html and use Bootstrap classes for "notifications" Update site_controller_test.rb Update site_controller_test.rb Remove whitespace Reset Settings.status after test is done Update test for offline page Update site_controller.rb Fix indentation Update offline controller Update offline.html.erb Remove flash CSS classes and fix missed tests Updated tests Address most PR comments Update _flash.html.erb Update _flash.html.erb Update edit.html.erb Update offline.html.erb --- 318064b2a7f4b39119dfab02c712832c0f8c5859 diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 5a197d9b1..06f98cc57 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1253,22 +1253,6 @@ tr.turn:hover { display: none; } -/* Rules for "flash" notice boxes shown at the top of the content area */ - -.flash { - &.error { - background-color: #ff7070; - } - - &.warning { - background-color: #ffe0cc; - } - - &.notice { - background-color: #CBEEA7; - } -} - /* Rules for highlighting fields with rails validation errors */ .formError { diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index a05fe376b..5fb8aa111 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -113,7 +113,14 @@ class SiteController < ApplicationController def export; end - def offline; end + def offline + flash.now[:warning] = if Settings.status == "database_offline" + t("layouts.osm_offline") + else + t("layouts.osm_read_only") + end + render :html => nil, :layout => true + end def preview render :html => RichText.new(params[:type], params[:text]).to_html diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb index 5dda3ad5c..eaf3078fe 100644 --- a/app/views/layouts/_flash.html.erb +++ b/app/views/layouts/_flash.html.erb @@ -1,5 +1,5 @@ <% if flash[:error] %> -