Merge branch 'master' of ssh://willipink.eu:3456/moritz/coinmanager

This commit is contained in:
willipink 2020-06-19 11:29:57 +00:00
commit dd60c3ed52
6 changed files with 24 additions and 8 deletions

View File

@ -1,5 +1,10 @@
{% if single_country %}{% include 'header.html' with title=country.name %}
{% include 'coinc/controlbar.html' with users=users %}{% endif %}
{% if single_country %}{% include 'header.html' with title=country.name %}{% 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">
<table name="{{ country.name_iso }}">
<thead>

View File

@ -4,4 +4,4 @@
{% include 'coinc/filter_country.html' with countrys=countrys %}
{% else %}
<p>Trage zuerst Länder im Adminbereich ein.</p>{% endif %}
{% include 'footer.html' with title='Münzsammlung' %}
{% include 'footer.html' %}

View File

@ -26,8 +26,7 @@ from . import views
app_name = 'coinc'
urlpatterns = [
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('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') ]

View File

@ -20,6 +20,7 @@
from datetime import datetime, date
from json import dumps
from django.conf import settings
from django.http import HttpResponse, Http404
from django.template import loader
from django.template.defaultfilters import register
@ -72,10 +73,18 @@ def detail_country(request, name_iso):
try:
country = Country.objects.get(name_iso=name_iso)
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)
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))

View File

@ -119,3 +119,6 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
# Maintenance Mode
MAINTENANCE_MODE_READ_ONLY = True

2
update
View File

@ -3,7 +3,7 @@
set -e
echo "cloning ..."
git pull origin master >/dev/null
git pull -q origin master >/dev/null
echo "collecting ..."