Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #244 from kipukun/master

Added front end for report on torrent view
Cette révision appartient à :
PantsuDev 2017-05-10 10:56:20 +10:00 révisé par GitHub
révision 8277143dfa

Voir le fichier

@ -1,38 +1,35 @@
{{define "title"}}{{.Torrent.Name}}{{end}} {{define "title"}}{{.Torrent.Name}}{{end}} {{define "contclass"}}cont-view{{end}} {{define "content"}}
{{define "contclass"}}cont-view{{end}} <div class="blockBody">
{{define "content"}} {{with .Torrent}}
<div class="blockBody"> <hr>
{{with .Torrent}} <table class="table table-borderless">
<hr> <tr {{if eq .Status 2}}class="remake" {{end}} {{if eq .Status 3}}class="trusted" {{end}} {{if eq .Status 4}}class="aplus"
<table class="table table-borderless"> {{end}}>
<tr {{if eq .Status 2}}class="remake"{{end}} <td>{{T "name"}}</td>
{{if eq .Status 3}}class="trusted"{{end}} <td>
{{if eq .Status 4}}class="aplus"{{end}}> {{.Name}}
<td>{{T "name"}}</td> <img style="float:right" src="{{$.URL.Parse (printf " /img/torrents/%s.png " .Sub_Category) }}">
<td> </td>
{{.Name}} </tr>
<img style="float:right" src="{{$.URL.Parse (printf "/img/torrents/%s.png" .Sub_Category) }}"> <tr>
</td> <td>{{T "hash"}}</td>
</tr> <td class="torrent-hash">{{.Hash}}</td>
<tr> </tr>
<td>{{T "hash"}}</td> <tr>
<td class="torrent-hash">{{.Hash}}</td> <td>{{T "date"}}</td>
</tr> <td class="date-full">{{.Date}}</td>
<tr> </tr>
<td>{{T "date"}}</td> <tr>
<td class="date-full">{{.Date}}</td> <td>{{T "size"}}</td>
</tr> <td>{{.Filesize}}</td>
<tr> </tr>
<td>{{T "size"}}</td> <tr>
<td>{{.Filesize}}</td> <td>Uploader</td>
</tr> <td><a href="{{$.URL.Parse (printf " /user/%d/- " .UploaderId) }}">{{.UploaderName}}</a></td>
<tr> {{if ne .WebsiteLink ""}}
<td>Uploader</td> <tr>
<td><a href="{{$.URL.Parse (printf "/user/%d/-" .UploaderId) }}">{{.UploaderName}}</a></td> <td>{{T "Link"}}</td>
{{if ne .WebsiteLink ""}} <td><a href="{{.WebsiteLink}}">{{.WebsiteLink}}</td>
<tr>
<td>{{T "Link"}}</td>
<td><a href="{{.WebsiteLink}}">{{.WebsiteLink}}</td>
</tr> </tr>
{{end}} {{end}}
<tr> <tr>
@ -41,44 +38,71 @@
<a aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-success download-btn"> <a aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-success download-btn">
<span class="glyphicon glyphicon-magnet" aria-hidden="true"></span> Download! <span class="glyphicon glyphicon-magnet" aria-hidden="true"></span> Download!
</a> </a>
<a style="padding-left: 0.5em"></a> <a style="padding-left: 0.5em"></a> {{if ne .TorrentLink ""}}
{{if ne .TorrentLink ""}} <a aria-label="Torrent file" href="{{.TorrentLink}}" type="button" class="btn btn-success download-btn">
<a aria-label="Torrent file" href="{{.TorrentLink}}" type="button" class="btn btn-success download-btn">
<span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span> Torrent file <span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span> Torrent file
</a> </a>
{{end}} <a aria-label="Report button" href="{{.TorrentLink}}" type="button" data-toggle="modal" data-target="#reportModal" class="btn btn-danger download-btn">
</td> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Report!
</tr> </a> {{end}}
<tr> </td>
<td>{{T "description"}}</td> </tr>
<td>{{.Description}}</td> <tr>
</tr> <td>{{T "description"}}</td>
<tr style="height:2em"> <td></td><td></td> </tr> <td>{{.Description}}</td>
<tr> </tr>
<td>{{T "comments"}}</td> <tr style="height:2em">
<td></td> <td></td>
</tr> <td></td>
{{ range $index, $element := .Comments }} </tr>
<tr class="comment-row" id="comment_{{$index}}"> <tr>
<td> <td>{{T "comments"}}</td>
<a href="#comment_{{$index}}">{{$index}}</a> <td></td>
{{.Username}} </tr>
</td> {{ range $index, $element := .Comments }}
<td>{{.Content}}</td> <tr class="comment-row" id="comment_{{$index}}">
</tr> <td>
{{end}} <a href="#comment_{{$index}}">{{$index}}</a> {{.Username}}
</table> </td>
{{end}} <td>{{.Content}}</td>
<form method="post"> </tr>
<div class="form-group"> {{end}}
{{/* There should be a better way to use translation on this... */}} </table>
<label for="comment">{{ if gt .User.Id 0}} {{T "submit_a_comment_as_username" .User.Username}} {{else}} {{T "submit_a_comment_as_anonymous"}} {{end}}</label> {{end}}
<textarea name="comment" class="form-control" rows="5"></textarea> <form method="post">
</div> <div class="form-group">
{{with .Captcha}} {{/* There should be a better way to use translation on this... */}}
{{block "captcha" .}}{{end}} <label for="comment">{{ if gt .User.Id 0}} {{T "submit_a_comment_as_username" .User.Username}} {{else}} {{T "submit_a_comment_as_anonymous"}} {{end}}</label>
{{end}} <textarea name="comment" class="form-control" rows="5"></textarea>
<input type="submit" value="{{T "submit"}}"> </div>
</form> {{with .Captcha}} {{block "captcha" .}}{{end}} {{end}}
</div> <input type="submit" value="{{T " submit "}}">
{{end}} </form>
</div>
{{with .Torrent}}
<div id="reportModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Report Torrent #{{.Id}}</h4>
</div>
{{end}}
<div class="modal-body">
<b>Report type:</b>
<form action="">
<input type="radio" name="report" value="illegal"> Illegal content <br/>
<input type="radio" name="report" value="spam"> Spam / garbage
</form> <br />
{{with .Captcha}} {{block "captcha" .}}{{end}} {{end}}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-default">Report!</button>
</div>
</div>
</div>
</div>
{{end}}