diff --git a/common/counters.go b/common/counters.go
index 87932509..f003d302 100644
--- a/common/counters.go
+++ b/common/counters.go
@@ -245,20 +245,3 @@ func (counter *DefaultTopicViewCounter) Bump(topicID int) {
counter.oddLock.Unlock()
}
}
-
-type TreeCounterNode struct {
- Value int64
- Zero *TreeCounterNode
- One *TreeCounterNode
- Parent *TreeCounterNode
-}
-
-// MEGA EXPERIMENTAL. Start from the right-most bits in the integer and move leftwards
-type TreeTopicViewCounter struct {
- zero *TreeCounterNode
- one *TreeCounterNode
-}
-
-func (counter *TreeTopicViewCounter) Bump(topicID int64) {
-
-}
diff --git a/common/pages.go b/common/pages.go
index 30a6b535..e730fa2a 100644
--- a/common/pages.go
+++ b/common/pages.go
@@ -125,6 +125,7 @@ type PanelPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
ItemList []interface{}
Something interface{}
}
@@ -144,6 +145,7 @@ type PanelDashboardPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
GridItems []GridElement
}
@@ -152,6 +154,7 @@ type PanelThemesPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
PrimaryThemes []*Theme
VariantThemes []*Theme
}
@@ -161,6 +164,7 @@ type PanelUserPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
ItemList []User
PageList []int
Page int
@@ -172,6 +176,7 @@ type PanelGroupPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
ItemList []GroupAdmin
PageList []int
Page int
@@ -183,6 +188,7 @@ type PanelEditGroupPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
ID int
Name string
Tag string
@@ -200,6 +206,7 @@ type PanelEditForumPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
ID int
Name string
Desc string
@@ -208,11 +215,6 @@ type PanelEditForumPage struct {
Groups []GroupForumPermPreset
}
-/*type NameLangPair struct {
- Name string
- LangStr string
-}*/
-
type NameLangToggle struct {
Name string
LangStr string
@@ -224,6 +226,7 @@ type PanelEditGroupPermsPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
ID int
Name string
LocalPerms []NameLangToggle
@@ -243,6 +246,7 @@ type PanelBackupPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
Backups []BackupItem
}
@@ -257,6 +261,7 @@ type PanelLogsPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
Logs []LogItem
PageList []int
Page int
@@ -268,6 +273,7 @@ type PanelDebugPage struct {
CurrentUser User
Header *HeaderVars
Stats PanelStats
+ Zone string
Uptime string
OpenConns int
DBAdapter string
diff --git a/common/tasks.go b/common/tasks.go
index 0069bb19..aaf36dc3 100644
--- a/common/tasks.go
+++ b/common/tasks.go
@@ -25,6 +25,7 @@ var ShutdownTasks []func() error
var taskStmts TaskStmts
var lastSync time.Time
+// TODO: Add a TaskInits.Add
func init() {
lastSync = time.Now()
DbInits.Add(func(acc *qgen.Accumulator) error {
diff --git a/panel_routes.go b/panel_routes.go
index 895b790f..87920119 100644
--- a/panel_routes.go
+++ b/panel_routes.go
@@ -141,7 +141,7 @@ func routePanel(w http.ResponseWriter, r *http.Request, user common.User) common
gridElements = append(gridElements, common.GridElement{"dash-visitorsperweek", "2 visitors / week", 13, "grid_stat stat_disabled", "", "", "Coming Soon!" /*"The number of unique visitors we've had over the last 7 days"*/})
gridElements = append(gridElements, common.GridElement{"dash-postsperuser", "5 posts / user / week", 14, "grid_stat stat_disabled", "", "", "Coming Soon!" /*"The average number of posts made by each active user over the past week"*/})
- pi := common.PanelDashboardPage{common.GetTitlePhrase("panel-dashboard"), user, headerVars, stats, gridElements}
+ pi := common.PanelDashboardPage{common.GetTitlePhrase("panel-dashboard"), user, headerVars, stats, "dashboard", gridElements}
if common.PreRenderHooks["pre_render_panel_dashboard"] != nil {
if common.RunPreRenderHook("pre_render_panel_dashboard", w, r, &user, &pi) {
return nil
@@ -180,7 +180,7 @@ func routePanelForums(w http.ResponseWriter, r *http.Request, user common.User)
forumList = append(forumList, fadmin)
}
}
- pi := common.PanelPage{common.GetTitlePhrase("panel-forums"), user, headerVars, stats, forumList, nil}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-forums"), user, headerVars, stats, "forums", forumList, nil}
if common.PreRenderHooks["pre_render_panel_forums"] != nil {
if common.RunPreRenderHook("pre_render_panel_forums", w, r, &user, &pi) {
return nil
@@ -244,7 +244,7 @@ func routePanelForumsDelete(w http.ResponseWriter, r *http.Request, user common.
confirmMsg := "Are you sure you want to delete the '" + forum.Name + "' forum?"
yousure := common.AreYouSure{"/panel/forums/delete/submit/" + strconv.Itoa(fid), confirmMsg}
- pi := common.PanelPage{common.GetTitlePhrase("panel-delete-forum"), user, headerVars, stats, tList, yousure}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-delete-forum"), user, headerVars, stats, "forums", tList, yousure}
if common.PreRenderHooks["pre_render_panel_delete_forum"] != nil {
if common.RunPreRenderHook("pre_render_panel_delete_forum", w, r, &user, &pi) {
return nil
@@ -320,7 +320,7 @@ func routePanelForumsEdit(w http.ResponseWriter, r *http.Request, user common.Us
gplist = append(gplist, common.GroupForumPermPreset{group, common.ForumPermsToGroupForumPreset(group.Forums[fid])})
}
- pi := common.PanelEditForumPage{common.GetTitlePhrase("panel-edit-forum"), user, headerVars, stats, forum.ID, forum.Name, forum.Desc, forum.Active, forum.Preset, gplist}
+ pi := common.PanelEditForumPage{common.GetTitlePhrase("panel-edit-forum"), user, headerVars, stats, "forums", forum.ID, forum.Name, forum.Desc, forum.Active, forum.Preset, gplist}
if common.PreRenderHooks["pre_render_panel_edit_forum"] != nil {
if common.RunPreRenderHook("pre_render_panel_edit_forum", w, r, &user, &pi) {
return nil
@@ -458,7 +458,7 @@ func routePanelSettings(w http.ResponseWriter, r *http.Request, user common.User
settingList[setting.Name] = setting.Content
}
- pi := common.PanelPage{common.GetTitlePhrase("panel-settings"), user, headerVars, stats, tList, settingList}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-settings"), user, headerVars, stats, "settings", tList, settingList}
if common.PreRenderHooks["pre_render_panel_settings"] != nil {
if common.RunPreRenderHook("pre_render_panel_settings", w, r, &user, &pi) {
return nil
@@ -504,7 +504,7 @@ func routePanelSettingEdit(w http.ResponseWriter, r *http.Request, user common.U
}
}
- pi := common.PanelPage{common.GetTitlePhrase("panel-edit-setting"), user, headerVars, stats, itemList, setting}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-edit-setting"), user, headerVars, stats, "settings", itemList, setting}
if common.PreRenderHooks["pre_render_panel_setting"] != nil {
if common.RunPreRenderHook("pre_render_panel_setting", w, r, &user, &pi) {
return nil
@@ -549,7 +549,7 @@ func routePanelWordFilters(w http.ResponseWriter, r *http.Request, user common.U
}
var filterList = common.WordFilterBox.Load().(common.WordFilterMap)
- pi := common.PanelPage{common.GetTitlePhrase("panel-word-filters"), user, headerVars, stats, tList, filterList}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-word-filters"), user, headerVars, stats, "word-filters", tList, filterList}
if common.PreRenderHooks["pre_render_panel_word_filters"] != nil {
if common.RunPreRenderHook("pre_render_panel_word_filters", w, r, &user, &pi) {
return nil
@@ -610,7 +610,7 @@ func routePanelWordFiltersEdit(w http.ResponseWriter, r *http.Request, user comm
_ = wfid
- pi := common.PanelPage{common.GetTitlePhrase("panel-edit-word-filter"), user, headerVars, stats, tList, nil}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-edit-word-filter"), user, headerVars, stats, "word-filters", tList, nil}
if common.PreRenderHooks["pre_render_panel_word_filters_edit"] != nil {
if common.RunPreRenderHook("pre_render_panel_word_filters_edit", w, r, &user, &pi) {
return nil
@@ -703,7 +703,7 @@ func routePanelPlugins(w http.ResponseWriter, r *http.Request, user common.User)
pluginList = append(pluginList, plugin)
}
- pi := common.PanelPage{common.GetTitlePhrase("panel-plugins"), user, headerVars, stats, pluginList, nil}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-plugins"), user, headerVars, stats, "plugins", pluginList, nil}
if common.PreRenderHooks["pre_render_panel_plugins"] != nil {
if common.RunPreRenderHook("pre_render_panel_plugins", w, r, &user, &pi) {
return nil
@@ -924,7 +924,7 @@ func routePanelUsers(w http.ResponseWriter, r *http.Request, user common.User) c
}
pageList := common.Paginate(stats.Users, perPage, 5)
- pi := common.PanelUserPage{common.GetTitlePhrase("panel-users"), user, headerVars, stats, userList, pageList, page, lastPage}
+ pi := common.PanelUserPage{common.GetTitlePhrase("panel-users"), user, headerVars, stats, "users", userList, pageList, page, lastPage}
if common.PreRenderHooks["pre_render_panel_users"] != nil {
if common.RunPreRenderHook("pre_render_panel_users", w, r, &user, &pi) {
return nil
@@ -979,7 +979,7 @@ func routePanelUsersEdit(w http.ResponseWriter, r *http.Request, user common.Use
groupList = append(groupList, group)
}
- pi := common.PanelPage{common.GetTitlePhrase("panel-edit-user"), user, headerVars, stats, groupList, targetUser}
+ pi := common.PanelPage{common.GetTitlePhrase("panel-edit-user"), user, headerVars, stats, "users", groupList, targetUser}
if common.PreRenderHooks["pre_render_panel_edit_user"] != nil {
if common.RunPreRenderHook("pre_render_panel_edit_user", w, r, &user, &pi) {
return nil
@@ -1120,7 +1120,7 @@ func routePanelGroups(w http.ResponseWriter, r *http.Request, user common.User)
//log.Printf("groupList: %+v\n", groupList)
pageList := common.Paginate(stats.Groups, perPage, 5)
- pi := common.PanelGroupPage{common.GetTitlePhrase("panel-groups"), user, headerVars, stats, groupList, pageList, page, lastPage}
+ pi := common.PanelGroupPage{common.GetTitlePhrase("panel-groups"), user, headerVars, stats, "groups", groupList, pageList, page, lastPage}
if common.PreRenderHooks["pre_render_panel_groups"] != nil {
if common.RunPreRenderHook("pre_render_panel_groups", w, r, &user, &pi) {
return nil
@@ -1179,7 +1179,7 @@ func routePanelGroupsEdit(w http.ResponseWriter, r *http.Request, user common.Us
disableRank := !user.Perms.EditGroupGlobalPerms || (group.ID == 6)
- pi := common.PanelEditGroupPage{common.GetTitlePhrase("panel-edit-group"), user, headerVars, stats, group.ID, group.Name, group.Tag, rank, disableRank}
+ pi := common.PanelEditGroupPage{common.GetTitlePhrase("panel-edit-group"), user, headerVars, stats, "groups", group.ID, group.Name, group.Tag, rank, disableRank}
if common.PreRenderHooks["pre_render_panel_edit_group"] != nil {
if common.RunPreRenderHook("pre_render_panel_edit_group", w, r, &user, &pi) {
return nil
@@ -1257,7 +1257,7 @@ func routePanelGroupsEditPerms(w http.ResponseWriter, r *http.Request, user comm
globalPerms = append(globalPerms, common.NameLangToggle{"ViewIPs", common.GetGlobalPermPhrase("ViewIPs"), group.Perms.ViewIPs})
globalPerms = append(globalPerms, common.NameLangToggle{"UploadFiles", common.GetGlobalPermPhrase("UploadFiles"), group.Perms.UploadFiles})
- pi := common.PanelEditGroupPermsPage{common.GetTitlePhrase("panel-edit-group"), user, headerVars, stats, group.ID, group.Name, localPerms, globalPerms}
+ pi := common.PanelEditGroupPermsPage{common.GetTitlePhrase("panel-edit-group"), user, headerVars, stats, "groups", group.ID, group.Name, localPerms, globalPerms}
if common.PreRenderHooks["pre_render_panel_edit_group_perms"] != nil {
if common.RunPreRenderHook("pre_render_panel_edit_group_perms", w, r, &user, &pi) {
return nil
@@ -1486,7 +1486,7 @@ func routePanelThemes(w http.ResponseWriter, r *http.Request, user common.User)
}
- pi := common.PanelThemesPage{common.GetTitlePhrase("panel-themes"), user, headerVars, stats, pThemeList, vThemeList}
+ pi := common.PanelThemesPage{common.GetTitlePhrase("panel-themes"), user, headerVars, stats, "themes", pThemeList, vThemeList}
if common.PreRenderHooks["pre_render_panel_themes"] != nil {
if common.RunPreRenderHook("pre_render_panel_themes", w, r, &user, &pi) {
return nil
@@ -1603,7 +1603,7 @@ func routePanelBackups(w http.ResponseWriter, r *http.Request, user common.User,
backupList = append(backupList, common.BackupItem{backupFile.Name(), backupFile.ModTime()})
}
- pi := common.PanelBackupPage{common.GetTitlePhrase("panel-backups"), user, headerVars, stats, backupList}
+ pi := common.PanelBackupPage{common.GetTitlePhrase("panel-backups"), user, headerVars, stats, "backups", backupList}
err = common.Templates.ExecuteTemplate(w, "panel-backups.html", pi)
if err != nil {
return common.InternalError(err, w, r)
@@ -1701,7 +1701,7 @@ func routePanelLogsMod(w http.ResponseWriter, r *http.Request, user common.User)
}
pageList := common.Paginate(logCount, perPage, 5)
- pi := common.PanelLogsPage{common.GetTitlePhrase("panel-mod-logs"), user, headerVars, stats, logs, pageList, page, lastPage}
+ pi := common.PanelLogsPage{common.GetTitlePhrase("panel-mod-logs"), user, headerVars, stats, "logs", logs, pageList, page, lastPage}
if common.PreRenderHooks["pre_render_panel_mod_log"] != nil {
if common.RunPreRenderHook("pre_render_panel_mod_log", w, r, &user, &pi) {
return nil
@@ -1725,7 +1725,7 @@ func routePanelDebug(w http.ResponseWriter, r *http.Request, user common.User) c
openConnCount := dbStats.OpenConnections
// Disk I/O?
- pi := common.PanelDebugPage{common.GetTitlePhrase("panel-debug"), user, headerVars, stats, uptime, openConnCount, dbAdapter}
+ pi := common.PanelDebugPage{common.GetTitlePhrase("panel-debug"), user, headerVars, stats, "debug", uptime, openConnCount, dbAdapter}
err := common.Templates.ExecuteTemplate(w, "panel-debug.html", pi)
if err != nil {
return common.InternalError(err, w, r)
diff --git a/routes.go b/routes.go
index 1cfdfb01..f19d1d08 100644
--- a/routes.go
+++ b/routes.go
@@ -303,7 +303,6 @@ func routeForum(w http.ResponseWriter, r *http.Request, user common.User, sfid s
return common.InternalError(err, w, r)
}
headerVars.Zone = "view_forum"
- headerVars.MetaDesc = headerVars.Settings["meta_desc"].(string)
// Calculate the offset
var offset int
@@ -390,6 +389,7 @@ func routeForums(w http.ResponseWriter, r *http.Request, user common.User) commo
return ferr
}
headerVars.Zone = "forums"
+ headerVars.MetaDesc = headerVars.Settings["meta_desc"].(string)
var err error
var forumList []common.Forum
diff --git a/templates/forum.html b/templates/forum.html
index f471d2a3..3815db79 100644
--- a/templates/forum.html
+++ b/templates/forum.html
@@ -4,10 +4,10 @@
{{if ne .LastPage .Page}}
{{end}}
-
+
-
{{.Title}}
+ {{.Title}}
{{if ne .CurrentUser.ID 0}}
{{if .CurrentUser.Perms.CreateTopic}}
@@ -74,7 +74,7 @@
- {{.Title}}
+ {{.Title}}
{{.Creator.Name}}
{{/** TODO: Avoid the double '|' when both .IsClosed and .Sticky are set to true. We could probably do this with CSS **/}}
{{if .IsClosed}} | 🔒︎ {{end}}
diff --git a/templates/forums.html b/templates/forums.html
index 49b46d70..b8de4a45 100644
--- a/templates/forums.html
+++ b/templates/forums.html
@@ -1,15 +1,16 @@
{{template "header.html" . }}
-
+
- {{range .ItemList}}
+ {{range .ItemList}}
- {{.Name}}
+ {{.Name}}
{{if .Desc}}
- {{.Desc}}
+ {{.Desc}}
{{else}}
No description
{{end}}
diff --git a/templates/panel-adminlogs.html b/templates/panel-adminlogs.html
index 1f9d110c..cff37288 100644
--- a/templates/panel-adminlogs.html
+++ b/templates/panel-adminlogs.html
@@ -1,43 +1,42 @@
{{template "header.html" . }}
-
-
-
-
+
+
+
+
{{template "panel-inner-menu.html" . }}
-
-
-
-
- {{range .Logs}}
-
-
- {{.Action}}
- {{.IPAddress}}
-
-
- {{.DoneAt}}
-
-
+
+
+
+
+ {{range .Logs}}
+
+
+ {{.Action}}
+ {{.IPAddress}}
+
+
+ {{.DoneAt}}
+
+
+
+ {{end}}
+
+ {{if gt .LastPage 1}}
+
+ {{if gt .Page 1}}
{{end}}
+ {{range .PageList}}
+
+ {{end}}
+ {{if ne .LastPage .Page}}
{{end}}
{{end}}
-
- {{if gt .LastPage 1}}
-
- {{if gt .Page 1}}
{{end}}
- {{range .PageList}}
-
- {{end}}
- {{if ne .LastPage .Page}}
{{end}}
-
- {{end}}
-
-
+
{{template "footer.html" . }}
diff --git a/templates/panel-backups.html b/templates/panel-backups.html
index b732112e..ffb5fdc9 100644
--- a/templates/panel-backups.html
+++ b/templates/panel-backups.html
@@ -1,22 +1,22 @@
{{template "header.html" . }}
-
-{{template "panel-menu.html" . }}
-
-
-
- {{range .Backups}}
-
-
{{.SQLURL}}
-
- Download
-
+
+ {{template "panel-menu.html" . }}
+
+
- {{else}}
- There aren't any backups available at this time.
- {{end}}
-
-
+
+ {{range .Backups}}
+
+ {{else}}
+
There aren't any backups available at this time.
+ {{end}}
+
+
{{template "footer.html" . }}
diff --git a/templates/panel-dashboard.html b/templates/panel-dashboard.html
index 38d7d254..2d2361f2 100644
--- a/templates/panel-dashboard.html
+++ b/templates/panel-dashboard.html
@@ -1,5 +1,5 @@
{{template "header.html" . }}
-
+
{{template "panel-menu.html" . }}
diff --git a/templates/panel-debug.html b/templates/panel-debug.html
index 51f0f56d..ced4b7ca 100644
--- a/templates/panel-debug.html
+++ b/templates/panel-debug.html
@@ -1,19 +1,19 @@
{{template "header.html" . }}
-
+
{{template "panel-menu.html" . }}
-
-
-
-
Uptime
-
Open DB Conns
-
Adapter
+
+
+
+
Uptime
+
Open DB Conns
+
Adapter
-
{{.Uptime}}
-
{{.OpenConns}}
-
{{.DBAdapter}}
-
-
+
{{.Uptime}}
+
{{.OpenConns}}
+
{{.DBAdapter}}
+
+
{{template "footer.html" . }}
diff --git a/templates/panel-forum-edit.html b/templates/panel-forum-edit.html
index 2cd22ec1..43bf8132 100644
--- a/templates/panel-forum-edit.html
+++ b/templates/panel-forum-edit.html
@@ -1,6 +1,6 @@
{{template "header.html" . }}
-
+
{{template "panel-menu.html" . }}