Files

66 lines
4.3 KiB
Python

from django.conf import settings
from django.urls import include, re_path
from django.views.static import serve
from django.views.generic import TemplateView
from django.urls import path
from django.contrib.auth import views as auth_views
from catalog import views, fans, reactions, reviews, paypal, streams, newsletter, shop_stripe, membership, collectors
from catalog.admin import studio
urlpatterns = [
path('', views.home, name='home'),
path('map/', views.map_landing, name='world-map'),
path('pages/<slug:slug>/', views.managed_page, name='managed-page'),
path('chapters/<int:number>/buy/', views.buy_chapter, name='buy-chapter'),
path('admin/', studio.urls),
path('shop/', include('shop.urls')),
path('chapters/', views.chapters, name='chapters'),
path('chapters/<int:number>/', views.chapter, name='chapter'),
path('chapters/<int:number>/discussion/', views.chapter_discussion, name='chapter-discussion'),
path('chapters/<int:number>/reviews/', reviews.listing, name='slx-reviews'),
path('chapters/<int:number>/reviews/write/', reviews.write, name='slx-review-write'),
path('chapters/<int:number>/reviews/<int:pk>/', reviews.detail, name='slx-review'),
path('reviews/', reviews.series_listing, name='slx-series-reviews'),
path('reviews/write/', reviews.series_write, name='slx-series-review-write'),
path('reviews/<int:pk>/', reviews.series_detail, name='slx-series-review'),
path('reviews/chapter/<int:pk>/pages/', reviews.page_choices, name='slx-review-pages'),
path('readers/<int:pk>/', reviews.profile, name='slx-profile'),
path('fan/react/<str:kind>/<int:pk>/', reactions.react, name='slx-react'),
path('blog/', views.entries, {'kind': 'news'}, name='blog'),
path('blog/<slug:slug>/', views.entry, {'kind': 'news'}, name='blog-post'),
path('upcoming/', views.upcoming, name='upcoming'),
path('live/', views.stream, name='stream'),
path('live/comment/', streams.post_comment, name='stream-comment'),
path('community/', views.community, name='slx-community'),
path('search/', views.search, name='search'),
path('fan/login/', auth_views.LoginView.as_view(template_name='registration/fan-login.html'), name='fan-login'),
path('fan/logout/', auth_views.LogoutView.as_view(next_page='home'), name='fan-logout'),
path('fan/signup/', fans.signup, name='fan-signup'),
path('fan/collector-preferences/', collectors.preferences, name='collector-preferences'),
path('fan/library/', fans.library, name='library'),
path('fan/follow/', fans.follow_title, name='fan-follow'),
path('fan/notifications/', fans.notices, name='fan-notices'),
path('fan/action/<str:kind>/<int:pk>/', fans.act, name='fan-action'),
path('books/', paypal.books, name='books'),
path('books/checkout/<int:product_id>/<int:variant_id>/', shop_stripe.checkout, name='shop-stripe-checkout'),
path('books/payment/<uuid:reference>/', shop_stripe.receipt, name='shop-stripe-receipt'),
path('webhooks/stripe/shop/', shop_stripe.webhook, name='shop-stripe-webhook'),
path('chapters/<int:number>/checkout/', paypal.start, name='paypal-start'),
path('checkout/paypal/<uuid:checkout_id>/', paypal.returned, name='paypal-return'),
path('checkout/paypal/<uuid:checkout_id>/finish/', paypal.finish, name='paypal-finish'),
path('coming-soon/', views.coming_soon, name='coming-soon'),
path('media/images/<uuid:key>', views.image, name='image'),
re_path(r'^media/shop/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT / 'shop'}),
path('healthz/', views.health, name='health'),
path('membership/', membership.index, name='membership'),
path('membership/posts/<int:pk>/', membership.detail, name='member-post'),
path('newsletter/', newsletter.signup, name='newsletter-signup'),
path('newsletter/confirm/<uuid:token>/', newsletter.confirm, name='newsletter-confirm'),
path('newsletter/unsubscribe/<uuid:token>/', newsletter.unsubscribe, name='newsletter-unsubscribe'),
path('newsletter/one-click/<uuid:token>/', newsletter.one_click, name='newsletter-one-click'),
path('about/', TemplateView.as_view(template_name='series-intro.html'), name='series-intro'),
path('djinnii/', TemplateView.as_view(template_name='djinnii.html'), name='djinnii'),
path('<slug:kind>/', views.entries, name='entries'),
path('<slug:kind>/<slug:slug>/', views.entry, name='entry'),
]