Configure PayPal integration and cart checkout error display

This commit is contained in:
Zach committed 2026-12-01 04:20:38 +00:00
1 parent 62065828e1
commit cf07fc5d9b
98 files changed
+1430 -281

No files matched your search

+13 -3
View File
@@ -4,7 +4,7 @@ from django.urls import reverse
from .community import MENU
from .fans import unread_count
from .backgrounds import SAFE_ROUTES
from .models import FloatingArtwork, PageBackground, TitleFollow
from .models import FloatingArtwork, PageBackground, TitleFollow, ManagedPage
from .newsletter import SignupForm, signup_open
from .views import settings_row
from .theme import HEX_COLOR, css_variables
@@ -46,14 +46,24 @@ def site_context(request):
hidden = settings.hidden_menu if isinstance(settings.hidden_menu, list) else []
links = []
for key, label, route in MENU:
if key in hidden or (key == 'shop' and not settings.shop_url):
if key in hidden:
continue
if key in ('library', 'notices') and not request.user.is_authenticated:
continue
if key == 'account' and request.user.is_authenticated:
continue
url = settings.shop_url if key == 'shop' else reverse(route, args=[key] if key in ('cast', 'world') else [])
url = (settings.shop_url or reverse('shop-index')) if key == 'shop' else reverse(route, args=[key] if key in ('cast', 'world') else [])
links.append({'key': key, 'label': label, 'url': url, 'active': key == active_nav})
custom = list(ManagedPage.objects.filter(published=True, show_in_menu=True).order_by('pk'))
replacements = {page.menu_key: page for page in custom if page.menu_key}
for link in links:
page = replacements.pop(link['key'], None)
if page:
link.update(label=page.title, url=page.get_absolute_url(), active=request.path == page.get_absolute_url())
for page in custom:
if not page.menu_key:
links.append({'key': page.slug, 'label': page.title, 'url': page.get_absolute_url(),
'active': request.path == page.get_absolute_url()})
context['public_menu'] = links
if request.user.is_authenticated:
follow = TitleFollow.objects.filter(user=request.user).first()