Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/templates/layouts/partials/torrent_item_upload.jet.html
kilo 1b0211cfb9 Remove https for dlsite, fix few html errors, small css improvements (#1551)
* Remove https for dlsite

* Update listing.jet.html

* Update torrent_item.jet.html

* Update torrent_item_upload.jet.html

* Update torrents.jet.html

* remove role attribute

* remove role attribute

* login & register page styling

* website-nav stylisation for main.css

* remove now useless css rules

* up to date main.css

* OwO

* Update main.css

* Last stylisation changes for classic's nav

* margin-left

* add categories

* add TestgenSearchWithCategory to template_test

* add genSearchWithCategory function

* forgot to close the function call

* Update template_functions_test.go

* Update template_functions.go

* Update template_functions.go

* attempt at fixing template_functions

* Update template_functions.go
2017-09-12 00:17:35 +02:00

57 lignes
2,6 Kio
HTML

<script type="text/javascript">
// {{ range _, cat := GetCategories(false, true) }}
T.Add("{{ cat.ID }}", "{{ T(cat.Name) }}")
// {{end}}
// {{ range _, language := GetTorrentLanguages() }}
T.Add("{{ language.Code }}", "{{ LanguageName(language, T) }}")
// {{ if language.Tag != language.Code }}
T.Add("{{ language.Tag }}", "{{ LanguageName(language, T) }}")
// {{end}}
// {{end}}
Templates.Add("torrents.item", function(torrent) {
var tr_class = "torrent-info hidden"
if (torrent.status == 2) {
tr_class += " remake"
} else if (torrent.status == 3) {
tr_class += " trusted"
} else if (torrent.status == 4) {
tr_class += " aplus"
}
var catClass = "nyaa-cat"
// {{ if Sukebei() }}
catClass += " sukebei-cat-"+ torrent.category + torrent.sub_category
// {{else}}
catClass += " nyaa-cat-"+ torrent.sub_category
// {{end}}
var languages = ""
var colspan = (torrent.comments.length == 0 ? ` colspan="2"` : "" )
var commentTd = ((torrent.comments.length > 0) ? `<td class="tr-cs home-td" title="`+torrent.comments.length + ` {{T("comments")}}` +`"><span>` + torrent.comments.length + `</span></td>` : "")
var dlLink = (torrent.torrent != "" ? ' <a><div class="icon-floppy"></div></a>' : "")
if (torrent.languages[0] != "") {
var flagClass = (torrent.languages.length == 1) ? Templates.FlagCode(torrent.languages[0]) : "multiple"
var langs = torrent.languages.map(function (el, i) { return T.r(el)}).join(",")
languages = `<a><img src="img/blank.gif" class="flag flag-` + flagClass + `" title="` + langs + `"></a>`
}
return `<tr id="torrent_` + torrent.id + `" class="` + tr_class + `">
<td class="tr-cat home-td">
<div class="` + catClass +`">
<a class="category">
</a> ` + languages + `
</div></td>
<td class="tr-name home-td"` + colspan + `><a>` + Templates.EncodeEntities(torrent.name) + `</a></td>
`+ commentTd +`
<td class="tr-links home-td">
<a title="{{ T("magnet_link") }}">
<div class="icon-magnet"></div>
</a>`+ dlLink +`
</td>
<td class="tr-size home-td hide-xs">` + humanFileSize(torrent.filesize) + `</td>
<td class="tr-se home-td hide-smol">` + torrent.seeders + `</td>
<td class="tr-le home-td hide-smol">` + torrent.leechers + `</td>
<td class="tr-dl home-td hide-xs">` + torrent.completed + `</td>
<td class="tr-date home-td date-short hide-xs">` + torrent.date + `</td>
</tr>`;
});
</script>