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/site/torrents/view.jet.html
kilo baeb405490 too lazy to make a title (#1138)
* preliminary work

* Update main.css
2017-07-10 13:55:29 +10:00

156 lignes
8,7 Kio
HTML

{{ extends "layouts/index_site" }}
{{ import "layouts/partials/helpers/csrf" }}
{{ import "layouts/partials/helpers/captcha" }}
{{ import "layouts/partials/helpers/treeview" }}
{{block title()}}{{Torrent.Name}}{{end}}
{{block additional_header()}}
<link rel="stylesheet" href="/css/flags/flags.min.css">
<link rel="stylesheet" href="/css/flags/custom_flags.css">
{{end}}
{{block content_body()}}
<div style="text-align: left;" class="box">
<div id="torrent-name" class="{{if Torrent.Status == 2}}remake{{else if Torrent.Status == 3}}trusted{{else if Torrent.Status == 4}}aplus{{end}}">
<h1 style="text-align: center;" class="torrent-hr">{{Torrent.Name}}</h1>
</div>
<br>
<table>
<tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{ T("category") }}:</td><td class="torrent-info-td torrent-info-data" style="padding:0"><a href="{{URL.Parse("/search?c="+Torrent.Category+"_"+Torrent.SubCategory) }}">{{ T(CategoryName(Torrent.Category, Torrent.SubCategory)) }}</a> <br></td>
<td class="torrent-info-td torrent-info-label">{{ T("date") }}:</td><td class="torrent-info-td date-full">{{Torrent.Date}}</td>
</tr>
<tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{ T("uploaded_by") }}:</td><td class="torrent-view-td torrent-info-data">{{ genUploaderLink(Torrent.UploaderID, Torrent.UploaderName, Torrent.Hidden)|raw }}</td>
<td class="torrent-info-td torrent-info-label">{{ T("seeders")}}:</td><td class="tr-se torrent-info-td">{{if Torrent.LastScrape.IsZero}}{{ T("unknown")}}{{else}}{{Torrent.Seeders}}{{end}}</td>
</tr>
<tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{ T("website_link") }}:</td><td class="torrent-view-td torrent-info-data">{{if Torrent.WebsiteLink != ""}}<a href="{{Torrent.WebsiteLink}}">{{Torrent.WebsiteLink}}</a>{{else}}N/A{{end}}</td>
<td class="torrent-info-td torrent-info-label">{{ T("leechers")}}:</td><td class="tr-le torrent-info-td">{{if Torrent.LastScrape.IsZero}}{{ T("unknown")}}{{else}}{{Torrent.Leechers}}{{end}}</td>
</tr>
<tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{ T("hash")}}:</td><td style="font-family: monospace;" class="torrent-view-td torrent-info-data">{{Torrent.Hash}}</td>
<td class="torrent-info-td torrent-info-label">{{ T("completed")}}:</td><td class="torrent-info-td"><b>{{if Torrent.LastScrape.IsZero}}{{ T("unknown")}}{{else}}{{Torrent.Completed}}{{end}}</b></td>
</tr>
<tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{ T("size")}}:</td><td class="torrent-view-td torrent-info-data">{{ fileSize(Torrent.Filesize, T) }}</td>
<td class="torrent-info-td torrent-info-label">{{ T("last_scraped")}}</td><td class="torrent-info-td{{if !Torrent.LastScrape.IsZero}} date-full">{{formatDateRFC(Torrent.LastScrape)}}{{else}}">{{ T("unknown")}}{{end}}</td>
</tr>
{{ if len(Torrent.Languages) > 0}}
<tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{ T("torrent_language")}}:</td>
<td class="tr-flag torrent-view-td torrent-info-data">
{{ range _, language := Torrent.Languages}}
{{ if language != "" }}
<span><img src="/img/blank.gif" alt="{{ LanguageName(language, T) }}" class="flag flag-{{FlagCode(language)}}" title="{{ LanguageName(language, T) }}"></img> {{ LanguageName(language, T) }}</span>
{{end}}
{{end}}
</td>
</tr>
{{end}}
</table>
<div class="torrent-buttons">
<a href="{{Torrent.Magnet}}" class="form-input btn-green download" style="float:left;height: auto;margin-right: 0.5em;"><div class="icon-magnet"></div> {{ T("magnet_link")}}</a>
{{ if Torrent.TorrentLink != ""}}
<a href="{{Torrent.TorrentLink}}" class="form-input download" style="float:left;height: auto;"><div class="icon-floppy"></div> {{ T("torrent_file")}}</a>
{{end}}
{{ if User.ID > 0}}
<a id="reportPopup" href="#" class="form-input">{{ T("report_btn") }}</a>
{{ if User.HasAdmin()}}
<a href="/mod/torrent/delete?id={{ Torrent.ID }}" class="form-input btn-red" onclick="if (!confirm('{{ T("are_you_sure") }}')) return false;">{{ T("delete") }}</a>
<a href="/mod/torrent?id={{ Torrent.ID }}" class="form-input btn-orange">{{ T("edit") }}</a>
{{ else if User.CurrentUserIdentical(Torrent.UploaderID) }}
<a href="/torrent/delete?id={{ Torrent.ID }}" class="form-input btn-red" onclick="if (!confirm('{{ T("are_you_sure") }}')) return false;">{{ T("delete") }}</a>
<a href="/torrent?id={{ Torrent.ID }}" class="form-input btn-orange">{{ T("edit") }}</a>
{{end}}
{{end}}
<div style="clear:both;"></div>
</div>
<p class="torrent-hr">{{ T("description")}}</p>
{{ if Torrent.Description != ""}}
<div id="description-box" class="torrent-info-box">{{Torrent.Description|raw}}</div>
{{else}}
<p>{{ T("no_description") }}</p>
{{end}}
<input type="checkbox" id="show-filelist">
<label class="torrent-hr filelist-control" for="show-filelist">{{ T("files")}}</label>
<div class="torrent-info-box" id="filelist">
{{ if len(Torrent.FileList) > 0 }}
{* how do i concat lol *}
<table class="table-filelist">
<thead>
<th style="width: 80%">{{ T("file_name")}}</th>
<th>{{ T("size")}}</th>
</thead>
<tbody>
{{ yield make_treeview(treeviewData=makeTreeViewData(RootFolder, 0, T, "root")) }}
</tbody>
</table>
{{ else }}
<p>{{ T("no_files") }}</p>
{{ end }}
</div>
<p class="torrent-hr">{{ T("comments")}}</p>
{{range index, element := Torrent.Comments}}
<div class="torrent-info-box comment-box">
<span class="comment-index"><a href="#comment_{{index}}">#{{index}}</a><small style="padding-left: 4px;" class="date-short">{{formatDateRFC(element.Date)}}</small></span>
<p>{{element.Username}}</p>
<p>{{element.Content|raw}}</p>
</div>
{{end}}
<div style="margin-top: 10px" class="torrent-info-box">
<form method="post">
{{ yield csrf_field()}}
<div class="comment-form">
<div class="comment-text">
<h3>{{ if User.ID > 0}} {{ T("submit_a_comment_as_username", User.Username) }} {{else}} {{ T("submit_a_comment_as_anonymous")|raw}} {{end}}</h3>
<textarea style="height: 10rem;" placeholder="サンキュー" name="comment" class="form-input up-input"></textarea>
</div>
<div class="comment-captcha">
{{ yield captcha(captchaid=CaptchaID)}}
</div>
<button type="submit" class="form-input up-btn">{{ T("submit") }}</button>
</div>
</form>
</div>
</div>
{{ if User.ID > 0 }}
<!-- Modal -->
<div id="modal_mod_tools" class="modal">
<!-- Modal content -->
<div class="modal-content">
<form method="post" action="/report/{{Torrent.ID}}">
<div class="modal-header">
<span class="close">&times;</span>
<h2>{{ T("report_torrent_number", Torrent.ID) }}</h2>
</div>
<div class="modal-body">
<h4>{{ T("report_type") }}</h4>
{{ yield csrf_field() }}
<input type="radio" name="report_type" value="illegal_content" id="illegal" required> <label for="illegal">{{ T("illegal_content") }}</label><br />
<input type="radio" name="report_type" value="spam_garbage" id="spam" required> <label for="spam">{{ T("spam_garbage") }}</label><br />
<input type="radio" name="report_type" value="wrong_category" id="wrongcat" required> <label for="wrongcat">{{ T("wrong_category") }}</label><br />
<input type="radio" name="report_type" value="duplicate_deprecated" id="dup" required> <label for="dup">{{ T("duplicate_deprecated") }}</label><br />
<div class="comment-captcha">
{{yield captcha(captchaid=CaptchaID)}}
</div>
</div>
<div class="modal-footer">
<span><button id="confirm_changes" type="submit">{{ T("yes")}}</button>
<button class="close" onclick="Modal.CloseActive();">{{ T("no")}}</button></span>
<h3>{{ T("are_you_sure") }} </h3>
</div>
</form>
</div>
</div>
{{end}}
{{end}}
{{ block footer_js()}}
<script type="text/javascript" src="{{ URL.Parse("/js/modal.js") }}"></script>
<script type="text/javascript">
// Modal initialization
Modal.Init({
elements: document.getElementsByClassName("modal"),
button: "#reportPopup"
});
</script>
{{end}}