Skip to content

Commit

Permalink
Add expected restoration date setting
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Dec 16, 2024
1 parent 90b1692 commit 0807cb5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/views/layouts/_offline_flash.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
</p>
<% end %>

<% if Settings.status_expected_restore_date %>
<% expected_restore_time = Time.parse(Settings.status_expected_restore_date).utc %>
<% if expected_restore_time > Time.now.utc %>
<p class="mb-0">
<%= t ".expected_restore_html", :time => friendly_date(expected_restore_time) %>
</p>
<% end %>
<% end %>

<% if Settings.status_announcement_url %>
<p class="mb-0">
<%= link_to t(".announcement"), Settings.status_announcement_url %>
Expand Down
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."
expected_restore_html: "Services are expected to be restored in %{time}."
announcement: "You can read the announcement here."
user_mailer:
diary_comment_notification:
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"
# Expected services restoration date added to offline flash messages
#status_expected_restore_date: "2024-12-18 12:00:00Z"
# 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
Expand Down

0 comments on commit 0807cb5

Please sign in to comment.