Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Update view.jet.html

Cette révision appartient à :
kilo 2017-11-07 18:33:59 +01:00 révisé par GitHub
Parent a740a236bc
révision 68da680e47
Aucune clé n'a été trouvée pour cette signature dans la base de données
ID de la clé GPG: 4AEE18F83AFDEB23

Voir le fichier

@ -190,8 +190,6 @@
<input type="checkbox" id="show-filelist" {{if len(Torrent.FileList) < 4 && len(Torrent.FileList) > 0}}checked{{end}}/>
<label class="torrent-hr filelist-control{{if len(Torrent.FileList) == 0}} hidden{{end}}" for="show-filelist">{{ T("files")}}</label>
<div class="torrent-info-box{{if len(Torrent.FileList) == 0}} hidden{{end}}" id="filelist">
{{ if len(Torrent.FileList) > 0 }}
{* how do i concat lol *}
<table class="table-filelist">
<thead>
<tr>
@ -200,12 +198,13 @@
</tr>
</thead>
<tbody>
{{ yield make_treeview(treeviewData=makeTreeViewData(RootFolder, 0, "root")) }}
{{ if len(Torrent.FileList) > 0 }}
{{ yield make_treeview(treeviewData=makeTreeViewData(RootFolder, 0, "root")) }}
{{else}}
<tr class="tr-filelist"><td colspan="2">{{ T("no_files") }}</td></tr>
{{end}}
</tbody>
</table>
{{ else }}
<p>{{ T("no_files") }}</p>
{{ end }}
</div>
<p class="torrent-hr" id="comments">{{ T("comments")}}</p>
@ -336,9 +335,30 @@ Modal.Init({
// order of apparition of the modals
button: ["#reportPopup", "#tagPopup"]
});
</script>
var FileListContainer = document.querySelector("#filelist tbody"),
FileListLabel = document.getElementsByClassName("filelist-control")[0]
if(FileListLabel.className.includes("hidden")) {
FileListLabel.addEventListener("click", function (e) {
FileListContainer.innerHTML = "<tr class='tr-filelist'><td>{{T("loading_file_list")}}</td></tr>"
Query.Get('/stats/{{Torrent.ID}}?files', function (data) {
if(data.filelist != null) {
FileListContainer.innerHTML = ""
FileListLabel.style.opacity = 1
document.getElementById("filelist").style.opacity = 1
for(var i = 0; i < data.filelist.length; i++) {
var file = data.filelist[i]
if(file.filesize == "0.0 B") file.filesize = "{{T("unknown")}}"
FileListContainer.innerHTML = FileListContainer.innerHTML + '<tr class="tr-filelist '+ file.class +'"><td>'+ file.path +'</td><td>'+ file.filesize +'</td></tr>'
}
}
})
})
}
{{ if !torrentFileExists(Torrent.Hash, Torrent.TorrentLink)}}
<script type="text/javascript">
var torrentLink = document.getElementById("torrent-download-link"),
oldDownloadHtml = torrentLink.innerHTML,
downloadIconHtml = torrentLink.innerHTML.substring(0, torrentLink.innerHTML.indexOf("</div>") + 6),
@ -378,10 +398,8 @@ Modal.Init({
}
});
}
</script>
{{end}}
{{if Torrent.StatsObsolete[1] }}
<script type="text/javascript">
var seeders = document.querySelector(".tr-se"),
leechers = document.querySelector(".tr-le"),
downloads = document.querySelector(".tr-dl"),
@ -408,9 +426,8 @@ Modal.Init({
}
})
</script>
{{end}}
</script>
{{ if User.ID > 0 }}
<script type="text/javascript" src="{{ URL.Parse("/js/template.js") }}"></script>
<script type="text/javascript" src="{{ URL.Parse("/js/modal.js") }}"></script>