From 9810d2ed9647a8dee9ea092355171b11aca264ee Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 16 Dec 2024 19:29:52 +0300 Subject: [PATCH] Add offline announcement setting --- app/views/layouts/_offline_flash.erb | 22 +++++++++++++++++----- config/locales/en.yml | 1 + config/settings.yml | 2 ++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/_offline_flash.erb b/app/views/layouts/_offline_flash.erb index bda5accf6..de4d15632 100644 --- a/app/views/layouts/_offline_flash.erb +++ b/app/views/layouts/_offline_flash.erb @@ -1,5 +1,17 @@ -<% if %w[database_offline api_offline].include? Settings.status %> - <%= t(".osm_offline") %> -<% elsif %w[database_readonly api_readonly].include? Settings.status %> - <%= t(".osm_read_only") %> -<% end %> +
+ <% if %w[database_offline api_offline].include? Settings.status %> +

+ <%= t(".osm_offline") %> +

+ <% elsif %w[database_readonly api_readonly].include? Settings.status %> +

+ <%= t(".osm_read_only") %> +

+ <% end %> + + <% if Settings.status_announcement_url %> +

+ <%= link_to t(".announcement"), Settings.status_announcement_url %> +

+ <% end %> +
diff --git a/config/locales/en.yml b/config/locales/en.yml index b71f6fefd..91d0c4888 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1608,6 +1608,7 @@ en: offline_flash: osm_offline: "The OpenStreetMap database is currently offline while essential database maintenance work is carried out." osm_read_only: "The OpenStreetMap database is currently in read-only mode while essential database maintenance work is carried out." + announcement: "You can read the announcement here." user_mailer: diary_comment_notification: description: "OpenStreetMap Diary Entry #%{id}" diff --git a/config/settings.yml b/config/settings.yml index db871775e..3b0a99ca3 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -23,6 +23,8 @@ api_version: "0.6" # database_offline - database offline with site in emergency mode # gpx_offline - gpx storage offline status: "online" +# Application status announcement url added to offline flash messages +#status_announcement_url: "https://en.osm.town/@osm_tech" # The maximum area you're allowed to request, in square degrees max_request_area: 0.25 # Number of GPS trace/trackpoints returned per-page -- 2.39.5