2017-05-06 23:16:21 +02:00
// 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" } ,
2017-05-06 23:26:46 +02:00
{ "filesize" , "Size" } ,
2017-05-06 23:16:21 +02:00
} )
2017-05-06 23:26:46 +02:00
//line search.html:67
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
< / select >
< select name = "order" class = "form-control input-sm" >
` )
2017-05-06 23:26:46 +02:00
//line search.html:70
2017-05-06 23:16:21 +02:00
streamsearchOptions ( qw422016 , search . Order , [ ] searchField {
{ "desc" , "Descending" } ,
{ "asc" , "Ascending" } ,
} )
2017-05-06 23:26:46 +02:00
//line search.html:73
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
< / select >
< select name = "max" class = "form-control input-sm" >
` )
2017-05-06 23:26:46 +02:00
//line search.html:76
2017-05-06 23:16:21 +02:00
sel := strconv . Itoa ( nav . MaxItemPerPage )
2017-05-06 23:26:46 +02:00
//line search.html:76
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
` )
2017-05-06 23:26:46 +02:00
//line search.html:77
2017-05-06 23:16:21 +02:00
for _ , m := range [ ... ] int { 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 45 , 50 , 70 , 100 , 150 , 200 , 300 } {
2017-05-06 23:26:46 +02:00
//line search.html:77
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
` )
2017-05-06 23:26:46 +02:00
//line search.html:78
2017-05-06 23:16:21 +02:00
id := strconv . Itoa ( m )
2017-05-06 23:26:46 +02:00
//line search.html:78
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
` )
2017-05-06 23:26:46 +02:00
//line search.html:79
2017-05-06 23:16:21 +02:00
streamsearchOption ( qw422016 , sel , searchField { id , id } )
2017-05-06 23:26:46 +02:00
//line search.html:79
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
` )
2017-05-06 23:26:46 +02:00
//line search.html:80
2017-05-06 23:16:21 +02:00
}
2017-05-06 23:26:46 +02:00
//line search.html:80
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
< / select >
` )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
}
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
func WriteSearchAdvanced ( qq422016 qtio422016 . Writer , nav Navigation , search SearchForm ) {
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
StreamSearchAdvanced ( qw422016 , nav , search )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
}
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
func SearchAdvanced ( nav Navigation , search SearchForm ) string {
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
WriteSearchAdvanced ( qb422016 , nav , search )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
qs422016 := string ( qb422016 . B )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
return qs422016
2017-05-06 23:26:46 +02:00
//line search.html:82
2017-05-06 23:16:21 +02:00
}
2017-05-06 23:26:46 +02:00
//line search.html:84
2017-05-06 23:16:21 +02:00
func StreamSearchButton ( qw422016 * qt422016 . Writer , search SearchForm ) {
2017-05-06 23:26:46 +02:00
//line search.html:84
2017-05-06 23:16:21 +02:00
qw422016 . N ( ) . S ( `
< div class = "input-group" >
< input name = "q" class = "form-control input-sm" placeholder = "Search" type = "text" value = " ` )
2017-05-06 23:26:46 +02:00
//line search.html:86
2017-05-06 23:16:21 +02:00
qw422016 . E ( ) . S ( search . Query )
2017-05-06 23:26:46 +02:00
//line search.html:86
2017-05-06 23:16:21 +02:00
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 >
` )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
}
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
func WriteSearchButton ( qq422016 qtio422016 . Writer , search SearchForm ) {
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
qw422016 := qt422016 . AcquireWriter ( qq422016 )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
StreamSearchButton ( qw422016 , search )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
qt422016 . ReleaseWriter ( qw422016 )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
}
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
func SearchButton ( search SearchForm ) string {
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
qb422016 := qt422016 . AcquireByteBuffer ( )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
WriteSearchButton ( qb422016 , search )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
qs422016 := string ( qb422016 . B )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
qt422016 . ReleaseByteBuffer ( qb422016 )
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
return qs422016
2017-05-06 23:26:46 +02:00
//line search.html:94
2017-05-06 23:16:21 +02:00
}