Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Merge pull request #489 from sfan5/fixez

Lots of fixes
Cette révision appartient à :
akuma06 2017-05-14 19:46:31 +02:00 révisé par GitHub
révision fa305a59a7
8 fichiers modifiés avec 71 ajouts et 40 suppressions

Voir le fichier

@ -448,19 +448,14 @@ select#bottom_language_selector {
}
.commentList .commentBody {
border: 1px solid #eee;
margin-bottom: 20px;
margin-left: 85px;
margin-right: 0px;
padding: 10px 20px;
position: relative;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
background: #fff;
color: #6b6e80;
position: relative;
border: 1px solid #c1c1c1;
margin-left: 85px;
margin-right: 0px;
padding: 8px 16px;
position: relative;
border-radius: 4px;
background: #fff;
color: #6b6e80;
}
.commentList .commentBody > .row > div {
@ -469,11 +464,9 @@ select#bottom_language_selector {
.commentList .commentData {
font-size: 13px;
color: #aaaaaa;
padding-bottom: 8px;
margin-bottom: 10px !important;
border-bottom: 1px solid #eee;
height: 2.5em;
height: 2.2em;
}
.commentList ul.comments ul{
@ -491,7 +484,6 @@ select#bottom_language_selector {
}
.comment {
margin: 1em;
padding: 1em;
width: 75%;
margin-left: 12%;

Voir le fichier

@ -112,10 +112,6 @@ func getTorrentsOrderBy(parameters *serviceBase.WhereParams, orderBy string, lim
) {
var conditionArray []string
conditionArray = append(conditionArray, "deleted_at IS NULL")
if strings.HasPrefix(orderBy, "filesize") {
// torrents w/ NULL filesize fuck up the sorting on Postgres
conditionArray = append(conditionArray, "filesize IS NOT NULL")
}
var params []interface{}
if parameters != nil { // if there is where parameters
if len(parameters.Conditions) > 0 {

Voir le fichier

@ -3,6 +3,7 @@
<table class="table">
<tr>
<th class="col-xs-10">Content</th>
<th class="col-xs-1">Torrent</th>
<th class="col-xs-1">User</th>
<th class="col-xs-1">Action</th>
</tr>
@ -10,8 +11,10 @@
{{ range .Comments}}
<tr>
<td><a href="{{ genRoute "mod_cedit" }}?id={{.ID}}">{{ .Content }}</a></td>
<td><a>{{ .UserID }}</a></td>
<!-- TODO: add href="{{ genRoute "mod_cedit" }}?id={{.ID}}" for comment editing -->
<td><a>{{ .Content }}</a></td>
<td><a href="{{ genViewTorrentRoute .TorrentID }}">{{ .TorrentID }}</a></td>
<td>{{ .UserID }}</td>
<td><a href="{{ genRoute "mod_cdelete" }}?id={{.ID}}" class="btn btn-danger btn-lg" onclick="if (!confirm('Are you sure?')) return false;"><i class="glyphicon glyphicon-trash"></i> {{ T "delete" }}</a></td></tr>
{{end}}
</table>

Voir le fichier

@ -11,13 +11,13 @@
{{with .Reassign}}
<div class="form-group">
<label for="name">Reassign to:</label>
<label for="to">Reassign to:</label>
<input type="text" name="to" class="form-control" placeholder="User ID" {{if ne .AssignTo 0}}value="{{.AssignTo}}"{{end}} required>
</div>
<div class="form-group">
<label for="by">Reassign based on:</label><br />
<input type="radio" name="by" value="olduser" {{if eq .By "olduser"}}selected{{end}} required> Old Username<br />
<input type="radio" name="by" value="torrentid" {{if eq .By "torrentid"}}selected{{end}} required> Torrent ID
<input type="radio" name="by" value="olduser" {{if eq .By "olduser"}}checked{{end}} required> Old Username<br />
<input type="radio" name="by" value="torrentid" {{if eq .By "torrentid"}}checked{{end}} required> Torrent ID
</div>
<div class="form-group">

Voir le fichier

@ -7,7 +7,7 @@
<div class="content" style="margin-bottom: 2em;">
<div class="row">
<div class="col-md-12">
<h3 class="break" {{if eq .Status 2}}class="remake" {{end}} {{if eq .Status 3}}class="trusted" {{end}} {{if eq .Status 4}}class="aplus"{{end}}>{{.Name}}</h3>
<h3 class="break {{if eq .Status 2}}remake{{end}} {{if eq .Status 3}}trusted{{end}} {{if eq .Status 4}}aplus{{end}}">{{.Name}}</h3>
</div>
</div>
<div class="row">
@ -20,6 +20,7 @@
<h4>{{ T "uploaded_by" }} <a href="{{$.URL.Parse (printf "/user/%d/-" .UploaderID) }}">{{.UploaderName}}</a></h4>
</div>
</div>
<div style="float:right;">
<a style="margin: 5px;" aria-label="Magnet Button" href="{{.Magnet}}" type="button" class="btn btn-lg btn-success">
@ -31,7 +32,7 @@
</a>
{{end}}
<a style="margin: 5px;" aria-label="Report button" data-toggle="modal" data-target="#reportModal" class="btn btn-danger btn-sm">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> {{ T "report" }}
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> {{ T "report_btn" }}
</a>
{{ if HasAdmin $.User}}
@ -142,7 +143,7 @@
<textarea name="comment" class="form-control" rows="5"></textarea>
</div>
{{block "captcha" .}}{{end}}
<button type="submit" class="btn btn-success">{{T " submit "}}</button>
<button type="submit" class="btn btn-success">{{T "submit" }}</button>
</form>
</div>
</div>

Voir le fichier

@ -622,5 +622,45 @@
{
"id": "delete",
"translation": "Löschen"
},
{
"id": "uploaded_by",
"translation": "Hochgeladen von"
},
{
"id": "download_btn",
"translation": "Downloaden!"
},
{
"id": "report_btn",
"translation": "Melden"
},
{
"id": "are_you_sure",
"translation": "Bist du sicher?"
},
{
"id": "report_torrent_number",
"translation": "Torrent #%s melden"
},
{
"id": "report_type",
"translation": "Meldungsgrund"
},
{
"id": "illegal_content",
"translation": "Illegaler Inhalt"
},
{
"id": "spam_garbage",
"translation": "Spam / Müll"
},
{
"id": "wrong_category",
"translation": "Falsche Kategorie"
},
{
"id": "duplicate_deprecated",
"translation": "Duplikat / Veraltet"
}
]

Voir le fichier

@ -556,7 +556,7 @@
"translation": "Moderator"
},
{
"id":" api_token",
"id": "api_token",
"translation": "API Token"
},
{
@ -656,8 +656,8 @@
"translation": "Download!"
},
{
"id": "report",
"translation": "Report!"
"id": "report_btn",
"translation": "Report"
},
{
"id": "are_you_sure",
@ -665,7 +665,7 @@
},
{
"id": "report_torrent_number",
"translation": "Report Torrent #"
"translation": "Report Torrent #%s"
},
{
"id": "report_type",

Voir le fichier

@ -106,6 +106,7 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
case "2":
search.Sort = common.Date
orderBy += "date"
search.NotNull = "date IS NOT NULL"
break
case "3":
search.Sort = common.Downloads
@ -114,21 +115,23 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
case "4":
search.Sort = common.Size
orderBy += "filesize"
// avoid sorting completely breaking on postgres
search.NotNull = "filesize IS NOT NULL"
break
case "5":
search.Sort = common.Seeders
orderBy += "seeders"
search.NotNull += "seeders IS NOT NULL "
search.NotNull = "seeders IS NOT NULL"
break
case "6":
search.Sort = common.Leechers
orderBy += "leechers"
search.NotNull += "leechers IS NOT NULL "
search.NotNull = "leechers IS NOT NULL"
break
case "7":
search.Sort = common.Completed
orderBy += "completed"
search.NotNull += "completed IS NOT NULL "
search.NotNull = "completed IS NOT NULL"
break
default:
search.Sort = common.ID
@ -173,10 +176,6 @@ func searchByQuery(r *http.Request, pagenum int, countAll bool) (
conditions = append(conditions, search.NotNull)
}
if len(search.NotNull) > 0 {
conditions = append(conditions, search.NotNull)
}
searchQuerySplit := strings.Fields(search.Query)
for _, word := range searchQuerySplit {
firstRune, _ := utf8.DecodeRuneInString(word)