2017-06-06 00:07:30 +02:00
{{define "title"}}{{call $.T "upload"}}{{end}}
2017-05-06 10:36:37 +02:00
{{define "content"}}
2017-05-25 21:54:58 +02:00
{{with .Form}}
2017-05-25 14:29:39 +02:00
< div style = "text-align: left;" class = "box" >
< form enctype = "multipart/form-data" role = "upload" method = "POST" >
2017-05-29 17:07:18 +02:00
{{ block "csrf_field" $ }}{{end}}
2017-05-25 14:29:39 +02:00
{{ range (index $.FormErrors "errors")}}
2017-06-02 04:50:56 +02:00
< p class = "error-text" > {{ . }}< / p >
2017-05-25 14:29:39 +02:00
{{end}}
< h3 > {{call $.T "name"}}< / h3 >
2017-05-28 00:45:28 +02:00
< input type = "text" name = "name" id = "name" class = "form-input up-input" placeholder = "{{call $.T " file_name " } } " value = "{{.Name}}" autofocus >
2017-05-25 14:29:39 +02:00
< h3 > {{call $.T "torrent_file"}}< / h3 >
< input type = "file" name = "torrent" id = "torrent" class = "up-input" accept = ".torrent" >
< p > {{call $.T "uploading_file_prefills_fields"}}< / p >
< h3 > {{call $.T "magnet_link"}}< / h3 >
< input type = "text" name = "magnet" id = "magnet" class = "form-input up-input" placeholder = "{{call $.T " magnet_link " } } " value = "{{.Magnet}}" >
< p > {{ call $.T "please_include_our_tracker" }}< / p >
< h3 > {{call $.T "category"}}< / h3 >
< select name = "c" id = "c" class = "form-input up-input" required >
< option value = "" > {{call $.T "select_a_torrent_category"}}< / option >
{{ range $name_cat, $id_cat := (GetCategories false) }}
2017-05-25 21:54:58 +02:00
< option value = "{{ $id_cat }}" { { if eq $ . Form . Category $ id_cat } } selected { { end } } > {{call $.T $name_cat }}< / option >
2017-05-25 14:29:39 +02:00
{{ end }}
< / select >
< p >
< input type = "checkbox" name = "remake" id = "remake" >
< label for = "remake" > {{call $.T "mark_as_remake"}}< / label >
< / p >
2017-05-29 13:23:47 +02:00
{{ if gt $.User.ID 0 }}
2017-05-27 20:33:40 +02:00
< p >
< input type = "checkbox" name = "hidden" id = "hidden" >
< label for = "hidden" > {{call $.T "mark_as_hidden"}}< / label >
< / p >
{{ end }}
2017-05-25 14:29:39 +02:00
< h3 > {{call $.T "website_link"}}< / h3 >
< input name = "website_link" id = "website_link" class = "form-input up-input" type = "text" value = "{{.WebsiteLink}}" >
< h3 > {{call $.T "torrent_description"}}< / h3 >
< p > {{call $.T "description_markdown_notice"}}< / p >
< textarea name = "desc" id = "desc" class = "form-input up-input" style = "height: 10rem;" > {{.Description}}< / textarea >
{{block "captcha" (makeCaptchaData .CaptchaID $.T)}}{{end}}
< button type = "submit" class = "form-input up-btn" > {{call $.T "upload"}}< / button >
< / form >
< / div >
{{end}}
2017-05-07 13:38:46 +02:00
{{end}}
2017-05-26 16:12:52 +02:00
{{ define "footer_js"}}
< script type = "text/javascript" src = "https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js" > < / script >
2017-06-06 00:07:30 +02:00
< script type = "text/javascript" > new SimpleMDE ( { element : document . getElementById ( "desc" ) , spellChecker : false , showIcons : [ "strikethrough" , "code" , "table" , "horizontal-rule" ] } ) ; < / script >
2017-05-26 16:12:52 +02:00
{{end}}