{{define "title"}}{{ call $.T "torrent_reassign" }}{{end}}
{{define "content"}}
<div class="results box form-box">
    <h1>{{ call $.T "torrent_reassign" }}</h1>
    <form enctype="multipart/form-data" method="POST">
    {{ block "csrf_field" $ }}{{end}}
    {{ range (index $.FormInfos "infos")}}
        <p class="success-text"> {{ . }}</p>
    {{end}}
    {{ range (index $.FormErrors "errors")}}
        <p class="error-text">{{ . }}</p>
    {{end}}
    <p>{{ call $.T "reassign_warning" }}</p>

    {{with .Form}}
    <div class="form-group">
        <label for="to">{{ call $.T "reassign_to" }}</label>
        <input class="form-input" type="text" name="to" class="form-control" placeholder="{{ call $.T "user_id" }}" {{if ne .AssignTo 0}}value="{{.AssignTo}}"{{end}} required>
    </div>
    <div class="form-group">
	    <label for="by">{{ call $.T "reassign_based_on" }}</label><br />
        <input type="radio" name="by" value="olduser" {{if eq .By "olduser"}}checked{{end}} required> {{ call $.T "previous_username" }}<br />
        <input type="radio" name="by" value="torrentid" {{if eq .By "torrentid"}}checked{{end}} required> {{ call $.T "torrent_id" }}
    </div>

    <div class="form-group">
        <p>{{call $.T "reassign_indication"}}</p>
        <textarea rows="20" cols="40" name="data">{{.Data}}</textarea>
    </div>
    {{end}}

    <p>{{ call $.T "reassign_warning_2" }}</p>
    <button type="submit" class="form-input btn-green">{{call $.T "save_changes"}}</button>
</form>
</div>
{{end}}
