Merge branch 'master' of ssh://willipink.eu:3456/moritz/coinmanager
This commit is contained in:
commit
dd60c3ed52
@ -1,5 +1,10 @@
|
|||||||
{% if single_country %}{% include 'header.html' with title=country.name %}
|
{% if single_country %}{% include 'header.html' with title=country.name %}{% endif %}
|
||||||
{% include 'coinc/controlbar.html' with users=users %}{% endif %}
|
{% if maintenance_mode %}
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
<h4 class="alert-heading">Wartungsarbeiten</h4>
|
||||||
|
<p class="mb-0">Es können im Moment keine Änderungen an der Münztabelle vorgenommen werden</p>
|
||||||
|
</div>
|
||||||
|
{% elif logged_in %}{% include 'coinc/controlbar.html' with users=users %}{% endif %}
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<table name="{{ country.name_iso }}">
|
<table name="{{ country.name_iso }}">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
{% include 'coinc/filter_country.html' with countrys=countrys %}
|
{% include 'coinc/filter_country.html' with countrys=countrys %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %}
|
<p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %}
|
||||||
{% include 'footer.html' with title='Münzsammlung' %}
|
{% include 'footer.html' %}
|
||||||
|
@ -26,8 +26,7 @@ from . import views
|
|||||||
app_name = 'coinc'
|
app_name = 'coinc'
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', views.index, name='index'),
|
path('', views.index, name='index'),
|
||||||
path('statistik', views.statistic, name='statistic'),
|
#path('statistik', views.statistic, name='statistic'),
|
||||||
path('<str:name_iso>', views.detail_country, name='country'),
|
path('<str:name_iso>', views.detail_country, name='country'),
|
||||||
path('add/user/<str:username>/color/<str:color>', views.add_user, name='add_user'),
|
path('add/user/<str:username>/color/<str:color>', views.add_user, name='add_user'),
|
||||||
path('add/coin', views.add_coin, name='add_coin')
|
path('add/coin', views.add_coin, name='add_coin') ]
|
||||||
]
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
from json import dumps
|
from json import dumps
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.http import HttpResponse, Http404
|
from django.http import HttpResponse, Http404
|
||||||
from django.template import loader
|
from django.template import loader
|
||||||
from django.template.defaultfilters import register
|
from django.template.defaultfilters import register
|
||||||
@ -72,10 +73,18 @@ def detail_country(request, name_iso):
|
|||||||
try:
|
try:
|
||||||
country = Country.objects.get(name_iso=name_iso)
|
country = Country.objects.get(name_iso=name_iso)
|
||||||
except Country.DoesNotExist:
|
except Country.DoesNotExist:
|
||||||
raise Http404(f"Das Land '{name_iso}' ist nicht vorhanden")
|
raise Http404(f"Das Land '{name_iso}' existiert nicht.")
|
||||||
|
|
||||||
context = show_country(country, single_country=True)
|
context = show_country(country, single_country=True)
|
||||||
|
|
||||||
|
password = 'foobar'
|
||||||
|
password_try = request.GET.get('p', '')
|
||||||
|
if password_try == password:
|
||||||
|
if settings.MAINTENANCE_MODE_READ_ONLY:
|
||||||
|
context['maintenance_mode'] = True
|
||||||
|
else:
|
||||||
|
context['logged_in'] = True
|
||||||
|
|
||||||
return HttpResponse(template.render(context, request))
|
return HttpResponse(template.render(context, request))
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,3 +119,6 @@ USE_TZ = True
|
|||||||
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
|
# Maintenance Mode
|
||||||
|
MAINTENANCE_MODE_READ_ONLY = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user