Compare commits

...

2 Commits

Author SHA1 Message Date
miklo e9410b0ca6 change readme 2025-12-08 04:32:46 +01:00
miklo da344b515b change info text via ENV 2025-12-08 03:59:33 +01:00
3 changed files with 10 additions and 5 deletions

View File

@ -5,6 +5,8 @@
- Adds numbers to the list of tokens issued.
- Selects numbers from the list to be called.
- Removes the called number from the list or moves it back to the queue.
- People check whether their number has been called on queue.hswro.org
- Additional page queue.hswro.org/infokiosk displays video and information bar.
## Common tasks
@ -14,10 +16,11 @@ In the repo directory:
```
docker build -t queue-app:latest .
docker run -p="5000:5000" --volume="$PWD:/data:" -it queue-app:latest
docker run -it --rm -p 5000:5000 -v "$(pwd)":/data -e INFO_TEXT='example info text' queue-app:latest
```
Preview should be available on:
`http://localhost:5000` - end user access
`http://localhost:5000/admin` - operator access
`http://localhost:5000/infokiosk` - information page

View File

@ -6,6 +6,7 @@ import os
DB = os.environ.get("DB_PATH", "queue.db")
ADMIN_SUFFIX = os.environ.get("ADMIN_URL", "admin").strip("/")
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__)
@ -61,7 +62,7 @@ def infokiosk():
)
row = cur.fetchone()
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)

View File

@ -118,7 +118,8 @@
const waitingCount = j.waiting != null ? j.waiting : '0';
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 numList = nums.length > 0 ? `| Zapraszamy z numerami: ${numsFormatted}` : '';
const combinedText = `${infoText} | Liczba oczekujących: ${waitingCount} | Pierwszy w kolejce nr ${first} ${numList} `;