diff --git a/LandingPage/admin.py b/LandingPage/admin.py index f1f84e1..62c1348 100644 --- a/LandingPage/admin.py +++ b/LandingPage/admin.py @@ -35,7 +35,6 @@ class ShowAdmin(GuardedModelAdmin): admin.site.register(Show, ShowAdmin) admin.site.register(User, SpecialUserAdmin) admin.site.register(Ban) -admin.site.register(ShowModerator) admin.site.register(Report) admin.site.register(ShowSubmission) admin.site.register(Season) diff --git a/LandingPage/models.py b/LandingPage/models.py index 6ae93f8..8a434a4 100644 --- a/LandingPage/models.py +++ b/LandingPage/models.py @@ -46,7 +46,7 @@ class Show(TimestampedModel): verbose_name="Full Name" ) abbr = models.SlugField( - max_length=5, + max_length=16, unique=True, help_text="A short abbreviation of the show, for use in urls", verbose_name="Abbreviation" @@ -76,6 +76,8 @@ class Show(TimestampedModel): css = models.FileField( storage=show_static_storage, upload_to=name_css, + null=True, + blank=True, help_text="The CSS stylesheet applied to this show's page", verbose_name="Custom Style" ) @@ -160,32 +162,6 @@ class Ban(TimestampedModel): def __str__(self): return ("Permanent" if self.permanent else "Temporary") + " ban of %s"%self.user -class ShowModerator(TimestampedModel): - show = models.ForeignKey( - Show, - on_delete=models.CASCADE, - help_text='The show this user moderates', - verbose_name='Moderated Show', - related_name='moderators', - ) - user = models.ForeignKey( - User, - on_delete=models.CASCADE, - help_text='The user who moderates this show', - verbose_name='Moderator', - related_name='moderated_shows' - ) - appointed_by = models.ForeignKey( - User, - on_delete=models.SET_NULL, - related_name='appointed_mods', - null=True, - help_text='The user who appointed this moderator', - verbose_name='Appointed by' - ) - def __str__(self): - return "%s on %s"%(self.user,self.show.abbr) - class Report(TimestampedModel): reporter = models.ForeignKey( User, @@ -249,7 +225,8 @@ class Season(models.Model): help_text='The number of this season, starting at 1; For example, the first season to be aired would be number 1, and the second would be number 2' ) description = models.TextField( - help_text='A description of this season\'s happenings' + help_text='A description of this season\'s happenings', + blank=True ) artwork = models.ImageField( storage=show_static_storage, @@ -311,6 +288,19 @@ class Submission(TimestampedModel): url = models.URLField( help_text='The link that was submitted', ) + title = models.TextField( + help_text='Title of the page', + blank=True + ) + embed = models.URLField( + help_text='Embed player link for this episode', + blank=True, + verbose_name='Embed URL' + ) + pinned = models.BooleanField( + help_text='Whether or not this submission is pinned', + default=False + ) tags = models.CharField( help_text='Tags applied to this link submission', max_length=200 @@ -383,6 +373,14 @@ class DiscussionBoard(TimestampedModel): help_text='The body of the post', verbose_name='Body' ) + views = models.IntegerField( + help_text='The amount of times this board has been viewed', + default=0 + ) + pinned = models.BooleanField( + help_text='Whether or not this board is pinned', + default=False + ) def __str__(self): return '[%s] "%s" by %s'%(self.show.abbr, self.title, self.user) diff --git a/Show/forms.py b/Show/forms.py index 37b907e..d809f21 100644 --- a/Show/forms.py +++ b/Show/forms.py @@ -26,6 +26,11 @@ class SubmissionForm(forms.ModelForm): 'tags': 'Describe your link. Comma-separated list of keywords' } +class SubmissionFormAdmin(forms.ModelForm): + class Meta(): + model = Submission + fields = ('title','url','embed','tags','pinned',) + class SeasonForm(forms.ModelForm): class Meta(): model = Season diff --git a/Show/templates/episode.html b/Show/templates/episode.html index 92eed67..a4bca4e 100644 --- a/Show/templates/episode.html +++ b/Show/templates/episode.html @@ -34,7 +34,11 @@
- {{ episode.season.description }} + {% if episode.season.description %} + {{ episode.season.description }} + {% else %} + {{ show.description }} + {% endif %}
@@ -53,8 +57,15 @@{{episode.name}}From
- {{ episode.season.description }} + {% if episode.season.description %} + {{ episode.season.description }} + {% else %} + {{ show.description }} + {% endif %}