Fixed New view template design. Changed Id to ID. Forced images inside description to fit container. (#289)
Cette révision appartient à :
Parent
8ce073a7a0
révision
38ff2a6e28
3 fichiers modifiés avec 100 ajouts et 89 suppressions
|
@ -123,3 +123,10 @@ a:hover {
|
|||
#mainmenu a.nightswitch {
|
||||
background-image: url(/img/moon.png);
|
||||
}
|
||||
|
||||
/* Force images on description to fit width */
|
||||
#description img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
|
|
@ -339,3 +339,10 @@ footer {
|
|||
color: #616161;
|
||||
text-shadow: -1px -1px #999999;
|
||||
}
|
||||
|
||||
/* Force images on description to fit width */
|
||||
#description img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
|
|
@ -1,96 +1,94 @@
|
|||
{{define "title"}}{{.Torrent.Name}}{{end}}
|
||||
{{define "contclass"}}cont-view{{end}}
|
||||
{{define "content"}}
|
||||
<div class="blockBody">
|
||||
{{with .Torrent}}
|
||||
<hr>
|
||||
<table class="table table-borderless">
|
||||
<tr {{if eq .Status 2}}class="remake"{{end}}
|
||||
{{if eq .Status 3}}class="trusted"{{end}}
|
||||
{{if eq .Status 4}}class="aplus"{{end}}>
|
||||
<td>{{T "name"}}</td>
|
||||
<td>
|
||||
{{.Name}}
|
||||
<img style="float:right" src="{{$.URL.Parse (printf "/img/torrents/%s.png" .SubCategory) }}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{T "hash"}}</td>
|
||||
<td class="torrent-hash">{{.Hash}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{T "date"}}</td>
|
||||
<td class="date-full">{{.Date}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{T "size"}}</td>
|
||||
<td>{{.Filesize}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Uploader</td>
|
||||
<td>
|
||||
<a href="{{$.URL.Parse (printf "/user/%d/-" .UploaderID) }}">{{.UploaderName}}</a>
|
||||
{{if ne .OldUploader ""}}
|
||||
({{.OldUploader}})
|
||||
{{end}}
|
||||
</td>
|
||||
{{if ne .WebsiteLink ""}}
|
||||
<tr>
|
||||
<td>{{T "Link"}}</td>
|
||||
<td><a href="{{.WebsiteLink}}">{{.WebsiteLink}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
<tr>
|
||||
<td>{{T "links"}}</td>
|
||||
<td>
|
||||
<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!
|
||||
</a>
|
||||
<a style="padding-left: 0.5em"></a>
|
||||
<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
|
||||
</a>
|
||||
<a aria-label="Report button" href="{{.TorrentLink}}" type="button" data-toggle="modal" data-target="#reportModal" class="btn btn-danger download-btn">
|
||||
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Report!
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{T "description"}}</td>
|
||||
<td>{{.Description}}</td>
|
||||
</tr>
|
||||
<tr style="height:2em">
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{T "comments"}}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{{ range $index, $element := .Comments }}
|
||||
<tr class="comment-row" id="comment_{{$index}}">
|
||||
<td>
|
||||
<a href="#comment_{{$index}}">{{$index}}</a> {{.Username}}
|
||||
</td>
|
||||
<td>{{.Content}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table>
|
||||
{{end}}
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
{{/* There should be a better way to use translation on this... */}}
|
||||
<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>
|
||||
<textarea name="comment" class="form-control" rows="5"></textarea>
|
||||
<div class="blockBody">
|
||||
{{with .Torrent}}
|
||||
<hr>
|
||||
<div class="content" style="margin-bottom: 2em;">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3 style="word-break:break-all" {{if eq .Status 2}}class="remake" {{end}} {{if eq .Status 3}}class="trusted" {{end}} {{if eq .Status 4}}class="aplus"{{end}}>{{.Name}}</h3>
|
||||
<div class="uploaded_by">
|
||||
<img style="float:left; margin-right: 1em;" src="{{$.URL.Parse (printf "/img/torrents/%s.png" .SubCategory) }}">
|
||||
<h4>Uploaded by <a href="{{$.URL.Parse (printf "/user/%d/-" .UploaderID) }}">{{.UploaderName}}</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<a style="margin: 5px;" aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-lg btn-success download-btn">
|
||||
<span class="glyphicon glyphicon-magnet" aria-hidden="true"></span> Download!
|
||||
</a>
|
||||
{{if ne .TorrentLink ""}}
|
||||
<a style="margin: 5px;" aria-label="Torrent file" href="{{.TorrentLink}}" type="button" class="btn btn-lg btn-success download-btn">
|
||||
<span class="glyphicon glyphicon-floppy-save" aria-hidden="true"></span> Torrent file
|
||||
</a>
|
||||
<a style="margin: 5px;" aria-label="Report button" href="{{.TorrentLink}}" type="button" data-toggle="modal" data-target="#reportModal" class="btn btn-danger btn-lg download-btn">
|
||||
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Report!
|
||||
</a> {{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h4>{{T "hash"}}</h4>
|
||||
<p>{{.Hash}}</p>
|
||||
<hr>
|
||||
<h4>{{T "date"}}</h4>
|
||||
<p>{{.Date}}</p>
|
||||
<hr>
|
||||
<h4>{{T "size"}}</h4>
|
||||
<p>{{.Filesize}}</p>
|
||||
<hr>
|
||||
{{if ne .WebsiteLink ""}}
|
||||
<h4>{{T "Link"}}</h4>
|
||||
<p><a href="{{.WebsiteLink}}">{{.WebsiteLink}}</a></p>
|
||||
<hr>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{with .Captcha}} {{block "captcha" .}}{{end}} {{end}}
|
||||
<input type="submit" value="{{T " submit "}}">
|
||||
</form>
|
||||
<div class="row" id="description">
|
||||
<div class="col-md-12">
|
||||
<h4>{{T "description"}}</h4>
|
||||
<div style="word-break:break-all;">{{.Description}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="comments">
|
||||
<div class="col-md-12">
|
||||
<h4>{{T "comments"}}</h4>
|
||||
{{ range $index, $element := .Comments }}
|
||||
<div class="row comment-row" id="comment_{{$index}}">
|
||||
<div class="col-md-4">
|
||||
<a href="#comment_{{$index}}">{{$index}}</a> {{.Username}}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
{{.Content}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="row" style="margin-bottom: 2em;">
|
||||
<div class="col-md-12">
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
{{/* There should be a better way to use translation on this... */}}
|
||||
<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>
|
||||
<textarea name="comment" class="form-control" rows="5"></textarea>
|
||||
</div>
|
||||
{{with .Captcha}} {{block "captcha" .}}{{end}} {{end}}
|
||||
<input type="submit" value="{{T " submit "}}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
|
@ -102,15 +100,14 @@
|
|||
<form method="post" action="/report/{{.ID}}">
|
||||
<input type="radio" name="report_type" value="illegal"> Illegal content <br/>
|
||||
<input type="radio" name="report_type" value="spam"> Spam / garbage
|
||||
{{end}}
|
||||
{{with .Captcha}} {{block "captcha" .}}{{end}} {{end}}
|
||||
<button type="submit" class="btn btn-default">Report!</button>
|
||||
{{end}}
|
||||
{{with .Captcha}} {{block "captcha" .}}{{end}} {{end}}
|
||||
<button type="submit" class="btn btn-default">Report!</button>
|
||||
</form> <br />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
Référencer dans un nouveau ticket