2017-06-02 20:10:36 +02:00
{{define "title"}}{{ call $.T "torrents_list" }}{{end}}
2017-05-10 06:43:53 +02:00
{{define "content"}}
2017-06-02 20:10:36 +02:00
< div class = "results box" >
< h1 > {{ call $.T "torrents_list" }}< / h1 >
< form method = "post" action = "" >
2017-05-29 17:07:18 +02:00
{{ block "csrf_field" $ }}{{end}}
2017-05-20 13:45:15 +02:00
{{ range (index $.Infos "infos")}}
2017-06-02 20:10:36 +02:00
< p class = "success-text" > {{ . }}< / p >
2017-05-20 13:45:15 +02:00
{{end}}
{{ range (index $.Errors "errors")}}
2017-06-02 20:10:36 +02:00
< p class = "error-text" > {{ . }}< / p >
2017-05-20 13:45:15 +02:00
{{end}}
2017-06-02 20:10:36 +02:00
< div class = "toolbar" >
< select class = "cb_action" name = "action" >
< option value = "" > {{ call $.T "action_select" }}< / option >
< option value = "status" > {{ call $.T "change_status" }}< / option >
< option value = "delete" > {{ call $.T "delete" }}< / option >
2017-05-20 13:45:15 +02:00
< / select >
2017-06-02 20:10:36 +02:00
< select class = "cb_action" style = "display: none;" name = "status" >
< option value = "" > {{ call $.T "to_status" }}< / option >
2017-05-25 02:19:05 +02:00
< option value = "5" > {{call $.T "torrent_status_blocked"}}< / option >
2017-05-21 00:38:28 +02:00
< option value = "1" > {{call $.T "torrent_status_normal"}}< / option >
< option value = "2" > {{call $.T "torrent_status_remake"}}< / option >
< option value = "3" > {{call $.T "trusted"}}< / option >
2017-05-20 13:45:15 +02:00
< option value = "4" > A+< / option >
< / select >
2017-06-02 20:10:36 +02:00
< input type = "submit" class = "form-input" value = "Apply" >
< input type = "reset" class = "form-input" value = "Reset" >
< div class = "float-right" >
< a href = "{{genRoute " mod_tlist " } } " class = "form-input" > {{ call $.T "torrents_not_deleted" }}< / a >
< a href = "{{genRoute " mod_tlist_deleted " } } " class = "form-input" > {{ call $.T "torrents_deleted" }}< / a >
2017-05-20 13:45:15 +02:00
< / div >
2017-06-02 20:10:36 +02:00
< / div >
< table class = "table" >
< thead class = "torrent-info" >
< tr >
< th class = "tr-cb" > < input type = "checkbox" name = "checkall" data-selectall = "checkbox" > < / th >
< th class = "tr-name" > {{ call $.T "name" }}< / th >
< th class = "tr-size" > {{ call $.T "uploaded_by" }}< / th >
< th class = "tr-actions" > {{ call $.T "actions" }}< / th >
< / tr >
< / thead >
< tbody >
2017-05-25 21:54:58 +02:00
{{ range .Models}}
2017-05-20 13:45:15 +02:00
< tr >
2017-06-02 20:22:15 +02:00
< td class = "tr-cb" > < input type = "checkbox" class = "selectable" name = "torrent_id" value = "{{.ID }}" > < / td >
2017-06-02 20:24:44 +02:00
< td class = "tr-name" > < a href = "{{ genViewTorrentRoute .ID }}" > {{ .Name }}< / a > {{ if not .IsDeleted }}< a href = "{{ genRoute " mod_tedit " } } ? id = {{.ID}}" class = "form-input float-right" > {{ call $.T "edit"}}< / a > {{end}}< / td >
2017-06-02 20:10:36 +02:00
< td class = "tr-size home-td" > {{ if .Uploader }}< a href = "{{ if .IsDeleted }}{{ genRoute " mod_tlist_deleted " } } { { else } } { { genRoute " mod_tlist " } } { { end } } ? userID = {{.UploaderID}}" > {{ .Uploader.Username }}< / a > {{ else }}れんちょん{{end}}< / td >
< td class = "tr-actions home-td" >
< a href = "{{ genRoute " mod_tblock " } } ? id = {{ . ID } } " class = "form-input" onclick = "if (!confirm('{{ call $.T " are_you_sure " } } ' ) ) return false ; " > {{ if .IsBlocked }}{{ call $.T "torrent_unblock" }}{{else}}{{ call $.T "torrent_block" }}{{end}}< / a >
2017-05-25 02:19:05 +02:00
{{ if .IsDeleted }}
2017-06-02 20:10:36 +02:00
< br > < a href = "{{ genRoute " mod_tdelete " } } ? definitely & id = {{ . ID } } " class = "form-input" onclick = "if (!confirm('{{ call $.T " are_you_sure " } } { { call $ . T " delete_definitely_torrent_warning " } } ' ) ) return false ; " > < i class = "trash-icon" > < / i > {{ call $.T "delete_definitely" }}< / a >
2017-05-25 02:19:05 +02:00
{{ else }}
2017-06-02 20:10:36 +02:00
< a href = "{{ genRoute " mod_tdelete " } } ? id = {{ . ID } } " class = "form-input" onclick = "if (!confirm('{{ call $.T " are_you_sure " } } ' ) ) return false ; " > < i class = "trash-icon" > < / i > {{ call $.T "delete" }}< / a >
2017-05-25 02:19:05 +02:00
{{ end }}
< / td >
2017-05-20 13:45:15 +02:00
< / tr >
{{end}}
2017-06-02 20:10:36 +02:00
< / tbody >
< / table >
2017-05-20 13:45:15 +02:00
< / form >
2017-05-10 23:42:14 +02:00
< / div >
2017-05-10 07:47:01 +02:00
{{end}}
2017-06-02 20:10:36 +02:00
{{ define "footer_js"}}
2017-05-20 13:45:15 +02:00
<!-- JS Function for selecting multiple checkboxes -->
< script type = "text/javascript" src = "{{ .URL.Parse " / js / selectAll . js " } } " > < / script >
< script type = "text/javascript" >
2017-06-02 20:10:36 +02:00
document.addEventListener("DOMContentLoaded", function() {
document.querySelector("select[name='action']").addEventListener("change", function(e) {
var el = e.target;
if (el.value == "status")
document.querySelector("select[name='status']").style.display = "inline"
else
document.querySelector("select[name='status']").style.display = "none"
console.log(el.value);
});
});
2017-05-20 13:45:15 +02:00
< / script >
2017-05-21 00:38:28 +02:00
{{end}}