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 diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 68eebcf50..e45172e74 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -150,7 +150,7 @@ Devise.setup do |config| # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. Default is 30 minutes. - config.timeout_in = 24.hours + config.timeout_in = 1.hour # If true, expires auth token on session timeout. # config.expire_auth_token_on_timeout = false diff --git a/db/migrate/20180502092852_remove_parent_procedure_foreign_key.rb b/db/migrate/20180502092852_remove_parent_procedure_foreign_key.rb new file mode 100644 index 000000000..5b466f851 --- /dev/null +++ b/db/migrate/20180502092852_remove_parent_procedure_foreign_key.rb @@ -0,0 +1,5 @@ +class RemoveParentProcedureForeignKey < ActiveRecord::Migration[5.2] + def change + remove_foreign_key :procedures, column: "parent_procedure_id" + end +end diff --git a/db/schema.rb b/db/schema.rb index eec9b4f96..c1b888d2c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_04_24_130548) do +ActiveRecord::Schema.define(version: 2018_05_02_092852) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -574,7 +574,6 @@ ActiveRecord::Schema.define(version: 2018_04_24_130548) do add_foreign_key "procedure_paths", "administrateurs" add_foreign_key "procedure_paths", "procedures" add_foreign_key "procedure_presentations", "assign_tos" - add_foreign_key "procedures", "procedures", column: "parent_procedure_id" add_foreign_key "received_mails", "procedures" add_foreign_key "refused_mails", "procedures" add_foreign_key "without_continuation_mails", "procedures"