From 3e50903b66b149735161457bbed4af8713b7e946 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 25 Apr 2018 15:37:11 +0200 Subject: [PATCH] [Fix #1873] Add pre maintenance warning --- app/assets/stylesheets/_maintenance.scss | 15 +++++++++++++++ app/assets/stylesheets/application.scss | 1 + .../stylesheets/new_design/_maintenance.scss | 8 ++++++++ app/views/layouts/_pre_maintenance.html.haml | 4 ++++ app/views/layouts/application.html.haml | 1 + app/views/layouts/new_application.html.haml | 1 + config/features.rb | 1 + 7 files changed, 31 insertions(+) create mode 100644 app/assets/stylesheets/_maintenance.scss create mode 100644 app/assets/stylesheets/new_design/_maintenance.scss create mode 100644 app/views/layouts/_pre_maintenance.html.haml diff --git a/app/assets/stylesheets/_maintenance.scss b/app/assets/stylesheets/_maintenance.scss new file mode 100644 index 000000000..dd59c31d6 --- /dev/null +++ b/app/assets/stylesheets/_maintenance.scss @@ -0,0 +1,15 @@ +.maintenance { + width: 100%; + position: fixed; + top: 0; + z-index: 100; + display: flex; + flex-direction: column; + justify-content: center; + + span { + margin: auto; + background: #FFD8A6; + padding: 0 4px; + } +} diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index f2c861d76..e163c9274 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -12,6 +12,7 @@ // defined in the other CSS/SCSS files in this directory. It is generally better to create a new // file per style scope. // +// = require _maintenance // = require _card // = require _helpers // = require _turbolinks diff --git a/app/assets/stylesheets/new_design/_maintenance.scss b/app/assets/stylesheets/new_design/_maintenance.scss new file mode 100644 index 000000000..153a5f685 --- /dev/null +++ b/app/assets/stylesheets/new_design/_maintenance.scss @@ -0,0 +1,8 @@ +@import "colors"; + +.maintenance { + padding: 20px; + text-align: center; + width: 100%; + background: $orange-bg; +} diff --git a/app/views/layouts/_pre_maintenance.html.haml b/app/views/layouts/_pre_maintenance.html.haml new file mode 100644 index 000000000..636556d16 --- /dev/null +++ b/app/views/layouts/_pre_maintenance.html.haml @@ -0,0 +1,4 @@ +- if Flipflop.pre_maintenance_mode? + .maintenance + %span + Une opération de maintenance est prévue sur demarches-simplifiees.fr à 23 h 00. La plateforme sera inaccessible pendant une vingtaine de minutes. diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 9c6640ace..79878e57e 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -17,6 +17,7 @@ = csrf_meta_tags %body = render partial: 'layouts/support_navigator_banner' + = render partial: 'layouts/pre_maintenance' - if Rails.env == 'staging' #beta Env Test diff --git a/app/views/layouts/new_application.html.haml b/app/views/layouts/new_application.html.haml index c214f26a0..daa786536 100644 --- a/app/views/layouts/new_application.html.haml +++ b/app/views/layouts/new_application.html.haml @@ -21,6 +21,7 @@ .page-wrapper = render partial: "layouts/support_navigator_banner" = render partial: "layouts/ie_lt_10" + = render partial: 'layouts/pre_maintenance' - if Rails.env == "staging" #beta Env Test diff --git a/config/features.rb b/config/features.rb index 14e779b0c..2ef08cc14 100644 --- a/config/features.rb +++ b/config/features.rb @@ -22,5 +22,6 @@ Flipflop.configure do default: Rails.env.production? end + feature :pre_maintenance_mode feature :maintenance_mode end