Documentation ¶
Index ¶
- Constants
- Variables
- func Commonvariables(c *gin.Context) jet.VarMap
- func DatabaseDump(c *gin.Context, listDumps []models.DatabaseDumpJSON, GPGLink string)
- func Form(c *gin.Context, templateName string, form interface{})
- func HttpError(c *gin.Context, errorCode int)
- func ModelList(c *gin.Context, templateName string, models interface{}, nav Navigation, ...)
- func NewPanelCommonvariables(c *gin.Context) jet.VarMap
- func PanelAdmin(c *gin.Context, torrent []models.Torrent, reports []models.TorrentReportJSON, ...)
- func Render(c *gin.Context, templateName string, variables jet.VarMap)
- func Static(c *gin.Context, templateName string)
- func Torrent(c *gin.Context, torrent models.TorrentJSON, ...)
- func UserProfile(c *gin.Context, userProfile *models.User)
- func UserProfileEdit(c *gin.Context, userProfile *models.User, userForm userValidator.UserForm, ...)
- func UserProfileNotifications(c *gin.Context, userProfile *models.User)
- type LanguagesJSONResponse
- type Navigation
- type SearchForm
Constants ¶
const ErrorsDir = "errors"
ErrorsDir : Variable pointing to the errors page templates
const ModeratorDir = "admin"
ModeratorDir : Variable to the admin template sub directory
const SiteDir = "site"
SiteDir : Variable pointing to the site page templates
const TemplateDir = "./templates" // FIXME: Need to be a constant!
TemplateDir : Variable to the template directory
Variables ¶
var View = jet.NewHTMLSet("./templates")
View : Jet Template Renderer
Functions ¶
func Commonvariables ¶
Commonvariables return a jet.VarMap variable containing the necessary variables to run index layouts
func DatabaseDump ¶
func DatabaseDump(c *gin.Context, listDumps []models.DatabaseDumpJSON, GPGLink string)
DatabaseDump render the list of database dumps template
func ModelList ¶
func ModelList(c *gin.Context, templateName string, models interface{}, nav Navigation, search SearchForm)
ModelList render list models templates
func NewPanelCommonvariables ¶
NewPanelCommonvariables return a jet.VarMap variable containing the necessary variables to run index admin layouts
func PanelAdmin ¶
func PanelAdmin(c *gin.Context, torrent []models.Torrent, reports []models.TorrentReportJSON, users []models.User, comments []models.Comment)
PanelAdmin render the panel admin template index
func Torrent ¶
func Torrent(c *gin.Context, torrent models.TorrentJSON, rootFolder *filelist.FileListFolder, captchaID string)
Torrent render a torrent view template
func UserProfile ¶
UserProfile render a user profile
func UserProfileEdit ¶
func UserProfileEdit(c *gin.Context, userProfile *models.User, userForm userValidator.UserForm, languages publicSettings.Languages)
UserProfileEdit render a form to edit a profile
Types ¶
type LanguagesJSONResponse ¶
type LanguagesJSONResponse struct { Current string `json:"current"` Languages publicSettings.Languages `json:"language"` }
LanguagesJSONResponse : Structure containing all the languages to parse it as a JSON response
type Navigation ¶
type Navigation struct {}
Navigation is used to display navigation links to pages on list view
func NewNavigation ¶
func NewNavigation() Navigation
NewNavigation return a navigation struct with Some Default Values to ease things out
type SearchForm ¶
type SearchForm struct { structs.TorrentParam Category string ShowItemsPerPage bool ShowRefine bool SizeType string DateType string MinSize string MaxSize string FromDate string ToDate string }
SearchForm struct used to display the search form
func NewPanelSearchForm ¶
func NewPanelSearchForm(c *gin.Context) SearchForm
NewPanelSearchForm : Helper that creates a search form without items/page field these need to be used when the templateVariables don't include `navigation`
func NewSearchForm ¶
func NewSearchForm(c *gin.Context) SearchForm
NewSearchForm return a searchForm struct with Some Default Values to ease things out