From c6296b882d9c8a2f561d63f5627d281413d399a7 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 21 Feb 2021 12:04:19 +0100 Subject: [PATCH] Add support for env var DEBSHOTS_ALERT_MESSAGE If that environment variable is set then it will display on every page. --- app/views/layouts/application.html.slim | 3 +++ config/environments/development.rb | 4 ++++ config/environments/production.rb | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 53e68f7..75c82e8 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -14,7 +14,10 @@ html body = render 'layouts/topbar' + #content.grid-container + - if Rails.configuration.alert_message + .callout.warning.alert-callout-subtle.radius =Rails.configuration.alert_message #messages = render 'layouts/messages' = yield diff --git a/config/environments/development.rb b/config/environments/development.rb index c63a445..e2ec649 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -68,6 +68,10 @@ Rails.application.configure do } ] + # Show a message on the front page. + # TODO: put it into the database and make it configurable online + config.alert_message = ENV['DEBSHOTS_ALERT_MESSAGE'] + # URL to fetch reviews from the Ubuntu JSON API # config.ubuntu_reviews_api_url = 'https://reviews.ubuntu.com/reviews/api/1.0/reviews/filter/en/any/any/any/%s' end diff --git a/config/environments/production.rb b/config/environments/production.rb index dc4295f..e938661 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -105,6 +105,10 @@ Rails.application.configure do } ] + # Show a message on the front page. + # TODO: put it into the database and make it configurable online + config.alert_message = ENV['DEBSHOTS_ALERT_MESSAGE'] + # URL to fetch reviews from the Ubuntu JSON API # config.ubuntu_reviews_api_url = 'https://reviews.ubuntu.com/reviews/api/1.0/reviews/filter/en/any/any/any/%s'