minor comic view fix
This commit is contained in:
parent
dc3925eb73
commit
eb0370cf60
2
app.py
2
app.py
@ -862,7 +862,7 @@ def logout():
|
||||
@login_required
|
||||
def delete(content_type, content_id):
|
||||
if content_type == 'art':
|
||||
content = Art.query.get_or_404(content_id)
|
||||
content = Image.query.get_or_404(content_id)
|
||||
file_path = os.path.join(app.config['UPLOAD_FOLDER']['arts'], content.image_file)
|
||||
elif content_type == 'video':
|
||||
content = Video.query.get_or_404(content_id)
|
||||
|
@ -51,18 +51,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="vote-section">
|
||||
<p>Votes: {{ content.cookie_votes }} 🍪</p>
|
||||
{% if current_user.is_authenticated %}
|
||||
<form action="{{ url_for('vote_' + content_type, **{'image_id' if content_type == 'art' else 'video_id' if content_type == 'video' else 'comic_id': content.id}) }}" method="POST">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="button">Vote</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>You need to <a href="{{ url_for('login') }}">log in</a> to vote.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if current_user.is_authenticated and current_user.username == content.username %}
|
||||
<form method="POST" action="{{ url_for('delete', content_type=content_type, content_id=content.id) }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
|
Loading…
x
Reference in New Issue
Block a user