Restore and lock in shop app, admin sidebar, media routing, and Stripe
This commit is contained in:
1 parent
9562e64298
commit
bb947cf7f0
11 files changed
+197
-16
No files matched your search
+17
-11
@@ -16,7 +16,7 @@ from django.utils.html import format_html
|
||||
from .models import SiteSettings, Chapter, Page, Entry, DiscussionComment, FanNotice, ChapterReview, SeriesReview, BookListing, ChapterPurchase, StreamComment, FanMembership, SupportCredit, AIChapterReview
|
||||
from .fans import live, notify
|
||||
from .newsletter_admin import CampaignAdmin, SubscriberAdmin
|
||||
from .models import NewsletterCampaign, NewsletterSubscriber, PageBackground, FloatingArtwork, ProductVariant, PageSharePreview, ShopOrder
|
||||
from .models import NewsletterCampaign, NewsletterSubscriber, PageBackground, FloatingArtwork, ProductVariant, PageSharePreview, ShopOrder, MemberPost, MemberArtwork
|
||||
from .backgrounds import PAGE_CHOICES
|
||||
from .sharing import validate_share_path
|
||||
from .uploads import ShareImageUploadField
|
||||
@@ -45,16 +45,9 @@ class Studio(admin.AdminSite):
|
||||
('◎', 'Cast', 'entry', Entry.Kind.CAST),
|
||||
('◇', 'World archive', 'entry', Entry.Kind.WORLD),
|
||||
]),
|
||||
('Community', [('◎', 'Fan memberships', 'fanmembership', None), ('◈', 'Verified support', 'supportcredit', None), ('◉', 'Moderate comments', 'discussioncomment', None), ('★', 'Moderate chapter reviews', 'chapterreview', None), ('★', 'Moderate series reviews', 'seriesreview', None), ('◉', 'Stream comments', 'streamcomment', None)]),
|
||||
('Community', [('◎', 'Fan memberships', 'fanmembership', None), ('▧', 'Member content', 'memberpost', None), ('◈', 'Verified support', 'supportcredit', None), ('◉', 'Moderate comments', 'discussioncomment', None), ('★', 'Moderate chapter reviews', 'chapterreview', None), ('★', 'Moderate series reviews', 'seriesreview', None), ('◉', 'Stream comments', 'streamcomment', None)]),
|
||||
('Newsletter', [('✉', 'Campaigns', 'newslettercampaign', None), ('◎', 'Subscribers', 'newslettersubscriber', None)]),
|
||||
('Commerce', [
|
||||
('▤', 'Shop products', 'shop.product', None),
|
||||
('◈', 'Orders', 'shop.order', None),
|
||||
('◎', 'Subscriptions', 'shop.subscription', None),
|
||||
('▤', 'Book listings', 'booklisting', None),
|
||||
('▧', 'Legacy shop orders', 'shoporder', None),
|
||||
('◈', 'Chapter purchases', 'chapterpurchase', None),
|
||||
]),
|
||||
('Commerce', [('▤', 'Shop products', 'shop.product', None), ('◈', 'Orders', 'shop.order', None), ('◎', 'Subscriptions', 'shop.subscription', None), ('▤', 'Book listings', 'booklisting', None), ('▧', 'Legacy shop orders', 'shoporder', None), ('◈', 'Chapter purchases', 'chapterpurchase', None)]),
|
||||
('Studio', [('◈', 'Site settings', 'sitesettings', None), ('▧', 'Page backgrounds', 'pagebackground', None), ('✦', 'Floating artwork', 'floatingartwork', None), ('↗', 'Link previews', 'pagesharepreview', None)]),
|
||||
]
|
||||
groups = []
|
||||
@@ -216,6 +209,7 @@ class SettingsAdmin(admin.ModelAdmin):
|
||||
('Background', {'fields': ['hero_art', 'blur_hero']}),
|
||||
('Links', {'fields': ['publisher_url', 'shop_url']}),
|
||||
('Community tiers', {'fields': ['support_url', 'caster_threshold', 'striker_threshold', 'seat_threshold']}),
|
||||
('SLX Monthly', {'fields': ['membership_popup', 'member_scout_url', 'member_vault_url']}),
|
||||
('Author comments', {'fields': ['author_comment_name', 'author_comment_avatar', 'author_comment_signature']}),
|
||||
('Coming soon', {'fields': ['next_release_title', 'next_release_at', 'countdown_creator_note', 'countdown_art',
|
||||
'blur_countdown', 'show_chapter_countdowns']}),
|
||||
@@ -700,11 +694,23 @@ class StreamCommentAdmin(admin.ModelAdmin):
|
||||
@admin.register(FanMembership, site=studio)
|
||||
class FanMembershipAdmin(admin.ModelAdmin):
|
||||
autocomplete_fields = ['user']
|
||||
list_display = ['user', 'subscriber_until', 'sol_seat']
|
||||
list_display = ['user', 'member_tier', 'subscriber_until', 'sol_seat']
|
||||
list_filter = ['sol_seat']
|
||||
search_fields = ['user__username']
|
||||
|
||||
|
||||
class MemberArtworkInline(admin.TabularInline):
|
||||
model = MemberArtwork
|
||||
extra = 1
|
||||
|
||||
|
||||
@admin.register(MemberPost, site=studio)
|
||||
class MemberPostAdmin(admin.ModelAdmin):
|
||||
list_display = ['title', 'kind', 'required_tier', 'published', 'publish_at']
|
||||
list_filter = ['published', 'required_tier', 'kind']
|
||||
inlines = [MemberArtworkInline]
|
||||
|
||||
|
||||
@admin.register(SupportCredit, site=studio)
|
||||
class SupportCreditAdmin(admin.ModelAdmin):
|
||||
autocomplete_fields = ['user']
|
||||
|
||||
Reference in new issue
Block a user