343 lignes
8,4 Kio
Go
343 lignes
8,4 Kio
Go
// This file is automatically generated by qtc from "search.html".
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
//line search.html:1
|
|
package templates
|
|
|
|
//line search.html:1
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line search.html:1
|
|
import "strconv"
|
|
|
|
//line search.html:3
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line search.html:3
|
|
type searchField struct {
|
|
id, name string
|
|
}
|
|
|
|
// Common seatch part of many pages
|
|
|
|
//line search.html:8
|
|
func StreamSearchCommon(qw422016 *qt422016.Writer, search SearchForm) {
|
|
//line search.html:8
|
|
qw422016.N().S(`
|
|
<select name="c" class="form-control input-sm" value>
|
|
<option value="_">All categories</option>
|
|
`)
|
|
//line search.html:11
|
|
streamsearchOptions(qw422016, search.Category, []searchField{
|
|
{"3_", "Anime"},
|
|
{"3_12", "Anime - Anime Music Video"},
|
|
{"3_5", "Anime - English-translated"},
|
|
{"3_13", "Anime - Non-English-translated"},
|
|
{"3_6", "Anime - Raw"},
|
|
{"2_", "Audio"},
|
|
{"2_3", "Audio - Lossless"},
|
|
{"2_4", "Audio - Lossy"},
|
|
{"4_", "Literature"},
|
|
{"4_7", "Literature - English-translated"},
|
|
{"4_8", "Literature - Raw"},
|
|
{"4_14", "Literature - Non-English-translated"},
|
|
{"5_", "Live Action"},
|
|
{"5_9", "Live Action - English-translated"},
|
|
{"5_10", "Live Action - Idol/Promotional Video"},
|
|
{"5_18", "Live Action - Non-English-translated"},
|
|
{"5_11", "Live Action - Raw"},
|
|
{"6_", "Pictures"},
|
|
{"6_15", "Pictures - Graphics"},
|
|
{"6_16", "Pictures - Photos"},
|
|
{"1_", "Software"},
|
|
{"1_1", "Software - Applications"},
|
|
{"1_2", "Software - Games"},
|
|
})
|
|
//line search.html:35
|
|
qw422016.N().S(`
|
|
</select>
|
|
<select name="s" class="form-control input-sm">
|
|
<option value="">Show all</option>
|
|
`)
|
|
//line search.html:39
|
|
streamsearchOptions(qw422016, search.Status, []searchField{
|
|
{"2", "Filter Remakes"},
|
|
{"3", "Trusted"},
|
|
{"4", "A+"},
|
|
})
|
|
//line search.html:43
|
|
qw422016.N().S(`
|
|
</select>
|
|
`)
|
|
//line search.html:45
|
|
}
|
|
|
|
//line search.html:45
|
|
func WriteSearchCommon(qq422016 qtio422016.Writer, search SearchForm) {
|
|
//line search.html:45
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line search.html:45
|
|
StreamSearchCommon(qw422016, search)
|
|
//line search.html:45
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line search.html:45
|
|
}
|
|
|
|
//line search.html:45
|
|
func SearchCommon(search SearchForm) string {
|
|
//line search.html:45
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line search.html:45
|
|
WriteSearchCommon(qb422016, search)
|
|
//line search.html:45
|
|
qs422016 := string(qb422016.B)
|
|
//line search.html:45
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line search.html:45
|
|
return qs422016
|
|
//line search.html:45
|
|
}
|
|
|
|
// Options fields of a search <select> element
|
|
|
|
//line search.html:48
|
|
func streamsearchOptions(qw422016 *qt422016.Writer, selected string, s []searchField) {
|
|
//line search.html:48
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:49
|
|
for _, s := range s {
|
|
//line search.html:49
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:50
|
|
streamsearchOption(qw422016, selected, s)
|
|
//line search.html:50
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:51
|
|
}
|
|
//line search.html:51
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:52
|
|
}
|
|
|
|
//line search.html:52
|
|
func writesearchOptions(qq422016 qtio422016.Writer, selected string, s []searchField) {
|
|
//line search.html:52
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line search.html:52
|
|
streamsearchOptions(qw422016, selected, s)
|
|
//line search.html:52
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line search.html:52
|
|
}
|
|
|
|
//line search.html:52
|
|
func searchOptions(selected string, s []searchField) string {
|
|
//line search.html:52
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line search.html:52
|
|
writesearchOptions(qb422016, selected, s)
|
|
//line search.html:52
|
|
qs422016 := string(qb422016.B)
|
|
//line search.html:52
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line search.html:52
|
|
return qs422016
|
|
//line search.html:52
|
|
}
|
|
|
|
// Single search optiion field of a <select>
|
|
|
|
//line search.html:55
|
|
func streamsearchOption(qw422016 *qt422016.Writer, selected string, s searchField) {
|
|
//line search.html:55
|
|
qw422016.N().S(`
|
|
<option value="`)
|
|
//line search.html:56
|
|
qw422016.N().S(s.id)
|
|
//line search.html:56
|
|
qw422016.N().S(`" `)
|
|
//line search.html:56
|
|
if selected == s.id {
|
|
//line search.html:56
|
|
qw422016.N().S(`selected`)
|
|
//line search.html:56
|
|
}
|
|
//line search.html:56
|
|
qw422016.N().S(`>`)
|
|
//line search.html:56
|
|
qw422016.N().S(s.name)
|
|
//line search.html:56
|
|
qw422016.N().S(`</option>
|
|
`)
|
|
//line search.html:57
|
|
}
|
|
|
|
//line search.html:57
|
|
func writesearchOption(qq422016 qtio422016.Writer, selected string, s searchField) {
|
|
//line search.html:57
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line search.html:57
|
|
streamsearchOption(qw422016, selected, s)
|
|
//line search.html:57
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line search.html:57
|
|
}
|
|
|
|
//line search.html:57
|
|
func searchOption(selected string, s searchField) string {
|
|
//line search.html:57
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line search.html:57
|
|
writesearchOption(qb422016, selected, s)
|
|
//line search.html:57
|
|
qs422016 := string(qb422016.B)
|
|
//line search.html:57
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line search.html:57
|
|
return qs422016
|
|
//line search.html:57
|
|
}
|
|
|
|
//line search.html:59
|
|
func StreamSearchAdvanced(qw422016 *qt422016.Writer, nav Navigation, search SearchForm) {
|
|
//line search.html:59
|
|
qw422016.N().S(`
|
|
<select name="sort" class="form-control input-sm">
|
|
`)
|
|
//line search.html:61
|
|
streamsearchOptions(qw422016, search.Sort, []searchField{
|
|
{"torrent_id", "ID"},
|
|
{"torrent_name", "Name"},
|
|
{"date", "Date"},
|
|
{"downloads", "Downloads"},
|
|
{"filesize", "Size"},
|
|
})
|
|
//line search.html:67
|
|
qw422016.N().S(`
|
|
</select>
|
|
<select name="order" class="form-control input-sm">
|
|
`)
|
|
//line search.html:70
|
|
streamsearchOptions(qw422016, search.Order, []searchField{
|
|
{"desc", "Descending"},
|
|
{"asc", "Ascending"},
|
|
})
|
|
//line search.html:73
|
|
qw422016.N().S(`
|
|
</select>
|
|
<select name="max" class="form-control input-sm">
|
|
`)
|
|
//line search.html:76
|
|
sel := strconv.Itoa(nav.MaxItemPerPage)
|
|
|
|
//line search.html:76
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:77
|
|
for _, m := range [...]int{5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 70, 100, 150, 200, 300} {
|
|
//line search.html:77
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:78
|
|
id := strconv.Itoa(m)
|
|
|
|
//line search.html:78
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:79
|
|
streamsearchOption(qw422016, sel, searchField{id, id})
|
|
//line search.html:79
|
|
qw422016.N().S(`
|
|
`)
|
|
//line search.html:80
|
|
}
|
|
//line search.html:80
|
|
qw422016.N().S(`
|
|
</select>
|
|
`)
|
|
//line search.html:82
|
|
}
|
|
|
|
//line search.html:82
|
|
func WriteSearchAdvanced(qq422016 qtio422016.Writer, nav Navigation, search SearchForm) {
|
|
//line search.html:82
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line search.html:82
|
|
StreamSearchAdvanced(qw422016, nav, search)
|
|
//line search.html:82
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line search.html:82
|
|
}
|
|
|
|
//line search.html:82
|
|
func SearchAdvanced(nav Navigation, search SearchForm) string {
|
|
//line search.html:82
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line search.html:82
|
|
WriteSearchAdvanced(qb422016, nav, search)
|
|
//line search.html:82
|
|
qs422016 := string(qb422016.B)
|
|
//line search.html:82
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line search.html:82
|
|
return qs422016
|
|
//line search.html:82
|
|
}
|
|
|
|
//line search.html:84
|
|
func StreamSearchButton(qw422016 *qt422016.Writer, search SearchForm) {
|
|
//line search.html:84
|
|
qw422016.N().S(`
|
|
<div class="input-group">
|
|
<input name="q" class="form-control input-sm" placeholder="Search" type="text" value="`)
|
|
//line search.html:86
|
|
qw422016.E().S(search.Query)
|
|
//line search.html:86
|
|
qw422016.N().S(`">
|
|
<span class="input-group-btn">
|
|
<button type="submit" class="btn btn-sm btn-success">
|
|
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
|
|
Search
|
|
</button>
|
|
</span>
|
|
</div>
|
|
`)
|
|
//line search.html:94
|
|
}
|
|
|
|
//line search.html:94
|
|
func WriteSearchButton(qq422016 qtio422016.Writer, search SearchForm) {
|
|
//line search.html:94
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line search.html:94
|
|
StreamSearchButton(qw422016, search)
|
|
//line search.html:94
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line search.html:94
|
|
}
|
|
|
|
//line search.html:94
|
|
func SearchButton(search SearchForm) string {
|
|
//line search.html:94
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line search.html:94
|
|
WriteSearchButton(qb422016, search)
|
|
//line search.html:94
|
|
qs422016 := string(qb422016.B)
|
|
//line search.html:94
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line search.html:94
|
|
return qs422016
|
|
//line search.html:94
|
|
}
|