Add a maintenance pause/resume switch and a proper user navbar
RoundConfig gets a paused flag toggled via new POST /admin/pause and /admin/resume endpoints (audit-logged, surfaced as a "Manutenzione" card in the admin Parametri view). Pausing only stops the *next* round from opening once the current one closes — rounds/service.py:open_new_round_if_needed still lets an in-progress round finish, draw, and pay out its winner normally. GET /rounds/current exposes lottery_paused so the user page shows a maintenance banner (even while logged out) instead of silently going idle. Also replaces the user dashboard's stacked account-bar card + bento-grid menu with a single sticky navbar (identity row + Deposito/Bet/Prelievo tabs), and moves the page content into a dedicated .app-shell container so the navbar itself can span full width.
This commit is contained in:
1 parent
78109aa4c4
commit
162a63d04a
12 files changed
+299
-72
No files matched your search
@@ -81,6 +81,29 @@ async def test_admin_reads_and_updates_config(client):
|
||||
assert resp.json()["fee_address"] == "plm1qfeeaddress"
|
||||
|
||||
|
||||
async def test_admin_can_pause_and_resume_the_lottery(client):
|
||||
headers = {"X-Admin-Token": "test-admin-token"}
|
||||
|
||||
resp = await client.get("/admin/config", headers=headers)
|
||||
assert resp.json()["paused"] is False
|
||||
|
||||
resp = await client.post("/admin/pause", headers=headers)
|
||||
assert resp.status_code == 200
|
||||
assert resp.json()["paused"] is True
|
||||
|
||||
resp = await client.get("/admin/config", headers=headers)
|
||||
assert resp.json()["paused"] is True
|
||||
|
||||
resp = await client.post("/admin/resume", headers=headers)
|
||||
assert resp.status_code == 200
|
||||
assert resp.json()["paused"] is False
|
||||
|
||||
|
||||
async def test_admin_pause_requires_token(client):
|
||||
resp = await client.post("/admin/pause")
|
||||
assert resp.status_code == 403
|
||||
|
||||
|
||||
async def test_admin_lists_users(client):
|
||||
from app.db import base as db_base
|
||||
from app.db.models import User
|
||||
|
||||
Reference in new issue
Block a user