]> git.openstreetmap.org Git - rails.git/commitdiff
Add offline announcement setting
authorAnton Khorev <tony29@yandex.ru>
Mon, 16 Dec 2024 16:29:52 +0000 (19:29 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 18 Dec 2024 15:59:49 +0000 (18:59 +0300)
app/views/layouts/_offline_flash.erb
config/locales/en.yml
config/settings.yml

index bda5accf602934a9ec4d787737704f8f3cf365e4..de4d156323def7c6a74bd17c64e5f0db914be524 100644 (file)
@@ -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 %>
+<div class="d-flex flex-column gap-2">
+  <% if %w[database_offline api_offline].include? Settings.status %>
+    <p class="mb-0">
+      <%= t(".osm_offline") %>
+    </p>
+  <% elsif %w[database_readonly api_readonly].include? Settings.status %>
+    <p class="mb-0">
+      <%= t(".osm_read_only") %>
+    </p>
+  <% end %>
+
+  <% if Settings.status_announcement_url %>
+    <p class="mb-0">
+      <%= link_to t(".announcement"), Settings.status_announcement_url %>
+    </p>
+  <% end %>
+</div>
index b71f6fefd299b340396fce187a0e23414259a611..91d0c4888ffaa128c1902f81d202514c3346299f 100644 (file)
@@ -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."
     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}"
   user_mailer:
     diary_comment_notification:
       description: "OpenStreetMap Diary Entry #%{id}"
index db871775e784d4cfe5ceb29a71bfbdee7c89b2ed..3b0a99ca30bd266903a03ffb3b0b8be17ffe7803 100644 (file)
@@ -23,6 +23,8 @@ api_version: "0.6"
 #   database_offline - database offline with site in emergency mode
 #   gpx_offline - gpx storage offline
 status: "online"
 #   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
 # The maximum area you're allowed to request, in square degrees
 max_request_area: 0.25
 # Number of GPS trace/trackpoints returned per-page