2017-05-06 11:36:37 +03:00
{{define "title"}}Upload magnet{{end}}
{{define "content"}}
< div class = "blockBody" >
{{with .Upload}}
< hr >
2017-05-06 18:32:26 -07:00
< form enctype = "multipart/form-data" role = "upload" method = "POST" >
2017-05-20 17:01:13 +02:00
{{ range (index $.FormErrors "errors")}}
< div class = "alert alert-danger" > < a class = "panel-close close" data-dismiss = "alert" > × < / a > < i class = "glyphicon glyphicon-exclamation-sign" > < / i > {{ . }}< / div >
{{end}}
2017-05-06 17:47:30 +10:00
< div class = "form-group" >
2017-05-20 19:38:28 -03:00
< label for = "name" > {{call $.T "name"}}< / label >
< input type = "text" name = "name" id = "name" class = "form-control" placeholder = "{{call $.T " file_name " } } " value = "{{.Name}}" autofocus required >
2017-05-06 17:47:30 +10:00
< / div >
< div class = "form-group" >
2017-05-20 19:38:28 -03:00
< label for = "torrent" > {{call $.T "torrent_file"}}< / label >
2017-05-07 13:38:46 +02:00
< input type = "file" name = "torrent" id = "torrent" accept = ".torrent" >
2017-05-20 19:38:28 -03:00
< p class = "help-block" > {{call $.T "uploading_file_prefills_fields"}}< / p >
2017-05-06 17:47:30 +10:00
< / div >
< div class = "form-group" >
2017-05-20 19:38:28 -03:00
< label for = "magnet" > {{call $.T "magnet_link"}}< / label >
2017-05-13 15:08:14 +02:00
< input type = "text" name = "magnet" id = "magnet" class = "form-control"
2017-05-20 19:38:28 -03:00
style="width:60rem" placeholder="{{call $.T "magnet_link"}}" value="{{.Magnet}}">
2017-05-06 17:47:30 +10:00
< / div >
< div class = "form-group" >
2017-05-20 19:38:28 -03:00
< label for = "c" > {{call $.T "category"}}< / label >
2017-05-23 01:26:09 +02:00
< select name = "c" class = "form-control input-sm" >
2017-05-20 19:38:28 -03:00
< option value = "" > {{call $.T "select_a_torrent_category"}}< / option >
2017-05-23 01:26:09 +02:00
{{ range $name_cat, $id_cat := (GetCategories false) }}
< option value = "{{ $id_cat }}" { { if eq $ . Upload . Category $ id_cat } } selected { { end } } > {{call $.T $name_cat }}< / option >
2017-05-15 19:08:17 +10:00
{{ end }}
2017-05-06 17:47:30 +10:00
< / select >
2017-05-20 19:38:28 -03:00
< p class = "help-block" > {{ call $.T "please_include_our_tracker" }}< / p >
2017-05-10 22:03:14 +02:00
< / div >
< div class = "form-group" >
2017-05-13 15:08:14 +02:00
< input type = "checkbox" name = "remake" id = "remake" >
2017-05-20 19:38:28 -03:00
< label for = "remake" > {{call $.T "mark_as_remake"}}< / label >
2017-05-06 17:47:30 +10:00
< / div >
2017-05-20 21:10:59 -05:00
< div class = "form-group" >
< label for = "website_link" > {{call $.T "website_link"}}< / label >
< input name = "website_link" id = "website_link" class = "form-control" type = "text" value = "{{.WebsiteLink}}" >
< / div >
2017-05-06 17:47:30 +10:00
< div class = "form-group" >
2017-05-20 19:38:28 -03:00
< label for = "desc" > {{call $.T "torrent_description"}}< / label >
< p class = "help-block" > {{call $.T "description_markdown_notice"}}< / p >
2017-05-20 17:01:13 +02:00
< textarea name = "desc" id = "desc" class = "form-control torrent-desc" rows = "15" > {{.Description}}< / textarea >
< / div >
2017-05-07 11:25:09 +03:00
2017-05-20 23:10:31 -03:00
{{block "captcha" (makeCaptchaData .CaptchaID $.T)}}{{end}}
2017-05-07 11:25:09 +03:00
2017-05-20 19:38:28 -03:00
< button type = "submit" class = "btn btn-success" > {{call $.T "upload"}}< / button >
2017-05-06 17:47:30 +10:00
< br / >
< br / >
< / form >
{{end}}
2017-05-06 11:36:37 +03:00
< / div >
2017-05-07 13:38:46 +02:00
{{end}}
{{define "js_footer"}}
< script type = "text/javascript" charset = "utf-8" src = "{{.URL.Parse " / js / uploadPage . js " } } " > < / script >
2017-05-17 05:26:28 -05:00
< script type = "text/javascript" charset = "utf-8" src = "https://cdnjs.cloudflare.com/ajax/libs/markdown.js/0.5.0/markdown.min.js" > < / script >
< script type = "text/javascript" charset = "utf-8" src = "https://cdnjs.cloudflare.com/ajax/libs/to-markdown/3.0.4/to-markdown.js" > < / script >
< script type = "text/javascript" charset = "utf-8" src = "https://cdnjs.cloudflare.com/ajax/libs/bootstrap-markdown/2.10.0/js/bootstrap-markdown.js" > < / script >
< script >
$(".torrent-desc").markdown({resize: "both"})
< / script >
2017-05-07 13:38:46 +02:00
{{end}}