Verified Commit d01cd083 authored by Oliver Falk's avatar Oliver Falk

Add option to easily set maintenance page

parent a2d46717
Pipeline #1932 failed with stage
in 7 minutes and 40 seconds
......@@ -13,7 +13,6 @@ urlpatterns = [ # pylint: disable=invalid-name
path('admin/', admin.site.urls),
path('i18n/', include('django.conf.urls.i18n')),
url('openid/', include('django_openid_auth.urls')),
url('accounts/', include('ivatar.ivataraccount.urls')),
url('tools/', include('ivatar.tools.urls')),
url(
r'avatar/(?P<digest>\w{64})',
......@@ -36,7 +35,21 @@ urlpatterns = [ # pylint: disable=invalid-name
url('privacy/', TemplateView.as_view(template_name='privacy.html'), name='privacy'),
url('contact/', TemplateView.as_view(template_name='contact.html'), name='contact'),
path('talk_to_us/', RedirectView.as_view(url='/contact'), name='talk_to_us'),
url('', TemplateView.as_view(template_name='home.html'), name='home'),
]
MAINTENANCE = False
try:
if settings.MAINTENANCE:
MAINTENANCE = True
except:
pass
if MAINTENANCE:
urlpatterns.append(url('', TemplateView.as_view(template_name='maintenance.html'), name='home'))
urlpatterns.insert(3, url('accounts/', RedirectView.as_view(url='/')))
else:
urlpatterns.append(url('', TemplateView.as_view(template_name='home.html'), name='home'))
urlpatterns.insert(3, url('accounts/', include('ivatar.ivataraccount.urls')))
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
{% extends 'base_home.html' %}
{% load i18n %}
{% load static %}
{% block title %}{% trans 'federated avatar hosting service' %}{% endblock %}
{% block content %}
<div class="hero">
<div class="container">
<header>
<h1 id='app'>{{ site_name }}</h1>
<h2>{% trans 'freeing the web one face at a time' %}</h2>
</header>
</div>
</div>
<section class="content">
<div class="container">
<div class="text-center">
<h2 style="text-transform: capitalize;font-size: 35px;">{% trans 'Maintenance mode' %}</h2>
Libravatar is currently in maintenance mode.<br/>
Avatars are still served, but all write operations may result
in loss of these changes.
</p>
<hr/>
</div>
</div>
</section>
{% endblock %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment