Compare commits
2 Commits
b927182e7d
...
e9410b0ca6
| Author | SHA1 | Date |
|---|---|---|
|
|
e9410b0ca6 | |
|
|
da344b515b |
|
|
@ -5,6 +5,8 @@
|
||||||
- Adds numbers to the list of tokens issued.
|
- Adds numbers to the list of tokens issued.
|
||||||
- Selects numbers from the list to be called.
|
- Selects numbers from the list to be called.
|
||||||
- Removes the called number from the list or moves it back to the queue.
|
- 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
|
## Common tasks
|
||||||
|
|
||||||
|
|
@ -14,10 +16,11 @@ In the repo directory:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker build -t queue-app:latest .
|
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:
|
Preview should be available on:
|
||||||
`http://localhost:5000` - end user access
|
`http://localhost:5000` - end user access
|
||||||
`http://localhost:5000/admin` - operator access
|
`http://localhost:5000/admin` - operator access
|
||||||
|
`http://localhost:5000/infokiosk` - information page
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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} `;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue