Compare commits
1 Commits
d2e07e047e
...
65c4989d08
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65c4989d08 |
1
browser/templates/_types/auth/_fragment_panel.html
Normal file
1
browser/templates/_types/auth/_fragment_panel.html
Normal file
@@ -0,0 +1 @@
|
||||
{{ page_fragment_html | safe }}
|
||||
@@ -2,16 +2,6 @@
|
||||
{% call links.link(account_url('/newsletters/'), hx_select_search, select_colours, True, aclass=styles.nav_button) %}
|
||||
newsletters
|
||||
{% endcall %}
|
||||
{% for link in account_nav_links %}
|
||||
{% if link.external %}
|
||||
<div class="relative nav-group">
|
||||
<a href="{{ link.href_fn() }}" class="{{styles.nav_button}}" data-hx-disable>
|
||||
{{ link.label }}
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
{% call links.link(link.href_fn(), hx_select_search, select_colours, True, aclass=styles.nav_button) %}
|
||||
{{ link.label }}
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if account_nav_html %}
|
||||
{{ account_nav_html | safe }}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,43 +1,10 @@
|
||||
"""Calendar-domain widgets: account pages (tickets & bookings).
|
||||
"""Calendar-domain widgets.
|
||||
|
||||
Container nav and card widgets have been replaced by fragments
|
||||
All calendar widgets have been replaced by fragments
|
||||
(events app serves them at /internal/fragments/).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from shared.contracts.widgets import AccountPageWidget
|
||||
from shared.services.widget_registry import widgets
|
||||
from shared.services.registry import services
|
||||
|
||||
|
||||
# -- account pages: tickets & bookings ---------------------------------------
|
||||
|
||||
async def _tickets_context(session, *, user_id, **kw):
|
||||
tickets = await services.calendar.user_tickets(session, user_id=user_id)
|
||||
return {"tickets": tickets}
|
||||
|
||||
|
||||
async def _bookings_context(session, *, user_id, **kw):
|
||||
bookings = await services.calendar.user_bookings(session, user_id=user_id)
|
||||
return {"bookings": bookings}
|
||||
|
||||
|
||||
# -- registration entry point ------------------------------------------------
|
||||
|
||||
def register_calendar_widgets() -> None:
|
||||
widgets.add_account_page(AccountPageWidget(
|
||||
domain="calendar",
|
||||
slug="tickets",
|
||||
label="tickets",
|
||||
order=20,
|
||||
context_fn=_tickets_context,
|
||||
template="_types/auth/_tickets_panel.html",
|
||||
))
|
||||
widgets.add_account_page(AccountPageWidget(
|
||||
domain="calendar",
|
||||
slug="bookings",
|
||||
label="bookings",
|
||||
order=30,
|
||||
context_fn=_bookings_context,
|
||||
template="_types/auth/_bookings_panel.html",
|
||||
))
|
||||
pass
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
"""Cart-domain widgets: orders link on account page."""
|
||||
from __future__ import annotations
|
||||
"""Cart-domain widgets.
|
||||
|
||||
from shared.contracts.widgets import AccountNavLink
|
||||
from shared.services.widget_registry import widgets
|
||||
from shared.infrastructure.urls import cart_url
|
||||
Account nav link has been replaced by fragments
|
||||
(cart app serves account-nav-item at /internal/fragments/).
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def register_cart_widgets() -> None:
|
||||
widgets.add_account_link(AccountNavLink(
|
||||
label="orders",
|
||||
order=100,
|
||||
href_fn=lambda: cart_url("/orders/"),
|
||||
external=True,
|
||||
))
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user