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 b0ff05a..a4bca4e 100644 --- a/Show/templates/episode.html +++ b/Show/templates/episode.html @@ -60,7 +60,11 @@
{% if sbm.pinned %}{% endif %} -  {{sbm.url}} + {% if sbm.title %} + {{sbm.title}} + {% else %} +  {{sbm.url}} + {% endif %}
diff --git a/Show/views.py b/Show/views.py index 531fef8..04f4c78 100644 --- a/Show/views.py +++ b/Show/views.py @@ -145,7 +145,7 @@ def SubmissionModForm(req, abbr, submission): episode = submission.episode user = req.user - form = forms.SubmissionForm(instance=submission) + form = forms.SubmissionFormAdmin(instance=submission) # Request context ctx = { @@ -164,7 +164,7 @@ def SubmissionModForm(req, abbr, submission): submission.delete() return HttpResponseRedirect('/show/%s/create_ban?user=%s'%(abbr,submission.user.username)) - form = forms.SubmissionForm(req.POST, instance=submission) + form = forms.SubmissionFormAdmin(req.POST, instance=submission) ctx['form'] = form if form.is_valid():