{% extends "layout.html" %} {% block title %}Edit {{ torrent.display_name }} :: {{ config.SITE_NAME }}{% endblock %} {% block body %} {% from "_formhelpers.html" import render_field %} {% from "_formhelpers.html" import render_markdown_editor %} {% set torrent_url = url_for('torrents.view', torrent_id=torrent.id) %}

Edit Torrent #{{torrent.id}} {% if (torrent.user != None) and (torrent.user != g.user) %} (by {{ torrent.user.username }}) {% endif %}

{{ form.csrf_token }}
{{ render_field(form.display_name, class_='form-control', placeholder='Display name') }}
{{ render_field(form.category, class_='form-control')}}
{{ render_field(form.information, class_='form-control', placeholder='Your website or IRC channel') }}

{# Only allow changing anonymous status when an uploader exists #} {% if torrent.uploader_id %} {% endif %}
{% if g.user.is_trusted %} {% endif %}
{{ render_markdown_editor(form.description, field_name='description') }}

Danger Zone

{{ delete_form.csrf_token }} {% if not torrent.deleted %}

Delete torrent. {{ delete_form.delete(class="btn btn-danger pull-right") }}

Deleted torrents are retained for backup purposes.
You (or someone else) will be able to reupload the torrent.

{% if g.user.is_moderator %}

Delete and ban torrent. {{ delete_form.ban(class="btn btn-danger pull-right") }}

Soft deletes the torrent and disallows reuploading it.

{% endif %} {% else %}

This torrent is deleted{% if torrent.banned %} and banned{% endif %}.

Undelete{% if torrent.banned %} and unban{% endif %} torrent. {% if torrent.banned %} {{ delete_form.undelete(value="Undelete & Unban", class="btn btn-info pull-right") }} {% else %} {{ delete_form.undelete(class="btn btn-info pull-right") }} {% endif %}

Undeletes{% if torrent.banned %} and unbans{% endif %} this torrent.

{% if torrent.banned %}

Unban torrent. {{ delete_form.unban(class="btn btn-info pull-right") }}

Unbans torrent without undeleting it.
Allows reuploading this torrent again.

{% else%}

Ban torrent. {{ delete_form.ban(value="Ban", class="btn btn-danger pull-right") }}

Bans the torrent.
Disallows reuploading this torrent.

{% endif %} {% endif %}
{% endblock %}