1
0

Add tobacco image, Fix session cookie non https

This commit is contained in:
Marcel Schwarz 2022-08-07 14:29:11 +02:00
parent db52750d97
commit 2e475ca433
6 changed files with 11 additions and 6 deletions

View File

@ -12,6 +12,7 @@ services:
environment:
- ALLOWED_HOSTS=internal.security
- CSRF_TRUSTED_ORIGINS=internal.security
- SESSION_COOKIE_SECURE=False
- IP_RATE_LIMIT_TIME=1 # rate limit doesn't work in docker networking therefore disable it
nginx:

View File

@ -73,7 +73,7 @@ if csrf_origins := os.getenv("CSRF_TRUSTED_ORIGINS"):
WSGI_APPLICATION = 'clubhaus.wsgi.application'
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = os.getenv("SESSION_COOKIE_SECURE", "False") == "True"
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases

View File

@ -20,10 +20,10 @@
const timerId =
countdown(
function (ts) {
document.getElementById("timerDays").textContent = ts.days;
document.getElementById("timerHours").textContent = ts.hours;
document.getElementById("timerMinutes").textContent = ts.minutes;
document.getElementById("timerSeconds").textContent = ts.seconds;
document.getElementById("timerDays").textContent = ts.days || "00";
document.getElementById("timerHours").textContent = ts.hours || "00";
document.getElementById("timerMinutes").textContent = ts.minutes || "00";
document.getElementById("timerSeconds").textContent = ts.seconds || "00";
},
new Date("{{ next_event.date.isoformat }}"),
countdown.DAYS | countdown.HOURS | countdown.MINUTES | countdown.SECONDS);

View File

@ -25,6 +25,9 @@
{% for tobacco in tobaccos %}
<div class="col-sm-6 col-lg-4 col-sm-12 mb-4 text-center">
<div class="card {% if tobacco.in_stock %} bg-success {% else %} red-700 text-decoration-line-through {% endif %}">
{% if tobacco.picture %}
<img class="rounded" src="{% get_media_prefix %}{{ tobacco.picture }}" alt="Tobacco Image">
{% endif %}
<div class="card-header">
<h4 class="align-baseline">{{ tobacco.name }}</h4>
<h6 class="card-subtitle mb-2">{{ tobacco.category.name }}</h6>

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -1 +1,2 @@
django~=4.0.5
Pillow~=8.3.1