diff --git a/bp/post/routes.py b/bp/post/routes.py index 3d8640e..fd8a07f 100644 --- a/bp/post/routes.py +++ b/bp/post/routes.py @@ -12,6 +12,7 @@ from quart import ( from .services.post_data import post_data from .services.post_operations import toggle_post_like from models.calendars import Calendar +from models.market_place import MarketPlace from sqlalchemy import select from suma_browser.app.redis_cacher import cache_page, clear_cache @@ -74,6 +75,14 @@ def register(): ) ).scalars().all() + markets = ( + await g.s.execute( + select(MarketPlace) + .where(MarketPlace.post_id == db_post_id, MarketPlace.deleted_at.is_(None)) + .order_by(MarketPlace.name.asc()) + ) + ).scalars().all() + # Fetch associated entries for nav display associated_entries = await get_associated_entries(g.s, db_post_id) @@ -81,6 +90,7 @@ def register(): **p_data, "base_title": f"{config()['title']} {p_data['post']['title']}", "calendars": calendars, + "markets": markets, "associated_entries": associated_entries, } else: diff --git a/shared_lib b/shared_lib index 7eb66fb..e653acb 160000 --- a/shared_lib +++ b/shared_lib @@ -1 +1 @@ -Subproject commit 7eb66fbf244a13c0cd97474a5ae85f863b35ee47 +Subproject commit e653acb921487228986789e32115bd4e0f321906 diff --git a/templates/_types/post/_nav.html b/templates/_types/post/_nav.html index 5cc37ae..aabea7a 100644 --- a/templates/_types/post/_nav.html +++ b/templates/_types/post/_nav.html @@ -1,6 +1,6 @@ {% import 'macros/links.html' as links %} {# Associated Entries and Calendars - vertical on mobile, horizontal with arrows on desktop #} - {% if (associated_entries and associated_entries.entries) or calendars %} + {% if (associated_entries and associated_entries.entries) or calendars or markets %}
{% include '_types/post/admin/_nav_entries.html' %} diff --git a/templates/_types/post/admin/_main_panel.html b/templates/_types/post/admin/_main_panel.html index 581b804..1ebe622 100644 --- a/templates/_types/post/admin/_main_panel.html +++ b/templates/_types/post/admin/_main_panel.html @@ -4,8 +4,12 @@ class="flex-1 md:h-full md:min-h-0 overflow-y-auto overscroll-contain js-grid-viewport" > {% if post and post.is_page %} -
+
{% include "_types/post/admin/_features_panel.html" %} + + {% if features.get('market') %} + {% include "_types/post/admin/_markets_panel.html" %} + {% endif %}
{% endif %}