Commit fdd43208 authored by Evert Prants's avatar Evert Prants

Allow show submission page titles to be displayed instead of the url, if available

parent 1883792c
......@@ -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
......
......@@ -60,7 +60,11 @@
<div class="submission{% if sbm.positives < sbm.negatives %} buried{% endif %}{% if sbm.pinned %} pinned{% endif %}">
<a href="{{sbm.url}}" class="link">
{% if sbm.pinned %}<i class="fa fa-fw fa-thumb-tack" title="Pinned submission"></i>{% endif %}
<i class="fa fa-fw fa-globe"></i>&nbsp;{{sbm.url}}
{% if sbm.title %}
<span class="urld" title="Web URL: {{sbm.url}}">{{sbm.title}}</span>
{% else %}
<i class="fa fa-fw fa-globe"></i>&nbsp;{{sbm.url}}
{% endif %}
</a>
<div class="vote-btns" data-vote-id="{{sbm.id}}">
<form method="POST" action="/show/{{show.abbr}}/vote/{{sbm.id}}/1">
......
......@@ -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():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment