feat: add markets and payments management pages
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 45s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 45s
- New markets blueprint at /<slug>/markets/ with create/delete - New payments blueprint at /<slug>/payments/ with SumUp config - Register both in events app with context processor for markets - Remove PageConfig feature flag check from calendar creation (feature toggles replaced by direct management pages) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
23
app.py
23
app.py
@@ -9,7 +9,7 @@ from sqlalchemy import select
|
||||
|
||||
from shared.factory import create_base_app
|
||||
|
||||
from suma_browser.app.bp import register_calendars
|
||||
from suma_browser.app.bp import register_calendars, register_markets, register_payments
|
||||
|
||||
|
||||
async def events_context() -> dict:
|
||||
@@ -43,6 +43,7 @@ async def events_context() -> dict:
|
||||
def create_app() -> "Quart":
|
||||
from models.ghost_content import Post
|
||||
from models.calendars import Calendar
|
||||
from models.market_place import MarketPlace
|
||||
|
||||
app = create_base_app("events", context_fn=events_context)
|
||||
|
||||
@@ -59,6 +60,18 @@ def create_app() -> "Quart":
|
||||
url_prefix="/<slug>/calendars",
|
||||
)
|
||||
|
||||
# Markets nested under post slug: /<slug>/markets/...
|
||||
app.register_blueprint(
|
||||
register_markets(),
|
||||
url_prefix="/<slug>/markets",
|
||||
)
|
||||
|
||||
# Payments nested under post slug: /<slug>/payments/...
|
||||
app.register_blueprint(
|
||||
register_payments(),
|
||||
url_prefix="/<slug>/payments",
|
||||
)
|
||||
|
||||
# --- Auto-inject slug into url_for() calls ---
|
||||
@app.url_value_preprocessor
|
||||
def pull_slug(endpoint, values):
|
||||
@@ -109,9 +122,17 @@ def create_app() -> "Quart":
|
||||
.order_by(Calendar.name.asc())
|
||||
)
|
||||
).scalars().all()
|
||||
markets = (
|
||||
await g.s.execute(
|
||||
select(MarketPlace)
|
||||
.where(MarketPlace.post_id == post_id, MarketPlace.deleted_at.is_(None))
|
||||
.order_by(MarketPlace.name.asc())
|
||||
)
|
||||
).scalars().all()
|
||||
return {
|
||||
**post_data,
|
||||
"calendars": calendars,
|
||||
"markets": markets,
|
||||
}
|
||||
|
||||
# Tickets blueprint — user-facing ticket views and QR codes
|
||||
|
||||
Reference in New Issue
Block a user