Allow show submission page titles to be displayed instead of the url, if available
This commit is contained in:
parent
1883792c7f
commit
fdd43208ea
@ -26,6 +26,11 @@ class SubmissionForm(forms.ModelForm):
|
|||||||
'tags': 'Describe your link. Comma-separated list of keywords'
|
'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 SeasonForm(forms.ModelForm):
|
||||||
class Meta():
|
class Meta():
|
||||||
model = Season
|
model = Season
|
||||||
|
@ -60,7 +60,11 @@
|
|||||||
<div class="submission{% if sbm.positives < sbm.negatives %} buried{% endif %}{% if sbm.pinned %} pinned{% endif %}">
|
<div class="submission{% if sbm.positives < sbm.negatives %} buried{% endif %}{% if sbm.pinned %} pinned{% endif %}">
|
||||||
<a href="{{sbm.url}}" class="link">
|
<a href="{{sbm.url}}" class="link">
|
||||||
{% if sbm.pinned %}<i class="fa fa-fw fa-thumb-tack" title="Pinned submission"></i>{% endif %}
|
{% if sbm.pinned %}<i class="fa fa-fw fa-thumb-tack" title="Pinned submission"></i>{% endif %}
|
||||||
<i class="fa fa-fw fa-globe"></i> {{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> {{sbm.url}}
|
||||||
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
<div class="vote-btns" data-vote-id="{{sbm.id}}">
|
<div class="vote-btns" data-vote-id="{{sbm.id}}">
|
||||||
<form method="POST" action="/show/{{show.abbr}}/vote/{{sbm.id}}/1">
|
<form method="POST" action="/show/{{show.abbr}}/vote/{{sbm.id}}/1">
|
||||||
|
@ -145,7 +145,7 @@ def SubmissionModForm(req, abbr, submission):
|
|||||||
episode = submission.episode
|
episode = submission.episode
|
||||||
user = req.user
|
user = req.user
|
||||||
|
|
||||||
form = forms.SubmissionForm(instance=submission)
|
form = forms.SubmissionFormAdmin(instance=submission)
|
||||||
|
|
||||||
# Request context
|
# Request context
|
||||||
ctx = {
|
ctx = {
|
||||||
@ -164,7 +164,7 @@ def SubmissionModForm(req, abbr, submission):
|
|||||||
submission.delete()
|
submission.delete()
|
||||||
return HttpResponseRedirect('/show/%s/create_ban?user=%s'%(abbr,submission.user.username))
|
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
|
ctx['form'] = form
|
||||||
|
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
|
Reference in New Issue
Block a user