634f48a748
Design copied from NyaaTorrents Reorganised some sql queries Added dynamic navigation within torrents Added nesting templates support Added more variables/functions imported in the templates Separated templates functions and variables in other files for more clarity
37 lignes
887 o
Go
37 lignes
887 o
Go
package main
|
|
|
|
import (
|
|
"net/url"
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
/* Each Page should have an object to pass to their own template
|
|
* Therefore, we put them in a separate file for better maintenance
|
|
*/
|
|
|
|
type FaqTemplateVariables struct {
|
|
URL *url.URL // For parsing Url in templates
|
|
Route *mux.Route // For getting current route in templates
|
|
Query string
|
|
Status string
|
|
Category string
|
|
Navigation Navigation
|
|
}
|
|
|
|
type HomeTemplateVariables struct {
|
|
ListTorrents []TorrentsJson
|
|
ListCategories []Categories
|
|
Query string
|
|
Status string
|
|
Category string
|
|
Navigation Navigation
|
|
URL *url.URL // For parsing Url in templates
|
|
Route *mux.Route // For getting current route in templates
|
|
}
|
|
|
|
type Navigation struct {
|
|
TotalItem int
|
|
MaxItemPerPage int
|
|
CurrentPage int
|
|
Route string
|
|
}
|