Skip to content
Snippets Groups Projects
Commit 99b0195c authored by Arnaud Levy's avatar Arnaud Levy
Browse files

maintenance mode

parent a82431e4
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ class ApplicationController < ActionController::Base ...@@ -3,6 +3,7 @@ class ApplicationController < ActionController::Base
include WithErrors include WithErrors
include WithFeatures include WithFeatures
include WithLocale include WithLocale
include WithMaintenance
before_action :ensure_university, :authenticate_user! before_action :ensure_university, :authenticate_user!
......
module ApplicationController::WithMaintenance
extend ActiveSupport::Concern
included do
before_action :check_maintenance
end
protected
def check_maintenance
if ENV['MAINTENANCE'] &&
current_user&.role != 'server_admin'
redirect_to '/maintenance'
end
end
end
<!DOCTYPE html>
<html>
<head>
<title>Maintenance in progress</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="refresh" content="30;URL=/">
<style>
body {
padding: 15px;
}
* {
font-family: sans-serif;
font-size: 14px;
margin: 0;
text-align: center;
}
.dialog {
width: 95%;
max-width: 22em;
margin: calc(50vh - 140px) auto 0;
}
.dialog span {
font-size: 150px;
font-weight: 900;
letter-spacing: -0.04em;
display: block;
width: 100%;
line-height: 0.9;
margin-bottom: 50px
}
img {
margin-bottom: 30px;
}
h1 {
font-size: 14px;
line-height: 1.5em;
margin-bottom: 30px;
}
h1 em {
font-weight: 400;
}
</style>
</head>
<body>
<div class="dialog">
<span>
</span>
<div>
<h1>Maintenance in progress</h1>
<a href="/"><img src="/logo.svg" alt="Osuny" width="100"></a>
</div>
</div>
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment