Skip to content

Commit

Permalink
Add offline announcement setting
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Dec 17, 2024
1 parent d7beb6f commit 86035db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
22 changes: 17 additions & 5 deletions app/views/layouts/_offline_flash.erb
Original file line number Diff line number Diff line change
@@ -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>
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,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}"
Expand Down
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 86035db

Please sign in to comment.