54c03c7ed7
Might make things easier when dealing with mobile view and such.
113 lignes
6,5 Kio
HTML
113 lignes
6,5 Kio
HTML
{{define "title"}}{{.Torrent.Name}}{{end}}
|
||
{{define "contclass"}}cont-view {{if eq .Torrent.Status 2}}remake{{end}} {{if eq .Torrent.Status 3}}trusted{{end}} {{if eq .Torrent.Status 4}}aplus{{end}}{{end}}
|
||
{{define "content"}}
|
||
<div style="text-align: left;" class="box">
|
||
{{with .Torrent}}
|
||
{{ 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}}
|
||
{{ range (index $.Infos "infos")}}
|
||
<div class="alert alert-info"><a class="panel-close close" data-dismiss="alert">×</a><i class="glyphicon glyphicon-info-sign"></i> {{ . }}</div>
|
||
{{end}}
|
||
<a class="torrent-hr" href="{{$.URL.Parse (printf "/search?c=%s_%s" .Category .SubCategory) }}">{{ if Sukebei}}{{ call $.T (CategoryName .Category .SubCategory) }}{{else}}{{ call $.T (CategoryName .Category .SubCategory) }}{{end}}</a> <br>
|
||
<br>
|
||
<table>
|
||
<tr class="torrent-info-row">
|
||
<td class="torrent-info-td torrent-info-label">Name:</td><td class="torrent-info-td torrent-info-data">{{.Name}}</td>
|
||
<td class="torrent-info-td torrent-info-label">Date:</td><td class="torrent-info-td date-short">{{.Date}}</td>
|
||
</tr>
|
||
<tr class="torrent-info-row">
|
||
<td class="torrent-info-td torrent-info-label">{{ call $.T "uploaded_by" }}:</td><td class="torrent-view-td torrent-info-data"><a href="{{ genRoute "user_profile" "id" ( print .UploaderID ) "username" (print .UploaderName) }}">{{.UploaderName}}</a></td>
|
||
<td class="torrent-info-td torrent-info-label">{{call $.T "seeders"}}:</td><td class="torrent-info-td">{{if .LastScrape.IsZero}}{{call $.T "unknown"}}{{else}}{{.Seeders}}{{end}}</td>
|
||
</tr>
|
||
<tr class="torrent-info-row">
|
||
<td class="torrent-info-td torrent-info-label">Website:</td><td class="torrent-view-td torrent-info-data">{{if ne .WebsiteLink ""}}<a href="{{.WebsiteLink}}">{{.WebsiteLink}}</a>{{else}}<a href="//nyaa.pantsu.cat">nyaa.pantsu.cat{{end}}</td>
|
||
<td class="torrent-info-td torrent-info-label">{{call $.T "leechers"}}:</td><td class="torrent-info-td">{{if .LastScrape.IsZero}}{{call $.T "unknown"}}{{else}}{{.Leechers}}{{end}}</td>
|
||
</tr>
|
||
<tr class="torrent-info-row">
|
||
<td class="torrent-info-td torrent-info-label">{{call $.T "hash"}}:</td><td style="font-family: monospace;" class="torrent-view-td torrent-info-data">{{.Hash}}</td>
|
||
<td class="torrent-info-td torrent-info-label">{{call $.T "completed"}}:</td><td class="torrent-info-td">{{if .LastScrape.IsZero}}{{call $.T "unknown"}}{{else}}{{.Completed}}{{end}}</td>
|
||
</tr>
|
||
<tr class="torrent-info-row">
|
||
<td class="torrent-info-td torrent-info-label">{{call $.T "size"}}:</td><td class="torrent-view-td torrent-info-data">{{ fileSize .Filesize $.T }}</td>
|
||
<td class="torrent-info-td torrent-info-label">{{call $.T "last_scraped"}}</td><td class="torrent-info-td">{{if not .LastScrape.IsZero}}{{formatDateRFC .LastScrape}}{{else}}{{call $.T "unknown"}}{{end}}</td>
|
||
</tr>
|
||
</table>
|
||
<div class="torrent-buttons">
|
||
<a href="{{.Magnet}}" class="form-input torrent-magnet-button">Magnet!</a>
|
||
<a href="{{.TorrentLink}}" class="form-input">Torrent!</a>
|
||
</div>
|
||
<p class="torrent-hr">{{call $.T "description"}}</p>
|
||
{{ if ne .Description ""}}
|
||
<div class="torrent-info-box">{{.Description}}</div>
|
||
{{else}}
|
||
<p>No description provided!</p>
|
||
{{end}}
|
||
<p class="torrent-hr" id="filelist-control" onclick="javascript:toggleFilelist()" data-filelist-open="true">{{call $.T "files"}}</p>
|
||
{{ if gt (len .FileList) 0 }}
|
||
{{/* how do i concat lol */}}
|
||
{{ $folderFormat := `<tr id="{{.Identifier}}" class='childs-of-{{.ParentIdentifier}} tr-filelist tr-folder' onclick="javascript:toggleFolder(this)" data-filelist-open="true" style="--nest-level: {{.NestLevel}}"><td>{{.FolderName}}</td><td>{{ fileSize .TotalSize .Data.T }}</td></tr>` }}
|
||
{{ $fileFormat := `<tr class='childs-of-{{.ParentIdentifier}} tr-filelist tr-file' style="--nest-level: {{.NestLevel}}"><td>{{.Filename}}</td><td>{{ fileSize .Filesize .Data.T }}</td>` }}
|
||
<script>
|
||
function toggleFilelist() {
|
||
var control = document.getElementById("filelist-control")
|
||
var filelist = document.getElementById("filelist")
|
||
|
||
filelist.hidden = !filelist.hidden
|
||
control.setAttribute("data-filelist-open", filelist.hidden ? "false" : "true")
|
||
}
|
||
|
||
function toggleFolder(folderNode) {
|
||
var isOpen = folderNode.getAttribute("data-filelist-open") == "true" ? true : false
|
||
var rows = document.querySelectorAll("*[class^='childs-of-" + folderNode.id + "']")
|
||
for (var i = 0; i < rows.length; i++) {
|
||
// If it's open (true), will hide, if not, will show.
|
||
rows[i].hidden = isOpen
|
||
}
|
||
|
||
folderNode.setAttribute("data-filelist-open", !isOpen ? "true" : "false")
|
||
}
|
||
</script>
|
||
<div class="torrent-info-box" id="filelist">
|
||
<table>
|
||
<thead>
|
||
<th style="width: 70%">{{call $.T "filename"}}</th>
|
||
<th>{{call $.T "size"}}</th>
|
||
</thead>
|
||
<tbody>
|
||
{{ MakeFolderTreeView $.RootFolder $folderFormat $fileFormat $ }}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{{/* Make filelist hidden by default with JS, but still visible without it */}}
|
||
<script>toggleFilelist()</script>
|
||
{{ else }}
|
||
<p>No files found? That doesn't even make sense!</p>
|
||
{{end}}
|
||
|
||
<p class="torrent-hr">{{call $.T "comments"}}</p>
|
||
{{range $index, $element := .Comments}}
|
||
<div class="torrent-info-box comment-box">
|
||
<span class="comment-index"><a href="#comment_{{inc $index}}">#{{inc $index}}</a><small style="padding-left: 4px;" class="date-short"> {{.Date}}</small></span>
|
||
<p>{{.Username}}</p>
|
||
<p>{{.Content}}</p>
|
||
</div>
|
||
{{end}}
|
||
{{end}}
|
||
<div style="margin-top: 10px" class="torrent-info-box">
|
||
<form method="post">
|
||
<div class="comment-form">
|
||
<div class="comment-text">
|
||
<label style="margin-top: 5px; margin-left: 5px;" class="input-label" for="comment">Submit a comment!</label> <br>
|
||
<textarea placeholder="Senkyuu~" name="comment" class="form-input" cols="50" rows="50"></textarea>
|
||
</div>
|
||
<div class="comment-captcha">
|
||
{{block "captcha" (makeCaptchaData .CaptchaID $.T)}}{{end}}
|
||
<button type="submit" class="form-input">{{call $.T "submit" }}</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
{{end}}
|
||
|