7264ab0d0a
* Update torrent_file_missing.jet.html * Update en-us.all.json * Update CHANGELOG.md * Update main.css * Update upload.jet.html * Remove unused refine inputs from URL when doing a refine search * fix cookie warning not showing up
139 lignes
6,3 Kio
HTML
139 lignes
6,3 Kio
HTML
{{ extends "layouts/index_site" }}
|
|
{{ import "layouts/partials/helpers/csrf" }}
|
|
{{ import "layouts/partials/helpers/captcha" }}
|
|
{{ import "layouts/partials/helpers/flags" }}
|
|
{{ import "layouts/partials/helpers/rules" }}
|
|
{{ import "layouts/partials/helpers/tag_form" }}
|
|
{{block title()}}{{ T("upload")}}{{end}}
|
|
{{block content_body()}}
|
|
<div style="text-align: left;" class="box">
|
|
<p class="upload-rules">{{ T("read_rules")|raw }}</p>
|
|
<form enctype="multipart/form-data" method="POST">
|
|
{{ yield csrf_field() }}
|
|
|
|
<div class="upload-errors">
|
|
{{ yield errors(name="name")}}
|
|
{{ yield errors(name="torrent")}}
|
|
{{ yield errors(name="magnet")}}
|
|
{{ yield errors(name="c")}}
|
|
{{ yield errors(name="remake")}}
|
|
{{ yield errors(name="hidden")}}
|
|
{{ yield errors(name="website_link")}}
|
|
{{ yield errors(name="tags")}}
|
|
</div>
|
|
|
|
<table class="upload-form-table">
|
|
<tbody>
|
|
<tr>
|
|
<td class="table-input-label"><label for="name">{{ T("name")}}</label></td>
|
|
<td class="table-input"><input type="text" name="name" id="name" class="form-input up-input form-torrent-name" placeholder="{{ T("torrent_name")}}" value="{{Form.Name}}" autofocus></td>
|
|
</tr>
|
|
<tr class="table-torrent-link">
|
|
<td class="table-input-label"><label for="torrent">{{ T("torrent_file")}} / {{ T("magnet_link")}}</label></td>
|
|
<td class="table-input"><input type="file" name="torrent" id="torrent" class="up-input" accept=".torrent" {{ if Form.Magnet != "" }}disabled{{end}}/><input type="text" name="magnet" id="magnet" class="form-input up-input" placeholder="{{ T("magnet_link")}}" value="{{Form.Magnet}}"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-input-label"><label for="c">{{ T("category")}}</label></td>
|
|
<td class="table-input">
|
|
<select name="c" id="c" class="form-input up-input form-torrent-category" required>
|
|
<option value="">{{ T("select_a_torrent_category")}}</option>
|
|
{{ range _, cat := GetCategories(false, true) }}
|
|
<option value="{{ cat.ID }}" {{if Form.Category == cat.ID }}selected{{end}}>{{ T(cat.Name) }}</option>
|
|
{{ end }}
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-input-label">{{ T("torrent_language")}}</td>
|
|
<td class="table-input">
|
|
<div class="form-input language">
|
|
{{ yield flagList(languages=GetTorrentLanguages(), selected=Form.Languages, inputname="languages", id="upload-lang")}}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="table-checkboxes">
|
|
<td class="table-input-label"></td>
|
|
<td class="table-input" style="font-weight: normal;"><input type="checkbox" value="true" name="remake" id="remake" class="form-torrent-remake"/><label for="remake">{{ T("mark_as_remake")}}</label> <input type="checkbox" value="true" name="hidden" id="hidden" class="form-torrent-hidden {{ if User.ID == 0 }}hidden{{end}}" {{ if User.ID == 0 }}disabled checked{{end}}><label for="hidden" {{ if User.ID == 0 }}class="hidden"{{end}}>{{ T("upload_as_anon")}}</label></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-input-label"><label for="website_link">{{ T("website_link")}}</label></td>
|
|
<td class="table-input"><input name="website_link" id="website_link" placeholder="http://" class="form-input up-input" type="text" value="{{Form.WebsiteLink}}"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-input-label"><label for="desc">{{ T("torrent_description")}}</label></td>
|
|
<td class="table-input"><textarea name="desc" id="desc" class="form-input up-input" style="height: 10rem;">{{Form.Description}}</textarea></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="table-input-label">{{ T("torrent_tags")}}:</td>
|
|
<td class="table-input">
|
|
|
|
<table class="upload-tag-table">
|
|
<tbody>
|
|
<tr>
|
|
{{ range _, tag := Config.Torrents.Tags.Types}}
|
|
<td>
|
|
{{ yield tagForm(tagType=tag, acceptedTag=Form.Tags.Get(tag.Name)) }}
|
|
{{ if _ % 3 == 1 && _ == len(Config.Torrents.Tags.Types) - 1}}
|
|
</td>
|
|
<td>
|
|
<div class="form-group">
|
|
<label class="input-label" for="tag_{{Config.Torrents.Tags.Default}}">{{ T("tagtype_tags") }}</label>
|
|
<input type="text" name="tag_{{Config.Torrents.Tags.Default}}" class="form-input" id="tag_{{Config.Torrents.Tags.Default}}" value="{{ Form.Tags.Get(Config.Torrents.Tags.Default).Tag }}" />
|
|
</div>
|
|
</td>
|
|
{{ else }}
|
|
{{ if _ % 3 == 2}}
|
|
</td></tr><tr>
|
|
{{else}}
|
|
</td>
|
|
{{end}}
|
|
{{end}}
|
|
{{ if _ % 3 != 1 && _ == len(Config.Torrents.Tags.Types) - 1}}
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="form-group">
|
|
<label class="input-label" for="tag_{{Config.Torrents.Tags.Default}}">{{ T("tagtype_tags") }}</label>
|
|
<input type="text" name="tag_{{Config.Torrents.Tags.Default}}" class="form-input" id="tag_{{Config.Torrents.Tags.Default}}" value="{{ Form.Tags.Get(Config.Torrents.Tags.Default).Tag }}" />
|
|
</div>
|
|
</td>
|
|
{{end}}
|
|
{{ end }}
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div style="width: 240px">
|
|
{{yield captcha(captchaid=Form.CaptchaID)}}
|
|
</div>
|
|
{{ yield errors(name="captchaID")}}
|
|
<button type="submit" class="form-input up-btn" id="upload-button">{{ T("upload")}}</button>
|
|
</form>
|
|
</div>
|
|
{{end}}
|
|
{{ block footer_js()}}
|
|
<script type="text/javascript" src="/js/translation.js?v={{ Config.Version}}{{ Config.Build }}"></script>
|
|
<script type="text/javascript" src="/js/template.js?v={{ Config.Version}}{{ Config.Build }}"></script>
|
|
<script type="text/javascript" src="/js/simplemde.min.js?v={{ Config.Version}}{{ Config.Build }}"></script>
|
|
{{ include "layouts/partials/torrent_item_upload" }}
|
|
<script type="text/javascript">
|
|
document.querySelector("input[name='magnet']").addEventListener("keyup", (e) => {
|
|
var torrentInput = document.querySelector("input[name='torrent']")
|
|
torrentInput.disabled = e.target.value != ""
|
|
if (e.target.value == "") torrentInput.previousElementSibling.classList.remove("hidden")
|
|
else torrentInput.previousElementSibling.classList.add("hidden")
|
|
try{
|
|
torrentInput.value = '';
|
|
if (torrentInput.value) {
|
|
torrentInput.type = "text";
|
|
torrentInput.type = "file";
|
|
}
|
|
}catch(e){}
|
|
})
|
|
</script>
|
|
<script type="text/javascript">new SimpleMDE({ element: document.getElementById("desc"), spellChecker: false, showIcons: [ "strikethrough", "code", "table", "horizontal-rule" ] });</script>
|
|
{{end}}
|