change info text via ENV

This commit is contained in:
miklo 2025-12-08 03:59:33 +01:00
parent b927182e7d
commit da344b515b
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import os
DB = os.environ.get("DB_PATH", "queue.db") DB = os.environ.get("DB_PATH", "queue.db")
ADMIN_SUFFIX = os.environ.get("ADMIN_URL", "admin").strip("/") ADMIN_SUFFIX = os.environ.get("ADMIN_URL", "admin").strip("/")
ADMIN_PATH = f"/{ADMIN_SUFFIX}" if ADMIN_SUFFIX else "/admin" ADMIN_PATH = f"/{ADMIN_SUFFIX}" if ADMIN_SUFFIX else "/admin"
INFO_TEXT = os.environ.get("INFO_TEXT", "Chcesz spróbować swoich sił w lutowaniu? Odbierz numer i sprawdzaj kolejkę tutaj lub na queue.hswro.org")
app = Flask(__name__) app = Flask(__name__)
@ -61,7 +62,7 @@ def infokiosk():
) )
row = cur.fetchone() row = cur.fetchone()
current = row["number"] if row else "" current = row["number"] if row else ""
return render_template("infokiosk.html", current=current) return render_template("infokiosk.html", current=current, infotext=INFO_TEXT)
# API endpoint used by clients to poll current number(s) (JSON) # API endpoint used by clients to poll current number(s) (JSON)

View File

@ -118,7 +118,8 @@
const waitingCount = j.waiting != null ? j.waiting : '0'; const waitingCount = j.waiting != null ? j.waiting : '0';
const first = j.first != 0 ? j.first : '-'; const first = j.first != 0 ? j.first : '-';
const infoText = 'Chcesz spróbować swoich sił w lutowaniu? Odbierz numer i sprawdzaj kolejkę tutaj lub na queue.hswro.org'; const infoText = ({{ infotext | tojson }});
// const infoText = 'Chcesz spróbować swoich sił w lutowaniu? Odbierz numer i sprawdzaj kolejkę tutaj lub na queue.hswro.org';
const numsFormatted = nums.map(n => `<span class="num-inline">${n}</span>`).join(' '); const numsFormatted = nums.map(n => `<span class="num-inline">${n}</span>`).join(' ');
const numList = nums.length > 0 ? `| Zapraszamy z numerami: ${numsFormatted}` : ''; const numList = nums.length > 0 ? `| Zapraszamy z numerami: ${numsFormatted}` : '';
const combinedText = `${infoText} | Liczba oczekujących: ${waitingCount} | Pierwszy w kolejce nr ${first} ${numList} `; const combinedText = `${infoText} | Liczba oczekujących: ${waitingCount} | Pierwszy w kolejce nr ${first} ${numList} `;