d7cf48e43d
Added a test for one of the router algorithms. Added the ViewAdminLogs permission. Adminlogs are coming soon! The empty comments next to HandleFuncs on main.go are there to remind me about which routes I've added to the router generator route list. Fixed the Modlogs Page so that you can view it without the ManageThemes permissions. I accidentally used the wrong permission there before. Changed the router algorithm to align better with the upcoming generated router. It's faster too.
28 lines
592 B
Go
28 lines
592 B
Go
package main
|
|
|
|
type Route struct {
|
|
Name string
|
|
Path string
|
|
Vars []string
|
|
}
|
|
|
|
type RouteGroup struct {
|
|
Path string
|
|
Routes []Route
|
|
}
|
|
|
|
func addRoute(fname string, path string, vars ...string) {
|
|
route_list = append(route_list,Route{fname,path,vars})
|
|
}
|
|
|
|
func addRouteGroup(path string, routes ...Route) {
|
|
route_groups = append(route_groups,RouteGroup{path,routes})
|
|
}
|
|
|
|
func routes() {
|
|
//addRoute("route_static","/static/","&extra_data")
|
|
addRoute("route_overview","/overview/")
|
|
addRoute("route_custom_page","/pages/","&extra_data")
|
|
addRoute("route_topics","/topics/","&groups","&forums")
|
|
}
|