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

Voir le fichier

@ -112,10 +112,6 @@ func getTorrentsOrderBy(parameters *serviceBase.WhereParams, orderBy string, lim
) { ) {
var conditionArray []string var conditionArray []string
conditionArray = append(conditionArray, "deleted_at IS NULL") 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{} var params []interface{}
if parameters != nil { // if there is where parameters if parameters != nil { // if there is where parameters
if len(parameters.Conditions) > 0 { if len(parameters.Conditions) > 0 {

Voir le fichier

@ -3,6 +3,7 @@
<table class="table"> <table class="table">
<tr> <tr>
<th class="col-xs-10">Content</th> <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">User</th>
<th class="col-xs-1">Action</th> <th class="col-xs-1">Action</th>
</tr> </tr>
@ -10,8 +11,10 @@
{{ range .Comments}} {{ range .Comments}}
<tr> <tr>
<td><a href="{{ genRoute "mod_cedit" }}?id={{.ID}}">{{ .Content }}</a></td> <!-- TODO: add href="{{ genRoute "mod_cedit" }}?id={{.ID}}" for comment editing -->
<td><a>{{ .UserID }}</a></td> <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> <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}} {{end}}
</table> </table>

Voir le fichier

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

Voir le fichier

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

Voir le fichier

@ -622,5 +622,45 @@
{ {
"id": "delete", "id": "delete",
"translation": "Löschen" "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" "translation": "Moderator"
}, },
{ {
"id":" api_token", "id": "api_token",
"translation": "API Token" "translation": "API Token"
}, },
{ {
@ -656,8 +656,8 @@
"translation": "Download!" "translation": "Download!"
}, },
{ {
"id": "report", "id": "report_btn",
"translation": "Report!" "translation": "Report"
}, },
{ {
"id": "are_you_sure", "id": "are_you_sure",
@ -665,7 +665,7 @@
}, },
{ {
"id": "report_torrent_number", "id": "report_torrent_number",
"translation": "Report Torrent #" "translation": "Report Torrent #%s"
}, },
{ {
"id": "report_type", "id": "report_type",

Voir le fichier

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