from django.contrib import admin from django.urls import include, path, re_path from main import feeds from main.views import api, billing, export, general, moderation admin.site.site_header = "BōcPress admin" # general urlpatterns = [ path("", general.index, name="index"), path("blog/", general.blog_index, name="blog_index"), path("workshop/", general.dashboard, name="dashboard"), path("about/methodology/", general.methodology, name="methodology"), path("about/transparency/", general.transparency, name="transparency"), path("about/comparisons/", general.comparisons, name="comparisons"), path("guides/markdown/", general.guides_markdown, name="guides_markdown"), path("guides/assets/", general.guides_images, name="guides_images"), path( "guides/custom-domain/", general.guides_customdomain, name="guides_customdomain" ), path("guides/comments/", general.guides_comments, name="guides_comments"), ] # user system urlpatterns += [ path("accounts/logout/", general.Logout.as_view(), name="logout"), path("accounts/", include("django.contrib.auth.urls")), path( "accounts/create/", general.UserCreateStepOne.as_view(), name="user_create", ), path( "accounts/humanity-diagnostics//", general.UserCreateStepTwo.as_view(), name="user_create_step_two", ), path("accounts/edit/", general.UserUpdate.as_view(), name="user_update"), path("accounts/delete/", general.UserDelete.as_view(), name="user_delete"), path("accounts/domain/", general.domain_check, name="domain_check"), ] # moderation urlpatterns += [ path("moderation/index/", moderation.index, name="moderation_index"), path("moderation/cards/", moderation.user_cards, name="moderation_user_cards"), path("moderation/users/", moderation.user_list, name="moderation_user_list"), path("moderation/assets/", moderation.images_leaderboard, name="moderation_images"), path("moderation/posts/", moderation.posts_leaderboard, name="moderation_posts"), path("moderation/stats/", moderation.stats, name="moderation_stats"), path( "moderation/activity/", moderation.activity, name="moderation_activity", ), path("moderation/cohorts/", moderation.cohorts, name="moderation_cohorts"), path( "moderation/summary//", moderation.summary, name="moderation_summary", ), path( "moderation/users//approve/", moderation.user_approve, name="moderation_user_approve", ), path( "moderation/users//unapprove/", moderation.user_unapprove, name="moderation_user_unapprove", ), path( "moderation/users//delete/", moderation.user_delete, name="moderation_user_delete", ), ] # blog posts and post snapshots urlpatterns += [ path("posts-workshop/", general.PostList.as_view(), name="post_list_dashboard"), path( "post-backups/create/", general.SnapshotCreate.as_view(), name="snapshot_create" ), path('post-backups//delete/', general.SnapshotDelete.as_view(), name='snapshot_delete'), path("post-backups/", general.SnapshotList.as_view(), name="snapshot_list"), path( "post-backups//", general.SnapshotDetail.as_view(), name="snapshot_detail", ), path("new/post/", general.PostCreate.as_view(), name="post_create"), path("posts/", general.post_list, name="post_list"), path("blog//", general.PostDetail.as_view(), name="post_detail"), path("posts//", general.post_detail_redir, name="post_detail_redir_a"), path("post//", general.post_detail_redir, name="post_detail_redir_b"), path("blog//edit/", general.PostUpdate.as_view(), name="post_update"), path("blog//delete/", general.PostDelete.as_view(), name="post_delete"), path("workshop/homepage/", general.HomepageUpdate.as_view(), name="homepage_update"), ] # blog extras urlpatterns += [ path("rss/", feeds.RSSBlogFeed(), name="rss_feed"), path("atom/", feeds.AtomBlogFeed(), name="atom_feed"), path("feed/", feeds.RSSBlogFeed()), path("feed/rss/", feeds.RSSBlogFeed()), path("feed/atom/", feeds.AtomBlogFeed()), path("feed.xml", feeds.RSSBlogFeed()), path("rss.xml", feeds.RSSBlogFeed()), path("atom.xml", feeds.AtomBlogFeed()), path("index.xml", feeds.RSSBlogFeed()), # really simple licensing path("license/", general.rsl_license_redirect, name="rsl_license_redirect"), path("license.xml", general.rsl_license_detail.as_view(), name="rsl_license"), path("workshop/licensing/", general.RSLUpdate.as_view(), name="rsl_update"), path("sitemap.xml", general.sitemap, name="sitemap"), path("robots.txt", general.robotstxt.as_view(), name="robots_txt"), path("newsletter/", general.Notification.as_view(), name="notification_subscribe"), path( "newsletter/unsubscribe/", general.NotificationUnsubscribe.as_view(), name="notification_unsubscribe", ), path( "newsletter/unsubscribe//", general.notification_unsubscribe_key, name="notification_unsubscribe_key", ), path( "notifications/", general.NotificationRecordList.as_view(), name="notificationrecord_list", ), path( "notifications/subscribers", general.NotificationList.as_view(), name="notification_list", ), ] # comments urlpatterns += [ path("comments/pending/", general.CommentPending.as_view(), name="comment_pending"), path( "blog//comments/create/author/", general.CommentCreateAuthor.as_view(), name="comment_create_author", ), path( "blog//comments/create/", general.CommentCreate.as_view(), name="comment_create", ), path( "blog//comments//delete/", general.CommentDelete.as_view(), name="comment_delete", ), path( "blog//comments//approve/", general.CommentApprove.as_view(), name="comment_approve", ), ] # billing urlpatterns += [ path("billing/", billing.billing_index, name="billing_index"), path("billing/card/", billing.BillingCard.as_view(), name="billing_card"), path( "billing/subscribe/", billing.BillingSubscribe.as_view(), name="billing_subscribe", ), path( "billing/card//delete/", billing.BillingCardDelete.as_view(), name="billing_card_delete", ), path( "billing/card//default/", billing.billing_card_default, name="billing_card_default", ), path( "billing/subscription/", billing.billing_subscription, name="billing_subscription", ), path( "billing/subscription/welcome/", billing.billing_welcome, name="billing_welcome", ), path( "billing/subscription/card/confirm/", billing.billing_card_confirm, name="billing_card_confirm", ), path( "billing/subscription/cancel/", billing.BillingCancel.as_view(), name="billing_subscription_cancel", ), path( "billing/stripe/webhook/", billing.billing_stripe_webhook, name="billing_stripe_webhook", ), ] # blog import, export, webring urlpatterns += [ path("webring/", general.WebringUpdate.as_view(), name="webring"), path("import/", general.BlogImport.as_view(), name="blog_import"), path("export/", export.export_index, name="export_index"), path( "export/markdown/", export.export_markdown, name="export_markdown", ), path("export/zola/", export.export_zola, name="export_zola"), path("export/hugo/", export.export_hugo, name="export_hugo"), path("export/epub/", export.export_epub, name="export_epub"), path("export/print/", export.export_print, name="export_print"), path( "export/unsubscribe//", export.export_unsubscribe_key, name="export_unsubscribe_key", ), ] # assets (images and other files) urlpatterns += [ path("assets/.", general.image_raw, name="image_raw"), re_path( r"^assets/(?P\?[\w\=]+)?$", # e.g. assets/ or assets/?raw=true general.ImageList.as_view(), name="image_list", ), path("assets//", general.ImageDetail.as_view(), name="image_detail"), path( "assets//edit/", general.ImageUpdate.as_view(), name="image_update" ), path( "assets//delete/", general.ImageDelete.as_view(), name="image_delete", ), ] # analytics urlpatterns += [ path("analytics/", general.AnalyticList.as_view(), name="analytic_list"), path( "analytics/post//", general.AnalyticPostDetail.as_view(), name="analytic_post_detail", ), path( "analytics/page//", general.AnalyticPageDetail.as_view(), name="analytic_page_detail", ), ] # api urlpatterns += [ path("api/docs/", api.api_docs, name="api_docs"), path("api/reset/", api.APIKeyReset.as_view(), name="api_reset"), path("api/posts/", api.api_posts, name="api_posts"), path("api/posts//", api.api_post, name="api_post"), ] # pages - needs to be last due to urlpatterns += [ path("pages/", general.PageList.as_view(), name="page_list"), path("new/page/", general.PageCreate.as_view(), name="page_create"), path("/", general.PageDetail.as_view(), name="page_detail"), path("/edit/", general.PageUpdate.as_view(), name="page_update"), path("/delete/", general.PageDelete.as_view(), name="page_delete"), ]