Fix filters giving wrong results (#1042)
Cette révision appartient à :
Parent
eaf4e23266
révision
f6f452114f
2 fichiers modifiés avec 14 ajouts et 14 suppressions
|
@ -16,31 +16,31 @@ import (
|
|||
type Status uint8
|
||||
|
||||
const (
|
||||
ShowAll Status = iota
|
||||
FilterRemakes
|
||||
Trusted
|
||||
APlus
|
||||
ShowAll Status = 0
|
||||
FilterRemakes = 2
|
||||
Trusted = 3
|
||||
APlus = 4
|
||||
)
|
||||
|
||||
func (st *Status) ToString() string {
|
||||
switch *st {
|
||||
case FilterRemakes:
|
||||
return "1"
|
||||
case Trusted:
|
||||
return "2"
|
||||
case APlus:
|
||||
case Trusted:
|
||||
return "3"
|
||||
case APlus:
|
||||
return "4"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (st *Status) Parse(s string) {
|
||||
switch s {
|
||||
case "1":
|
||||
*st = FilterRemakes
|
||||
case "2":
|
||||
*st = Trusted
|
||||
*st = FilterRemakes
|
||||
case "3":
|
||||
*st = Trusted
|
||||
case "4":
|
||||
*st = APlus
|
||||
default:
|
||||
*st = ShowAll
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
<label><span class="select-icon caret-down-icon"></span></label>
|
||||
<select name="s" class="form-input hide-xs">
|
||||
<option value="0">{{call $.T "show_all"}}</option>
|
||||
<option value="1" {{if eq .Search.Status 1}}selected{{end}}>{{call $.T "filter_remakes"}}</option>
|
||||
<option value="2" {{if eq .Search.Status 2}}selected{{end}}>{{call $.T "trusted"}}</option>
|
||||
<option value="3" {{if eq .Search.Status 3}}selected{{end}}>A+</option>
|
||||
<option value="2" {{if eq .Search.Status 2}}selected{{end}}>{{call $.T "filter_remakes"}}</option>
|
||||
<option value="3" {{if eq .Search.Status 3}}selected{{end}}>{{call $.T "trusted"}}</option>
|
||||
<option value="4" {{if eq .Search.Status 4}}selected{{end}}>A+</option>
|
||||
</select>
|
||||
{{ if .Search.ShowItemsPerPage }}
|
||||
<select name="max" class="form-input hide-xs">
|
||||
|
@ -68,4 +68,4 @@
|
|||
</form>
|
||||
</details>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
|
Référencer dans un nouveau ticket