Made some minor tweaks.
The DefaultRoute parameter in the configuration struct is now a string. Fixed a few mismatched HTML tags. Added the profile_comments_row template. Added more alt attributes for images and associated title=""s in a few places. Connections should now be closed properly. Custom Pages no longer have a .html file extension in their URLs. We now track route views for the default route and the custom page route. Began work on cleaning up the profiles on Cosora.
This commit is contained in:
parent
386e835b86
commit
bdbd80319f
|
@ -32,10 +32,8 @@ func NewChunkedViewCounter() (*ChunkedViewCounter, error) {
|
||||||
|
|
||||||
func (counter *ChunkedViewCounter) Tick() (err error) {
|
func (counter *ChunkedViewCounter) Tick() (err error) {
|
||||||
var oldBucket = counter.currentBucket
|
var oldBucket = counter.currentBucket
|
||||||
var nextBucket int64
|
var nextBucket int64 // 0
|
||||||
if counter.currentBucket == 1 {
|
if counter.currentBucket == 0 {
|
||||||
nextBucket = 0
|
|
||||||
} else {
|
|
||||||
nextBucket = 1
|
nextBucket = 1
|
||||||
}
|
}
|
||||||
atomic.AddInt64(&counter.buckets[oldBucket], counter.buckets[nextBucket])
|
atomic.AddInt64(&counter.buckets[oldBucket], counter.buckets[nextBucket])
|
||||||
|
|
|
@ -165,7 +165,7 @@ func shortcodeToUnicode(msg string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func PreparseMessage(msg string) string {
|
func PreparseMessage(msg string) string {
|
||||||
msg = strings.Replace(msg, "<p><br>", "<br>", -1)
|
msg = strings.Replace(msg, "<p><br>", "\n", -1)
|
||||||
msg = strings.Replace(msg, "<p>", "\n", -1)
|
msg = strings.Replace(msg, "<p>", "\n", -1)
|
||||||
msg = strings.Replace(msg, "</p>", "", -1)
|
msg = strings.Replace(msg, "</p>", "", -1)
|
||||||
msg = strings.Replace(msg, "<br>", "\n", -1)
|
msg = strings.Replace(msg, "<br>", "\n", -1)
|
||||||
|
|
|
@ -2,7 +2,6 @@ package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -61,7 +60,7 @@ type config struct {
|
||||||
SMTPPort string
|
SMTPPort string
|
||||||
//SMTPEnableTLS bool
|
//SMTPEnableTLS bool
|
||||||
|
|
||||||
DefaultRoute func(http.ResponseWriter, *http.Request, User) RouteError
|
DefaultRoute string
|
||||||
DefaultGroup int
|
DefaultGroup int
|
||||||
ActivationGroup int
|
ActivationGroup int
|
||||||
StaffCSS string // ? - Move this into the settings table? Might be better to implement this as Group CSS
|
StaffCSS string // ? - Move this into the settings table? Might be better to implement this as Group CSS
|
||||||
|
|
|
@ -41,6 +41,7 @@ type Theme struct {
|
||||||
MobileFriendly bool
|
MobileFriendly bool
|
||||||
Disabled bool
|
Disabled bool
|
||||||
HideFromThemes bool
|
HideFromThemes bool
|
||||||
|
BgAvatars bool // For profiles, at the moment
|
||||||
ForkOf string
|
ForkOf string
|
||||||
Tag string
|
Tag string
|
||||||
URL string
|
URL string
|
||||||
|
|
|
@ -45,7 +45,7 @@ func init() {
|
||||||
common.Config.SMTPPort = "25"
|
common.Config.SMTPPort = "25"
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
common.Config.DefaultRoute = routeTopics
|
common.Config.DefaultRoute = "routeTopics"
|
||||||
common.Config.DefaultGroup = 3 // Should be a setting in the database
|
common.Config.DefaultGroup = 3 // Should be a setting in the database
|
||||||
common.Config.ActivationGroup = 5 // Should be a setting in the database
|
common.Config.ActivationGroup = 5 // Should be a setting in the database
|
||||||
common.Config.StaffCSS = "staff_post"
|
common.Config.StaffCSS = "staff_post"
|
||||||
|
|
349
gen_router.go
349
gen_router.go
|
@ -17,6 +17,7 @@ var ErrNoRoute = errors.New("That route doesn't exist.")
|
||||||
var RouteMap = map[string]interface{}{
|
var RouteMap = map[string]interface{}{
|
||||||
"routeAPI": routeAPI,
|
"routeAPI": routeAPI,
|
||||||
"routeOverview": routeOverview,
|
"routeOverview": routeOverview,
|
||||||
|
"routeCustomPage": routeCustomPage,
|
||||||
"routeForums": routeForums,
|
"routeForums": routeForums,
|
||||||
"routeForum": routeForum,
|
"routeForum": routeForum,
|
||||||
"routeChangeTheme": routeChangeTheme,
|
"routeChangeTheme": routeChangeTheme,
|
||||||
|
@ -77,118 +78,120 @@ var RouteMap = map[string]interface{}{
|
||||||
var routeMapEnum = map[string]int{
|
var routeMapEnum = map[string]int{
|
||||||
"routeAPI": 0,
|
"routeAPI": 0,
|
||||||
"routeOverview": 1,
|
"routeOverview": 1,
|
||||||
"routeForums": 2,
|
"routeCustomPage": 2,
|
||||||
"routeForum": 3,
|
"routeForums": 3,
|
||||||
"routeChangeTheme": 4,
|
"routeForum": 4,
|
||||||
"routeShowAttachment": 5,
|
"routeChangeTheme": 5,
|
||||||
"routeReportSubmit": 6,
|
"routeShowAttachment": 6,
|
||||||
"routeTopicCreate": 7,
|
"routeReportSubmit": 7,
|
||||||
"routeTopics": 8,
|
"routeTopicCreate": 8,
|
||||||
"routePanelForums": 9,
|
"routeTopics": 9,
|
||||||
"routePanelForumsCreateSubmit": 10,
|
"routePanelForums": 10,
|
||||||
"routePanelForumsDelete": 11,
|
"routePanelForumsCreateSubmit": 11,
|
||||||
"routePanelForumsDeleteSubmit": 12,
|
"routePanelForumsDelete": 12,
|
||||||
"routePanelForumsEdit": 13,
|
"routePanelForumsDeleteSubmit": 13,
|
||||||
"routePanelForumsEditSubmit": 14,
|
"routePanelForumsEdit": 14,
|
||||||
"routePanelForumsEditPermsSubmit": 15,
|
"routePanelForumsEditSubmit": 15,
|
||||||
"routePanelSettings": 16,
|
"routePanelForumsEditPermsSubmit": 16,
|
||||||
"routePanelSettingEdit": 17,
|
"routePanelSettings": 17,
|
||||||
"routePanelSettingEditSubmit": 18,
|
"routePanelSettingEdit": 18,
|
||||||
"routePanelWordFilters": 19,
|
"routePanelSettingEditSubmit": 19,
|
||||||
"routePanelWordFiltersCreate": 20,
|
"routePanelWordFilters": 20,
|
||||||
"routePanelWordFiltersEdit": 21,
|
"routePanelWordFiltersCreate": 21,
|
||||||
"routePanelWordFiltersEditSubmit": 22,
|
"routePanelWordFiltersEdit": 22,
|
||||||
"routePanelWordFiltersDeleteSubmit": 23,
|
"routePanelWordFiltersEditSubmit": 23,
|
||||||
"routePanelThemes": 24,
|
"routePanelWordFiltersDeleteSubmit": 24,
|
||||||
"routePanelThemesSetDefault": 25,
|
"routePanelThemes": 25,
|
||||||
"routePanelPlugins": 26,
|
"routePanelThemesSetDefault": 26,
|
||||||
"routePanelPluginsActivate": 27,
|
"routePanelPlugins": 27,
|
||||||
"routePanelPluginsDeactivate": 28,
|
"routePanelPluginsActivate": 28,
|
||||||
"routePanelPluginsInstall": 29,
|
"routePanelPluginsDeactivate": 29,
|
||||||
"routePanelUsers": 30,
|
"routePanelPluginsInstall": 30,
|
||||||
"routePanelUsersEdit": 31,
|
"routePanelUsers": 31,
|
||||||
"routePanelUsersEditSubmit": 32,
|
"routePanelUsersEdit": 32,
|
||||||
"routePanelGroups": 33,
|
"routePanelUsersEditSubmit": 33,
|
||||||
"routePanelGroupsEdit": 34,
|
"routePanelGroups": 34,
|
||||||
"routePanelGroupsEditPerms": 35,
|
"routePanelGroupsEdit": 35,
|
||||||
"routePanelGroupsEditSubmit": 36,
|
"routePanelGroupsEditPerms": 36,
|
||||||
"routePanelGroupsEditPermsSubmit": 37,
|
"routePanelGroupsEditSubmit": 37,
|
||||||
"routePanelGroupsCreateSubmit": 38,
|
"routePanelGroupsEditPermsSubmit": 38,
|
||||||
"routePanelBackups": 39,
|
"routePanelGroupsCreateSubmit": 39,
|
||||||
"routePanelLogsMod": 40,
|
"routePanelBackups": 40,
|
||||||
"routePanelDebug": 41,
|
"routePanelLogsMod": 41,
|
||||||
"routePanel": 42,
|
"routePanelDebug": 42,
|
||||||
"routeAccountEditCritical": 43,
|
"routePanel": 43,
|
||||||
"routeAccountEditCriticalSubmit": 44,
|
"routeAccountEditCritical": 44,
|
||||||
"routeAccountEditAvatar": 45,
|
"routeAccountEditCriticalSubmit": 45,
|
||||||
"routeAccountEditAvatarSubmit": 46,
|
"routeAccountEditAvatar": 46,
|
||||||
"routeAccountEditUsername": 47,
|
"routeAccountEditAvatarSubmit": 47,
|
||||||
"routeAccountEditUsernameSubmit": 48,
|
"routeAccountEditUsername": 48,
|
||||||
"routeAccountEditEmail": 49,
|
"routeAccountEditUsernameSubmit": 49,
|
||||||
"routeAccountEditEmailTokenSubmit": 50,
|
"routeAccountEditEmail": 50,
|
||||||
"routeProfile": 51,
|
"routeAccountEditEmailTokenSubmit": 51,
|
||||||
"routeBanSubmit": 52,
|
"routeProfile": 52,
|
||||||
"routeUnban": 53,
|
"routeBanSubmit": 53,
|
||||||
"routeActivate": 54,
|
"routeUnban": 54,
|
||||||
"routeIps": 55,
|
"routeActivate": 55,
|
||||||
|
"routeIps": 56,
|
||||||
}
|
}
|
||||||
var reverseRouteMapEnum = map[int]string{
|
var reverseRouteMapEnum = map[int]string{
|
||||||
0: "routeAPI",
|
0: "routeAPI",
|
||||||
1: "routeOverview",
|
1: "routeOverview",
|
||||||
2: "routeForums",
|
2: "routeCustomPage",
|
||||||
3: "routeForum",
|
3: "routeForums",
|
||||||
4: "routeChangeTheme",
|
4: "routeForum",
|
||||||
5: "routeShowAttachment",
|
5: "routeChangeTheme",
|
||||||
6: "routeReportSubmit",
|
6: "routeShowAttachment",
|
||||||
7: "routeTopicCreate",
|
7: "routeReportSubmit",
|
||||||
8: "routeTopics",
|
8: "routeTopicCreate",
|
||||||
9: "routePanelForums",
|
9: "routeTopics",
|
||||||
10: "routePanelForumsCreateSubmit",
|
10: "routePanelForums",
|
||||||
11: "routePanelForumsDelete",
|
11: "routePanelForumsCreateSubmit",
|
||||||
12: "routePanelForumsDeleteSubmit",
|
12: "routePanelForumsDelete",
|
||||||
13: "routePanelForumsEdit",
|
13: "routePanelForumsDeleteSubmit",
|
||||||
14: "routePanelForumsEditSubmit",
|
14: "routePanelForumsEdit",
|
||||||
15: "routePanelForumsEditPermsSubmit",
|
15: "routePanelForumsEditSubmit",
|
||||||
16: "routePanelSettings",
|
16: "routePanelForumsEditPermsSubmit",
|
||||||
17: "routePanelSettingEdit",
|
17: "routePanelSettings",
|
||||||
18: "routePanelSettingEditSubmit",
|
18: "routePanelSettingEdit",
|
||||||
19: "routePanelWordFilters",
|
19: "routePanelSettingEditSubmit",
|
||||||
20: "routePanelWordFiltersCreate",
|
20: "routePanelWordFilters",
|
||||||
21: "routePanelWordFiltersEdit",
|
21: "routePanelWordFiltersCreate",
|
||||||
22: "routePanelWordFiltersEditSubmit",
|
22: "routePanelWordFiltersEdit",
|
||||||
23: "routePanelWordFiltersDeleteSubmit",
|
23: "routePanelWordFiltersEditSubmit",
|
||||||
24: "routePanelThemes",
|
24: "routePanelWordFiltersDeleteSubmit",
|
||||||
25: "routePanelThemesSetDefault",
|
25: "routePanelThemes",
|
||||||
26: "routePanelPlugins",
|
26: "routePanelThemesSetDefault",
|
||||||
27: "routePanelPluginsActivate",
|
27: "routePanelPlugins",
|
||||||
28: "routePanelPluginsDeactivate",
|
28: "routePanelPluginsActivate",
|
||||||
29: "routePanelPluginsInstall",
|
29: "routePanelPluginsDeactivate",
|
||||||
30: "routePanelUsers",
|
30: "routePanelPluginsInstall",
|
||||||
31: "routePanelUsersEdit",
|
31: "routePanelUsers",
|
||||||
32: "routePanelUsersEditSubmit",
|
32: "routePanelUsersEdit",
|
||||||
33: "routePanelGroups",
|
33: "routePanelUsersEditSubmit",
|
||||||
34: "routePanelGroupsEdit",
|
34: "routePanelGroups",
|
||||||
35: "routePanelGroupsEditPerms",
|
35: "routePanelGroupsEdit",
|
||||||
36: "routePanelGroupsEditSubmit",
|
36: "routePanelGroupsEditPerms",
|
||||||
37: "routePanelGroupsEditPermsSubmit",
|
37: "routePanelGroupsEditSubmit",
|
||||||
38: "routePanelGroupsCreateSubmit",
|
38: "routePanelGroupsEditPermsSubmit",
|
||||||
39: "routePanelBackups",
|
39: "routePanelGroupsCreateSubmit",
|
||||||
40: "routePanelLogsMod",
|
40: "routePanelBackups",
|
||||||
41: "routePanelDebug",
|
41: "routePanelLogsMod",
|
||||||
42: "routePanel",
|
42: "routePanelDebug",
|
||||||
43: "routeAccountEditCritical",
|
43: "routePanel",
|
||||||
44: "routeAccountEditCriticalSubmit",
|
44: "routeAccountEditCritical",
|
||||||
45: "routeAccountEditAvatar",
|
45: "routeAccountEditCriticalSubmit",
|
||||||
46: "routeAccountEditAvatarSubmit",
|
46: "routeAccountEditAvatar",
|
||||||
47: "routeAccountEditUsername",
|
47: "routeAccountEditAvatarSubmit",
|
||||||
48: "routeAccountEditUsernameSubmit",
|
48: "routeAccountEditUsername",
|
||||||
49: "routeAccountEditEmail",
|
49: "routeAccountEditUsernameSubmit",
|
||||||
50: "routeAccountEditEmailTokenSubmit",
|
50: "routeAccountEditEmail",
|
||||||
51: "routeProfile",
|
51: "routeAccountEditEmailTokenSubmit",
|
||||||
52: "routeBanSubmit",
|
52: "routeProfile",
|
||||||
53: "routeUnban",
|
53: "routeBanSubmit",
|
||||||
54: "routeActivate",
|
54: "routeUnban",
|
||||||
55: "routeIps",
|
55: "routeActivate",
|
||||||
|
56: "routeIps",
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Stop spilling these into the package scope?
|
// TODO: Stop spilling these into the package scope?
|
||||||
|
@ -243,6 +246,10 @@ func (router *GenRouter) RemoveFunc(pattern string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Pass the default route or config struct to the router rather than accessing it via a package global
|
||||||
|
// TODO: SetDefaultRoute
|
||||||
|
// TODO: GetDefaultRoute
|
||||||
|
|
||||||
func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
if len(req.URL.Path) == 0 || req.URL.Path[0] != '/' {
|
if len(req.URL.Path) == 0 || req.URL.Path[0] != '/' {
|
||||||
w.WriteHeader(405)
|
w.WriteHeader(405)
|
||||||
|
@ -301,14 +308,20 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
router.handleError(err,w,req,user)
|
router.handleError(err,w,req,user)
|
||||||
}
|
}
|
||||||
case "/forums":
|
case "/pages":
|
||||||
common.RouteViewCounter.Bump(2)
|
common.RouteViewCounter.Bump(2)
|
||||||
|
err = routeCustomPage(w,req,user,extraData)
|
||||||
|
if err != nil {
|
||||||
|
router.handleError(err,w,req,user)
|
||||||
|
}
|
||||||
|
case "/forums":
|
||||||
|
common.RouteViewCounter.Bump(3)
|
||||||
err = routeForums(w,req,user)
|
err = routeForums(w,req,user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
router.handleError(err,w,req,user)
|
router.handleError(err,w,req,user)
|
||||||
}
|
}
|
||||||
case "/forum":
|
case "/forum":
|
||||||
common.RouteViewCounter.Bump(3)
|
common.RouteViewCounter.Bump(4)
|
||||||
err = routeForum(w,req,user,extraData)
|
err = routeForum(w,req,user,extraData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
router.handleError(err,w,req,user)
|
router.handleError(err,w,req,user)
|
||||||
|
@ -320,7 +333,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(4)
|
common.RouteViewCounter.Bump(5)
|
||||||
err = routeChangeTheme(w,req,user)
|
err = routeChangeTheme(w,req,user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
router.handleError(err,w,req,user)
|
router.handleError(err,w,req,user)
|
||||||
|
@ -332,7 +345,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(5)
|
common.RouteViewCounter.Bump(6)
|
||||||
err = routeShowAttachment(w,req,user,extraData)
|
err = routeShowAttachment(w,req,user,extraData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
router.handleError(err,w,req,user)
|
router.handleError(err,w,req,user)
|
||||||
|
@ -358,7 +371,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(6)
|
common.RouteViewCounter.Bump(7)
|
||||||
err = routeReportSubmit(w,req,user,extraData)
|
err = routeReportSubmit(w,req,user,extraData)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -373,10 +386,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(7)
|
common.RouteViewCounter.Bump(8)
|
||||||
err = routeTopicCreate(w,req,user,extraData)
|
err = routeTopicCreate(w,req,user,extraData)
|
||||||
default:
|
default:
|
||||||
common.RouteViewCounter.Bump(8)
|
common.RouteViewCounter.Bump(9)
|
||||||
err = routeTopics(w,req,user)
|
err = routeTopics(w,req,user)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -391,7 +404,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
|
|
||||||
switch(req.URL.Path) {
|
switch(req.URL.Path) {
|
||||||
case "/panel/forums/":
|
case "/panel/forums/":
|
||||||
common.RouteViewCounter.Bump(9)
|
common.RouteViewCounter.Bump(10)
|
||||||
err = routePanelForums(w,req,user)
|
err = routePanelForums(w,req,user)
|
||||||
case "/panel/forums/create/":
|
case "/panel/forums/create/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -400,7 +413,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(10)
|
common.RouteViewCounter.Bump(11)
|
||||||
err = routePanelForumsCreateSubmit(w,req,user)
|
err = routePanelForumsCreateSubmit(w,req,user)
|
||||||
case "/panel/forums/delete/":
|
case "/panel/forums/delete/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -409,7 +422,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(11)
|
common.RouteViewCounter.Bump(12)
|
||||||
err = routePanelForumsDelete(w,req,user,extraData)
|
err = routePanelForumsDelete(w,req,user,extraData)
|
||||||
case "/panel/forums/delete/submit/":
|
case "/panel/forums/delete/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -418,10 +431,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(12)
|
common.RouteViewCounter.Bump(13)
|
||||||
err = routePanelForumsDeleteSubmit(w,req,user,extraData)
|
err = routePanelForumsDeleteSubmit(w,req,user,extraData)
|
||||||
case "/panel/forums/edit/":
|
case "/panel/forums/edit/":
|
||||||
common.RouteViewCounter.Bump(13)
|
common.RouteViewCounter.Bump(14)
|
||||||
err = routePanelForumsEdit(w,req,user,extraData)
|
err = routePanelForumsEdit(w,req,user,extraData)
|
||||||
case "/panel/forums/edit/submit/":
|
case "/panel/forums/edit/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -430,7 +443,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(14)
|
common.RouteViewCounter.Bump(15)
|
||||||
err = routePanelForumsEditSubmit(w,req,user,extraData)
|
err = routePanelForumsEditSubmit(w,req,user,extraData)
|
||||||
case "/panel/forums/edit/perms/submit/":
|
case "/panel/forums/edit/perms/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -439,13 +452,13 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(15)
|
common.RouteViewCounter.Bump(16)
|
||||||
err = routePanelForumsEditPermsSubmit(w,req,user,extraData)
|
err = routePanelForumsEditPermsSubmit(w,req,user,extraData)
|
||||||
case "/panel/settings/":
|
case "/panel/settings/":
|
||||||
common.RouteViewCounter.Bump(16)
|
common.RouteViewCounter.Bump(17)
|
||||||
err = routePanelSettings(w,req,user)
|
err = routePanelSettings(w,req,user)
|
||||||
case "/panel/settings/edit/":
|
case "/panel/settings/edit/":
|
||||||
common.RouteViewCounter.Bump(17)
|
common.RouteViewCounter.Bump(18)
|
||||||
err = routePanelSettingEdit(w,req,user,extraData)
|
err = routePanelSettingEdit(w,req,user,extraData)
|
||||||
case "/panel/settings/edit/submit/":
|
case "/panel/settings/edit/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -454,10 +467,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(18)
|
common.RouteViewCounter.Bump(19)
|
||||||
err = routePanelSettingEditSubmit(w,req,user,extraData)
|
err = routePanelSettingEditSubmit(w,req,user,extraData)
|
||||||
case "/panel/settings/word-filters/":
|
case "/panel/settings/word-filters/":
|
||||||
common.RouteViewCounter.Bump(19)
|
common.RouteViewCounter.Bump(20)
|
||||||
err = routePanelWordFilters(w,req,user)
|
err = routePanelWordFilters(w,req,user)
|
||||||
case "/panel/settings/word-filters/create/":
|
case "/panel/settings/word-filters/create/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -466,10 +479,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(20)
|
common.RouteViewCounter.Bump(21)
|
||||||
err = routePanelWordFiltersCreate(w,req,user)
|
err = routePanelWordFiltersCreate(w,req,user)
|
||||||
case "/panel/settings/word-filters/edit/":
|
case "/panel/settings/word-filters/edit/":
|
||||||
common.RouteViewCounter.Bump(21)
|
common.RouteViewCounter.Bump(22)
|
||||||
err = routePanelWordFiltersEdit(w,req,user,extraData)
|
err = routePanelWordFiltersEdit(w,req,user,extraData)
|
||||||
case "/panel/settings/word-filters/edit/submit/":
|
case "/panel/settings/word-filters/edit/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -478,7 +491,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(22)
|
common.RouteViewCounter.Bump(23)
|
||||||
err = routePanelWordFiltersEditSubmit(w,req,user,extraData)
|
err = routePanelWordFiltersEditSubmit(w,req,user,extraData)
|
||||||
case "/panel/settings/word-filters/delete/submit/":
|
case "/panel/settings/word-filters/delete/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -487,10 +500,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(23)
|
common.RouteViewCounter.Bump(24)
|
||||||
err = routePanelWordFiltersDeleteSubmit(w,req,user,extraData)
|
err = routePanelWordFiltersDeleteSubmit(w,req,user,extraData)
|
||||||
case "/panel/themes/":
|
case "/panel/themes/":
|
||||||
common.RouteViewCounter.Bump(24)
|
common.RouteViewCounter.Bump(25)
|
||||||
err = routePanelThemes(w,req,user)
|
err = routePanelThemes(w,req,user)
|
||||||
case "/panel/themes/default/":
|
case "/panel/themes/default/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -499,10 +512,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(25)
|
common.RouteViewCounter.Bump(26)
|
||||||
err = routePanelThemesSetDefault(w,req,user,extraData)
|
err = routePanelThemesSetDefault(w,req,user,extraData)
|
||||||
case "/panel/plugins/":
|
case "/panel/plugins/":
|
||||||
common.RouteViewCounter.Bump(26)
|
common.RouteViewCounter.Bump(27)
|
||||||
err = routePanelPlugins(w,req,user)
|
err = routePanelPlugins(w,req,user)
|
||||||
case "/panel/plugins/activate/":
|
case "/panel/plugins/activate/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -511,7 +524,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(27)
|
common.RouteViewCounter.Bump(28)
|
||||||
err = routePanelPluginsActivate(w,req,user,extraData)
|
err = routePanelPluginsActivate(w,req,user,extraData)
|
||||||
case "/panel/plugins/deactivate/":
|
case "/panel/plugins/deactivate/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -520,7 +533,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(28)
|
common.RouteViewCounter.Bump(29)
|
||||||
err = routePanelPluginsDeactivate(w,req,user,extraData)
|
err = routePanelPluginsDeactivate(w,req,user,extraData)
|
||||||
case "/panel/plugins/install/":
|
case "/panel/plugins/install/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -529,13 +542,13 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(29)
|
common.RouteViewCounter.Bump(30)
|
||||||
err = routePanelPluginsInstall(w,req,user,extraData)
|
err = routePanelPluginsInstall(w,req,user,extraData)
|
||||||
case "/panel/users/":
|
case "/panel/users/":
|
||||||
common.RouteViewCounter.Bump(30)
|
common.RouteViewCounter.Bump(31)
|
||||||
err = routePanelUsers(w,req,user)
|
err = routePanelUsers(w,req,user)
|
||||||
case "/panel/users/edit/":
|
case "/panel/users/edit/":
|
||||||
common.RouteViewCounter.Bump(31)
|
common.RouteViewCounter.Bump(32)
|
||||||
err = routePanelUsersEdit(w,req,user,extraData)
|
err = routePanelUsersEdit(w,req,user,extraData)
|
||||||
case "/panel/users/edit/submit/":
|
case "/panel/users/edit/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -544,16 +557,16 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(32)
|
common.RouteViewCounter.Bump(33)
|
||||||
err = routePanelUsersEditSubmit(w,req,user,extraData)
|
err = routePanelUsersEditSubmit(w,req,user,extraData)
|
||||||
case "/panel/groups/":
|
case "/panel/groups/":
|
||||||
common.RouteViewCounter.Bump(33)
|
common.RouteViewCounter.Bump(34)
|
||||||
err = routePanelGroups(w,req,user)
|
err = routePanelGroups(w,req,user)
|
||||||
case "/panel/groups/edit/":
|
case "/panel/groups/edit/":
|
||||||
common.RouteViewCounter.Bump(34)
|
common.RouteViewCounter.Bump(35)
|
||||||
err = routePanelGroupsEdit(w,req,user,extraData)
|
err = routePanelGroupsEdit(w,req,user,extraData)
|
||||||
case "/panel/groups/edit/perms/":
|
case "/panel/groups/edit/perms/":
|
||||||
common.RouteViewCounter.Bump(35)
|
common.RouteViewCounter.Bump(36)
|
||||||
err = routePanelGroupsEditPerms(w,req,user,extraData)
|
err = routePanelGroupsEditPerms(w,req,user,extraData)
|
||||||
case "/panel/groups/edit/submit/":
|
case "/panel/groups/edit/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -562,7 +575,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(36)
|
common.RouteViewCounter.Bump(37)
|
||||||
err = routePanelGroupsEditSubmit(w,req,user,extraData)
|
err = routePanelGroupsEditSubmit(w,req,user,extraData)
|
||||||
case "/panel/groups/edit/perms/submit/":
|
case "/panel/groups/edit/perms/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -571,7 +584,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(37)
|
common.RouteViewCounter.Bump(38)
|
||||||
err = routePanelGroupsEditPermsSubmit(w,req,user,extraData)
|
err = routePanelGroupsEditPermsSubmit(w,req,user,extraData)
|
||||||
case "/panel/groups/create/":
|
case "/panel/groups/create/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -580,7 +593,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(38)
|
common.RouteViewCounter.Bump(39)
|
||||||
err = routePanelGroupsCreateSubmit(w,req,user)
|
err = routePanelGroupsCreateSubmit(w,req,user)
|
||||||
case "/panel/backups/":
|
case "/panel/backups/":
|
||||||
err = common.SuperAdminOnly(w,req,user)
|
err = common.SuperAdminOnly(w,req,user)
|
||||||
|
@ -589,10 +602,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(39)
|
common.RouteViewCounter.Bump(40)
|
||||||
err = routePanelBackups(w,req,user,extraData)
|
err = routePanelBackups(w,req,user,extraData)
|
||||||
case "/panel/logs/mod/":
|
case "/panel/logs/mod/":
|
||||||
common.RouteViewCounter.Bump(40)
|
common.RouteViewCounter.Bump(41)
|
||||||
err = routePanelLogsMod(w,req,user)
|
err = routePanelLogsMod(w,req,user)
|
||||||
case "/panel/debug/":
|
case "/panel/debug/":
|
||||||
err = common.AdminOnly(w,req,user)
|
err = common.AdminOnly(w,req,user)
|
||||||
|
@ -601,10 +614,10 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(41)
|
common.RouteViewCounter.Bump(42)
|
||||||
err = routePanelDebug(w,req,user)
|
err = routePanelDebug(w,req,user)
|
||||||
default:
|
default:
|
||||||
common.RouteViewCounter.Bump(42)
|
common.RouteViewCounter.Bump(43)
|
||||||
err = routePanel(w,req,user)
|
err = routePanel(w,req,user)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -619,7 +632,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(43)
|
common.RouteViewCounter.Bump(44)
|
||||||
err = routeAccountEditCritical(w,req,user)
|
err = routeAccountEditCritical(w,req,user)
|
||||||
case "/user/edit/critical/submit/":
|
case "/user/edit/critical/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -634,7 +647,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(44)
|
common.RouteViewCounter.Bump(45)
|
||||||
err = routeAccountEditCriticalSubmit(w,req,user)
|
err = routeAccountEditCriticalSubmit(w,req,user)
|
||||||
case "/user/edit/avatar/":
|
case "/user/edit/avatar/":
|
||||||
err = common.MemberOnly(w,req,user)
|
err = common.MemberOnly(w,req,user)
|
||||||
|
@ -643,7 +656,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(45)
|
common.RouteViewCounter.Bump(46)
|
||||||
err = routeAccountEditAvatar(w,req,user)
|
err = routeAccountEditAvatar(w,req,user)
|
||||||
case "/user/edit/avatar/submit/":
|
case "/user/edit/avatar/submit/":
|
||||||
err = common.MemberOnly(w,req,user)
|
err = common.MemberOnly(w,req,user)
|
||||||
|
@ -652,7 +665,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(46)
|
common.RouteViewCounter.Bump(47)
|
||||||
err = routeAccountEditAvatarSubmit(w,req,user)
|
err = routeAccountEditAvatarSubmit(w,req,user)
|
||||||
case "/user/edit/username/":
|
case "/user/edit/username/":
|
||||||
err = common.MemberOnly(w,req,user)
|
err = common.MemberOnly(w,req,user)
|
||||||
|
@ -661,7 +674,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(47)
|
common.RouteViewCounter.Bump(48)
|
||||||
err = routeAccountEditUsername(w,req,user)
|
err = routeAccountEditUsername(w,req,user)
|
||||||
case "/user/edit/username/submit/":
|
case "/user/edit/username/submit/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -676,7 +689,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(48)
|
common.RouteViewCounter.Bump(49)
|
||||||
err = routeAccountEditUsernameSubmit(w,req,user)
|
err = routeAccountEditUsernameSubmit(w,req,user)
|
||||||
case "/user/edit/email/":
|
case "/user/edit/email/":
|
||||||
err = common.MemberOnly(w,req,user)
|
err = common.MemberOnly(w,req,user)
|
||||||
|
@ -685,7 +698,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(49)
|
common.RouteViewCounter.Bump(50)
|
||||||
err = routeAccountEditEmail(w,req,user)
|
err = routeAccountEditEmail(w,req,user)
|
||||||
case "/user/edit/token/":
|
case "/user/edit/token/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -700,11 +713,11 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(50)
|
common.RouteViewCounter.Bump(51)
|
||||||
err = routeAccountEditEmailTokenSubmit(w,req,user,extraData)
|
err = routeAccountEditEmailTokenSubmit(w,req,user,extraData)
|
||||||
default:
|
default:
|
||||||
req.URL.Path += extraData
|
req.URL.Path += extraData
|
||||||
common.RouteViewCounter.Bump(51)
|
common.RouteViewCounter.Bump(52)
|
||||||
err = routeProfile(w,req,user)
|
err = routeProfile(w,req,user)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -725,7 +738,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(52)
|
common.RouteViewCounter.Bump(53)
|
||||||
err = routeBanSubmit(w,req,user)
|
err = routeBanSubmit(w,req,user)
|
||||||
case "/users/unban/":
|
case "/users/unban/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -740,7 +753,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(53)
|
common.RouteViewCounter.Bump(54)
|
||||||
err = routeUnban(w,req,user)
|
err = routeUnban(w,req,user)
|
||||||
case "/users/activate/":
|
case "/users/activate/":
|
||||||
err = common.NoSessionMismatch(w,req,user)
|
err = common.NoSessionMismatch(w,req,user)
|
||||||
|
@ -755,7 +768,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(54)
|
common.RouteViewCounter.Bump(55)
|
||||||
err = routeActivate(w,req,user)
|
err = routeActivate(w,req,user)
|
||||||
case "/users/ips/":
|
case "/users/ips/":
|
||||||
err = common.MemberOnly(w,req,user)
|
err = common.MemberOnly(w,req,user)
|
||||||
|
@ -764,7 +777,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.RouteViewCounter.Bump(55)
|
common.RouteViewCounter.Bump(56)
|
||||||
err = routeIps(w,req,user)
|
err = routeIps(w,req,user)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -794,7 +807,17 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
common.NotFound(w,req)
|
common.NotFound(w,req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
common.Config.DefaultRoute(w,req,user) // TODO: Count these views
|
|
||||||
|
handle, ok := RouteMap[common.Config.DefaultRoute]
|
||||||
|
if !ok {
|
||||||
|
// TODO: Make this a startup error not a runtime one
|
||||||
|
log.Print("Unable to find the default route")
|
||||||
|
common.NotFound(w,req)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
common.RouteViewCounter.Bump(routeMapEnum[common.Config.DefaultRoute])
|
||||||
|
|
||||||
|
handle.(func(http.ResponseWriter, *http.Request, common.User) common.RouteError)(w,req,user)
|
||||||
default:
|
default:
|
||||||
// A fallback for the routes which haven't been converted to the new router yet or plugins
|
// A fallback for the routes which haven't been converted to the new router yet or plugins
|
||||||
router.RLock()
|
router.RLock()
|
||||||
|
|
|
@ -142,7 +142,7 @@ func init() {
|
||||||
common.Config.SMTPPort = "25"
|
common.Config.SMTPPort = "25"
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
common.Config.DefaultRoute = routeTopics
|
common.Config.DefaultRoute = "routeTopics"
|
||||||
common.Config.DefaultGroup = 3 // Should be a setting in the database
|
common.Config.DefaultGroup = 3 // Should be a setting in the database
|
||||||
common.Config.ActivationGroup = 5 // Should be a setting in the database
|
common.Config.ActivationGroup = 5 // Should be a setting in the database
|
||||||
common.Config.StaffCSS = "staff_post"
|
common.Config.StaffCSS = "staff_post"
|
||||||
|
|
21
main.go
21
main.go
|
@ -302,9 +302,6 @@ func main() {
|
||||||
router.HandleFunc("/topic/unlock/submit/", routeUnlockTopic)
|
router.HandleFunc("/topic/unlock/submit/", routeUnlockTopic)
|
||||||
router.HandleFunc("/topic/like/submit/", routeLikeTopic)
|
router.HandleFunc("/topic/like/submit/", routeLikeTopic)
|
||||||
|
|
||||||
// Custom Pages
|
|
||||||
router.HandleFunc("/pages/", routeCustomPage)
|
|
||||||
|
|
||||||
// Accounts
|
// Accounts
|
||||||
router.HandleFunc("/accounts/login/", routeLogin)
|
router.HandleFunc("/accounts/login/", routeLogin)
|
||||||
router.HandleFunc("/accounts/create/", routeRegister)
|
router.HandleFunc("/accounts/create/", routeRegister)
|
||||||
|
@ -335,6 +332,18 @@ func main() {
|
||||||
// pprof.StopCPUProfile()
|
// pprof.StopCPUProfile()
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
// We might not need the timeouts, if we're behind a reverse-proxy like Nginx
|
||||||
|
var newServer = func(addr string, handler http.Handler) *http.Server {
|
||||||
|
return &http.Server{
|
||||||
|
Addr: addr,
|
||||||
|
Handler: handler,
|
||||||
|
|
||||||
|
ReadTimeout: 5 * time.Second,
|
||||||
|
WriteTimeout: 10 * time.Second,
|
||||||
|
IdleTimeout: 120 * time.Second,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Let users run *both* HTTP and HTTPS
|
// TODO: Let users run *both* HTTP and HTTPS
|
||||||
log.Print("Initialising the HTTP server")
|
log.Print("Initialising the HTTP server")
|
||||||
if !common.Site.EnableSsl {
|
if !common.Site.EnableSsl {
|
||||||
|
@ -342,7 +351,7 @@ func main() {
|
||||||
common.Site.Port = "80"
|
common.Site.Port = "80"
|
||||||
}
|
}
|
||||||
log.Print("Listening on port " + common.Site.Port)
|
log.Print("Listening on port " + common.Site.Port)
|
||||||
err = http.ListenAndServe(":"+common.Site.Port, router)
|
err = newServer(":"+common.Site.Port, router).ListenAndServe()
|
||||||
} else {
|
} else {
|
||||||
if common.Site.Port == "" {
|
if common.Site.Port == "" {
|
||||||
common.Site.Port = "443"
|
common.Site.Port = "443"
|
||||||
|
@ -352,14 +361,14 @@ func main() {
|
||||||
// TODO: Redirect to port 443
|
// TODO: Redirect to port 443
|
||||||
go func() {
|
go func() {
|
||||||
log.Print("Listening on port 80")
|
log.Print("Listening on port 80")
|
||||||
err = http.ListenAndServe(":80", &HTTPSRedirect{})
|
err = newServer(":80", &HTTPSRedirect{}).ListenAndServe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
log.Printf("Listening on port %s", common.Site.Port)
|
log.Printf("Listening on port %s", common.Site.Port)
|
||||||
err = http.ListenAndServeTLS(":"+common.Site.Port, common.Config.SslFullchain, common.Config.SslPrivkey, router)
|
err = newServer(":"+common.Site.Port, router).ListenAndServeTLS(common.Config.SslFullchain, common.Config.SslPrivkey)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Why did the server stop?
|
// Why did the server stop?
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{{template "header.html" . }}
|
{{template "header.html" . }}
|
||||||
<div class="rowblock">
|
<div class="rowblock rowhead">
|
||||||
<div class="rowitem">Test Page</div>
|
<div class="rowitem">Test Page</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="rowblock">
|
<div class="rowblock parablock">
|
||||||
<div class="rowitem passive">Testing</div>
|
<div class="rowitem passive">Testing</div>
|
||||||
</div>
|
</div>
|
||||||
{{template "footer.html" . }}
|
{{template "footer.html" . }}
|
|
@ -233,6 +233,10 @@ func (router *GenRouter) RemoveFunc(pattern string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Pass the default route or config struct to the router rather than accessing it via a package global
|
||||||
|
// TODO: SetDefaultRoute
|
||||||
|
// TODO: GetDefaultRoute
|
||||||
|
|
||||||
func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
if len(req.URL.Path) == 0 || req.URL.Path[0] != '/' {
|
if len(req.URL.Path) == 0 || req.URL.Path[0] != '/' {
|
||||||
w.WriteHeader(405)
|
w.WriteHeader(405)
|
||||||
|
@ -303,7 +307,17 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
common.NotFound(w,req)
|
common.NotFound(w,req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
common.Config.DefaultRoute(w,req,user) // TODO: Count these views
|
|
||||||
|
handle, ok := RouteMap[common.Config.DefaultRoute]
|
||||||
|
if !ok {
|
||||||
|
// TODO: Make this a startup error not a runtime one
|
||||||
|
log.Print("Unable to find the default route")
|
||||||
|
common.NotFound(w,req)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
common.RouteViewCounter.Bump(routeMapEnum[common.Config.DefaultRoute])
|
||||||
|
|
||||||
|
handle.(func(http.ResponseWriter, *http.Request, common.User) common.RouteError)(w,req,user)
|
||||||
default:
|
default:
|
||||||
// A fallback for the routes which haven't been converted to the new router yet or plugins
|
// A fallback for the routes which haven't been converted to the new router yet or plugins
|
||||||
router.RLock()
|
router.RLock()
|
||||||
|
|
|
@ -4,7 +4,7 @@ package main
|
||||||
func routes() {
|
func routes() {
|
||||||
addRoute(View("routeAPI", "/api/"))
|
addRoute(View("routeAPI", "/api/"))
|
||||||
addRoute(View("routeOverview", "/overview/"))
|
addRoute(View("routeOverview", "/overview/"))
|
||||||
//addRoute("routeCustomPage","/pages/",""/*,"&extraData"*/)
|
addRoute(View("routeCustomPage", "/pages/", "extraData"))
|
||||||
addRoute(View("routeForums", "/forums/" /*,"&forums"*/))
|
addRoute(View("routeForums", "/forums/" /*,"&forums"*/))
|
||||||
addRoute(View("routeForum", "/forum/", "extraData"))
|
addRoute(View("routeForum", "/forum/", "extraData"))
|
||||||
addRoute(AnonAction("routeChangeTheme", "/theme/"))
|
addRoute(AnonAction("routeChangeTheme", "/theme/"))
|
||||||
|
|
10
routes.go
10
routes.go
|
@ -33,6 +33,7 @@ type HTTPSRedirect struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (red *HTTPSRedirect) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
func (red *HTTPSRedirect) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
|
w.Header().Set("Connection", "close")
|
||||||
dest := "https://" + req.Host + req.URL.Path
|
dest := "https://" + req.Host + req.URL.Path
|
||||||
if len(req.URL.RawQuery) > 0 {
|
if len(req.URL.RawQuery) > 0 {
|
||||||
dest += "?" + req.URL.RawQuery
|
dest += "?" + req.URL.RawQuery
|
||||||
|
@ -107,26 +108,27 @@ func routeOverview(w http.ResponseWriter, r *http.Request, user common.User) com
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func routeCustomPage(w http.ResponseWriter, r *http.Request, user common.User) common.RouteError {
|
func routeCustomPage(w http.ResponseWriter, r *http.Request, user common.User, name string) common.RouteError {
|
||||||
headerVars, ferr := common.UserCheck(w, r, &user)
|
headerVars, ferr := common.UserCheck(w, r, &user)
|
||||||
if ferr != nil {
|
if ferr != nil {
|
||||||
return ferr
|
return ferr
|
||||||
}
|
}
|
||||||
|
|
||||||
name := r.URL.Path[len("/pages/"):]
|
// ! Is this safe?
|
||||||
if common.Templates.Lookup("page_"+name) == nil {
|
if common.Templates.Lookup("page_"+name+".html") == nil {
|
||||||
return common.NotFound(w, r)
|
return common.NotFound(w, r)
|
||||||
}
|
}
|
||||||
headerVars.Zone = "custom_page"
|
headerVars.Zone = "custom_page"
|
||||||
|
|
||||||
pi := common.Page{common.GetTitlePhrase("page"), user, headerVars, tList, nil}
|
pi := common.Page{common.GetTitlePhrase("page"), user, headerVars, tList, nil}
|
||||||
|
// TODO: Pass the page name to the pre-render hook?
|
||||||
if common.PreRenderHooks["pre_render_custom_page"] != nil {
|
if common.PreRenderHooks["pre_render_custom_page"] != nil {
|
||||||
if common.RunPreRenderHook("pre_render_custom_page", w, r, &user, &pi) {
|
if common.RunPreRenderHook("pre_render_custom_page", w, r, &user, &pi) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err := common.Templates.ExecuteTemplate(w, "page_"+name, pi)
|
err := common.Templates.ExecuteTemplate(w, "page_"+name+".html", pi)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return common.InternalError(err, w, r)
|
return common.InternalError(err, w, r)
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,58 +143,62 @@ w.Write([]byte(item.Creator.Link))
|
||||||
w.Write(forum_30)
|
w.Write(forum_30)
|
||||||
w.Write([]byte(item.Creator.Avatar))
|
w.Write([]byte(item.Creator.Avatar))
|
||||||
w.Write(forum_31)
|
w.Write(forum_31)
|
||||||
w.Write([]byte(item.Creator.Avatar))
|
|
||||||
w.Write(forum_32)
|
|
||||||
w.Write([]byte(item.Link))
|
|
||||||
w.Write(forum_33)
|
|
||||||
w.Write([]byte(item.Title))
|
|
||||||
w.Write(forum_34)
|
|
||||||
w.Write([]byte(item.Creator.Link))
|
|
||||||
w.Write(forum_35)
|
|
||||||
w.Write([]byte(item.Creator.Name))
|
w.Write([]byte(item.Creator.Name))
|
||||||
|
w.Write(forum_32)
|
||||||
|
w.Write([]byte(item.Creator.Name))
|
||||||
|
w.Write(forum_33)
|
||||||
|
w.Write([]byte(item.Link))
|
||||||
|
w.Write(forum_34)
|
||||||
|
w.Write([]byte(item.Title))
|
||||||
|
w.Write(forum_35)
|
||||||
|
w.Write([]byte(item.Creator.Link))
|
||||||
w.Write(forum_36)
|
w.Write(forum_36)
|
||||||
if item.IsClosed {
|
w.Write([]byte(item.Creator.Name))
|
||||||
w.Write(forum_37)
|
w.Write(forum_37)
|
||||||
}
|
if item.IsClosed {
|
||||||
if item.Sticky {
|
|
||||||
w.Write(forum_38)
|
w.Write(forum_38)
|
||||||
}
|
}
|
||||||
w.Write(forum_39)
|
|
||||||
w.Write([]byte(strconv.Itoa(item.PostCount)))
|
|
||||||
w.Write(forum_40)
|
|
||||||
w.Write([]byte(strconv.Itoa(item.LikeCount)))
|
|
||||||
w.Write(forum_41)
|
|
||||||
if item.Sticky {
|
if item.Sticky {
|
||||||
|
w.Write(forum_39)
|
||||||
|
}
|
||||||
|
w.Write(forum_40)
|
||||||
|
w.Write([]byte(strconv.Itoa(item.PostCount)))
|
||||||
|
w.Write(forum_41)
|
||||||
|
w.Write([]byte(strconv.Itoa(item.LikeCount)))
|
||||||
w.Write(forum_42)
|
w.Write(forum_42)
|
||||||
|
if item.Sticky {
|
||||||
|
w.Write(forum_43)
|
||||||
} else {
|
} else {
|
||||||
if item.IsClosed {
|
if item.IsClosed {
|
||||||
w.Write(forum_43)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
w.Write(forum_44)
|
w.Write(forum_44)
|
||||||
w.Write([]byte(item.LastUser.Link))
|
}
|
||||||
|
}
|
||||||
w.Write(forum_45)
|
w.Write(forum_45)
|
||||||
w.Write([]byte(item.LastUser.Avatar))
|
|
||||||
w.Write(forum_46)
|
|
||||||
w.Write([]byte(item.LastUser.Name))
|
|
||||||
w.Write(forum_47)
|
|
||||||
w.Write([]byte(item.LastUser.Link))
|
w.Write([]byte(item.LastUser.Link))
|
||||||
|
w.Write(forum_46)
|
||||||
|
w.Write([]byte(item.LastUser.Avatar))
|
||||||
|
w.Write(forum_47)
|
||||||
|
w.Write([]byte(item.LastUser.Name))
|
||||||
w.Write(forum_48)
|
w.Write(forum_48)
|
||||||
w.Write([]byte(item.LastUser.Name))
|
w.Write([]byte(item.LastUser.Name))
|
||||||
w.Write(forum_49)
|
w.Write(forum_49)
|
||||||
w.Write([]byte(item.RelativeLastReplyAt))
|
w.Write([]byte(item.LastUser.Link))
|
||||||
w.Write(forum_50)
|
w.Write(forum_50)
|
||||||
|
w.Write([]byte(item.LastUser.Name))
|
||||||
|
w.Write(forum_51)
|
||||||
|
w.Write([]byte(item.RelativeLastReplyAt))
|
||||||
|
w.Write(forum_52)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
w.Write(forum_51)
|
|
||||||
if tmpl_forum_vars.CurrentUser.Perms.CreateTopic {
|
|
||||||
w.Write(forum_52)
|
|
||||||
w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID)))
|
|
||||||
w.Write(forum_53)
|
w.Write(forum_53)
|
||||||
}
|
if tmpl_forum_vars.CurrentUser.Perms.CreateTopic {
|
||||||
w.Write(forum_54)
|
w.Write(forum_54)
|
||||||
}
|
w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID)))
|
||||||
w.Write(forum_55)
|
w.Write(forum_55)
|
||||||
|
}
|
||||||
|
w.Write(forum_56)
|
||||||
|
}
|
||||||
|
w.Write(forum_57)
|
||||||
w.Write(footer_0)
|
w.Write(footer_0)
|
||||||
w.Write([]byte(common.BuildWidget("footer",tmpl_forum_vars.Header)))
|
w.Write([]byte(common.BuildWidget("footer",tmpl_forum_vars.Header)))
|
||||||
w.Write(footer_1)
|
w.Write(footer_1)
|
||||||
|
|
|
@ -97,27 +97,31 @@ if item.LastReplyer.Avatar != "" {
|
||||||
w.Write(forums_10)
|
w.Write(forums_10)
|
||||||
w.Write([]byte(item.LastReplyer.Avatar))
|
w.Write([]byte(item.LastReplyer.Avatar))
|
||||||
w.Write(forums_11)
|
w.Write(forums_11)
|
||||||
}
|
w.Write([]byte(item.LastReplyer.Name))
|
||||||
w.Write(forums_12)
|
w.Write(forums_12)
|
||||||
w.Write([]byte(item.LastTopic.Link))
|
w.Write([]byte(item.LastReplyer.Name))
|
||||||
w.Write(forums_13)
|
w.Write(forums_13)
|
||||||
|
}
|
||||||
|
w.Write(forums_14)
|
||||||
|
w.Write([]byte(item.LastTopic.Link))
|
||||||
|
w.Write(forums_15)
|
||||||
if item.LastTopic.Title != "" {
|
if item.LastTopic.Title != "" {
|
||||||
w.Write([]byte(item.LastTopic.Title))
|
w.Write([]byte(item.LastTopic.Title))
|
||||||
} else {
|
} else {
|
||||||
w.Write(forums_14)
|
|
||||||
}
|
|
||||||
w.Write(forums_15)
|
|
||||||
if item.LastTopicTime != "" {
|
|
||||||
w.Write(forums_16)
|
w.Write(forums_16)
|
||||||
w.Write([]byte(item.LastTopicTime))
|
}
|
||||||
w.Write(forums_17)
|
w.Write(forums_17)
|
||||||
}
|
if item.LastTopicTime != "" {
|
||||||
w.Write(forums_18)
|
w.Write(forums_18)
|
||||||
}
|
w.Write([]byte(item.LastTopicTime))
|
||||||
} else {
|
|
||||||
w.Write(forums_19)
|
w.Write(forums_19)
|
||||||
}
|
}
|
||||||
w.Write(forums_20)
|
w.Write(forums_20)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
w.Write(forums_21)
|
||||||
|
}
|
||||||
|
w.Write(forums_22)
|
||||||
w.Write(footer_0)
|
w.Write(footer_0)
|
||||||
w.Write([]byte(common.BuildWidget("footer",tmpl_forums_vars.Header)))
|
w.Write([]byte(common.BuildWidget("footer",tmpl_forums_vars.Header)))
|
||||||
w.Write(footer_1)
|
w.Write(footer_1)
|
||||||
|
|
258
template_list.go
258
template_list.go
|
@ -518,14 +518,16 @@ var profile_0 = []byte(`
|
||||||
<div class="topBlock">
|
<div class="topBlock">
|
||||||
<div class="rowitem avatarRow">
|
<div class="rowitem avatarRow">
|
||||||
<img src="`)
|
<img src="`)
|
||||||
var profile_1 = []byte(`" class="avatar" />
|
var profile_1 = []byte(`" class="avatar" alt="`)
|
||||||
|
var profile_2 = []byte(`'s Avatar" title="`)
|
||||||
|
var profile_3 = []byte(`'s Avatar" />
|
||||||
</div>
|
</div>
|
||||||
<div class="rowitem nameRow">
|
<div class="rowitem nameRow">
|
||||||
<span class="profileName">`)
|
<span class="profileName">`)
|
||||||
var profile_2 = []byte(`</span>`)
|
|
||||||
var profile_3 = []byte(`<span class="username">`)
|
|
||||||
var profile_4 = []byte(`</span>`)
|
var profile_4 = []byte(`</span>`)
|
||||||
var profile_5 = []byte(`
|
var profile_5 = []byte(`<span class="username">`)
|
||||||
|
var profile_6 = []byte(`</span>`)
|
||||||
|
var profile_7 = []byte(`
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="passiveBlock">
|
<div class="passiveBlock">
|
||||||
|
@ -533,20 +535,20 @@ var profile_5 = []byte(`
|
||||||
<a class="profile_menu_item">Add Friend</a>
|
<a class="profile_menu_item">Add Friend</a>
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
var profile_6 = []byte(`<div class="rowitem passive">
|
var profile_8 = []byte(`<div class="rowitem passive">
|
||||||
`)
|
`)
|
||||||
var profile_7 = []byte(`<a href="/users/unban/`)
|
var profile_9 = []byte(`<a href="/users/unban/`)
|
||||||
var profile_8 = []byte(`?session=`)
|
var profile_10 = []byte(`?session=`)
|
||||||
var profile_9 = []byte(`" class="profile_menu_item">Unban</a>
|
var profile_11 = []byte(`" class="profile_menu_item">Unban</a>
|
||||||
`)
|
`)
|
||||||
var profile_10 = []byte(`<a href="#ban_user" class="profile_menu_item">Ban</a>`)
|
var profile_12 = []byte(`<a href="#ban_user" class="profile_menu_item">Ban</a>`)
|
||||||
var profile_11 = []byte(`
|
var profile_13 = []byte(`
|
||||||
</div>`)
|
</div>`)
|
||||||
var profile_12 = []byte(`
|
var profile_14 = []byte(`
|
||||||
<div class="rowitem passive">
|
<div class="rowitem passive">
|
||||||
<a href="/report/submit/`)
|
<a href="/report/submit/`)
|
||||||
var profile_13 = []byte(`?session=`)
|
var profile_15 = []byte(`?session=`)
|
||||||
var profile_14 = []byte(`&type=user" class="profile_menu_item report_item">Report</a>
|
var profile_16 = []byte(`&type=user" class="profile_menu_item report_item">Report</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -554,16 +556,16 @@ var profile_14 = []byte(`&type=user" class="profile_menu_item report_item">Repor
|
||||||
|
|
||||||
<div id="profile_right_lane" class="colstack_right">
|
<div id="profile_right_lane" class="colstack_right">
|
||||||
`)
|
`)
|
||||||
var profile_15 = []byte(`
|
var profile_17 = []byte(`
|
||||||
<!-- TODO: Inline the display: none; CSS -->
|
<!-- TODO: Inline the display: none; CSS -->
|
||||||
<div id="ban_user_head" class="colstack_item colstack_head hash_hide ban_user_hash" style="display: none;">
|
<div id="ban_user_head" class="colstack_item colstack_head hash_hide ban_user_hash" style="display: none;">
|
||||||
<div class="rowitem"><h1>Ban User</h1></div>
|
<div class="rowitem"><h1>Ban User</h1></div>
|
||||||
</div>
|
</div>
|
||||||
<form id="ban_user_form" class="hash_hide ban_user_hash" action="/users/ban/submit/`)
|
<form id="ban_user_form" class="hash_hide ban_user_hash" action="/users/ban/submit/`)
|
||||||
var profile_16 = []byte(`?session=`)
|
var profile_18 = []byte(`?session=`)
|
||||||
var profile_17 = []byte(`" method="post" style="display: none;">
|
var profile_19 = []byte(`" method="post" style="display: none;">
|
||||||
`)
|
`)
|
||||||
var profile_18 = []byte(`
|
var profile_20 = []byte(`
|
||||||
<div class="colline">If all the fields are left blank, the ban will be permanent.</div>
|
<div class="colline">If all the fields are left blank, the ban will be permanent.</div>
|
||||||
<div class="colstack_item">
|
<div class="colstack_item">
|
||||||
<div class="formrow real_first_child">
|
<div class="formrow real_first_child">
|
||||||
|
@ -594,53 +596,91 @@ var profile_18 = []byte(`
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
`)
|
`)
|
||||||
var profile_19 = []byte(`
|
var profile_21 = []byte(`
|
||||||
|
|
||||||
<div id="profile_comments_head" class="colstack_item colstack_head hash_hide">
|
<div id="profile_comments_head" class="colstack_item colstack_head hash_hide">
|
||||||
<div class="rowitem"><h1>Comments</h1></div>
|
<div class="rowitem"><h1>Comments</h1></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="profile_comments" class="colstack_item hash_hide">`)
|
<div id="profile_comments" class="colstack_item hash_hide">
|
||||||
var profile_20 = []byte(`
|
`)
|
||||||
|
var profile_comments_row_0 = []byte(`
|
||||||
<div class="rowitem passive deletable_block editable_parent simple `)
|
<div class="rowitem passive deletable_block editable_parent simple `)
|
||||||
var profile_21 = []byte(`" style="background-image: url(`)
|
var profile_comments_row_1 = []byte(`" style="background-image: url(`)
|
||||||
var profile_22 = []byte(`), url(/static/post-avatar-bg.jpg);background-position: 0px `)
|
var profile_comments_row_2 = []byte(`), url(/static/post-avatar-bg.jpg);background-position: 0px `)
|
||||||
var profile_23 = []byte(`-1`)
|
var profile_comments_row_3 = []byte(`-1`)
|
||||||
var profile_24 = []byte(`0px;">
|
var profile_comments_row_4 = []byte(`0px;">
|
||||||
<img class="bgsub" src="`)
|
|
||||||
var profile_25 = []byte(`" />
|
|
||||||
<span class="editable_block user_content simple">`)
|
<span class="editable_block user_content simple">`)
|
||||||
var profile_26 = []byte(`</span>
|
var profile_comments_row_5 = []byte(`</span>
|
||||||
<span class="controls">
|
<span class="controls">
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var profile_27 = []byte(`" class="real_username username">`)
|
var profile_comments_row_6 = []byte(`" class="real_username username">`)
|
||||||
var profile_28 = []byte(`</a>
|
var profile_comments_row_7 = []byte(`</a>
|
||||||
|
|
||||||
`)
|
`)
|
||||||
var profile_29 = []byte(`<a href="/profile/reply/edit/submit/`)
|
var profile_comments_row_8 = []byte(`<a href="/profile/reply/edit/submit/`)
|
||||||
var profile_30 = []byte(`" class="mod_button" title="Edit Item"><button class="username edit_item edit_label"></button></a>
|
var profile_comments_row_9 = []byte(`" class="mod_button" title="Edit Item"><button class="username edit_item edit_label"></button></a>
|
||||||
|
|
||||||
<a href="/profile/reply/delete/submit/`)
|
<a href="/profile/reply/delete/submit/`)
|
||||||
var profile_31 = []byte(`" class="mod_button" title="Delete Item"><button class="username delete_item trash_label"></button></a>`)
|
var profile_comments_row_10 = []byte(`" class="mod_button" title="Delete Item"><button class="username delete_item trash_label"></button></a>`)
|
||||||
var profile_32 = []byte(`
|
var profile_comments_row_11 = []byte(`
|
||||||
|
|
||||||
<a class="mod_button" href="/report/submit/`)
|
<a class="mod_button" href="/report/submit/`)
|
||||||
var profile_33 = []byte(`?session=`)
|
var profile_comments_row_12 = []byte(`?session=`)
|
||||||
var profile_34 = []byte(`&type=user-reply"><button class="username report_item flag_label"></button></a>
|
var profile_comments_row_13 = []byte(`&type=user-reply"><button class="username report_item flag_label"></button></a>
|
||||||
|
|
||||||
`)
|
`)
|
||||||
var profile_35 = []byte(`<a class="username hide_on_mobile user_tag" style="float: right;">`)
|
var profile_comments_row_14 = []byte(`<a class="username hide_on_mobile user_tag" style="float: right;">`)
|
||||||
var profile_36 = []byte(`</a>`)
|
var profile_comments_row_15 = []byte(`</a>`)
|
||||||
var profile_37 = []byte(`
|
var profile_comments_row_16 = []byte(`
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
var profile_38 = []byte(`</div>
|
var profile_comments_row_17 = []byte(`
|
||||||
|
<div class="rowitem passive deletable_block editable_parent comment `)
|
||||||
|
var profile_comments_row_18 = []byte(`">
|
||||||
|
<div class="userbit">
|
||||||
|
<img src="`)
|
||||||
|
var profile_comments_row_19 = []byte(`" alt="`)
|
||||||
|
var profile_comments_row_20 = []byte(`'s Avatar" title="`)
|
||||||
|
var profile_comments_row_21 = []byte(`'s Avatar" />
|
||||||
|
<span class="nameAndTitle">
|
||||||
|
<a href="`)
|
||||||
|
var profile_comments_row_22 = []byte(`" class="real_username username">`)
|
||||||
|
var profile_comments_row_23 = []byte(`</a>
|
||||||
|
`)
|
||||||
|
var profile_comments_row_24 = []byte(`<a class="username hide_on_mobile user_tag" style="float: right;">`)
|
||||||
|
var profile_comments_row_25 = []byte(`</a>`)
|
||||||
|
var profile_comments_row_26 = []byte(`
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="content_column">
|
||||||
|
<span class="editable_block user_content">`)
|
||||||
|
var profile_comments_row_27 = []byte(`</span>
|
||||||
|
<span class="controls">
|
||||||
|
`)
|
||||||
|
var profile_comments_row_28 = []byte(`
|
||||||
|
<a href="/profile/reply/edit/submit/`)
|
||||||
|
var profile_comments_row_29 = []byte(`" class="mod_button" title="Edit Item"><button class="username edit_item edit_label"></button></a>
|
||||||
|
<a href="/profile/reply/delete/submit/`)
|
||||||
|
var profile_comments_row_30 = []byte(`" class="mod_button" title="Delete Item"><button class="username delete_item trash_label"></button></a>
|
||||||
|
`)
|
||||||
|
var profile_comments_row_31 = []byte(`
|
||||||
|
|
||||||
|
<a class="mod_button" href="/report/submit/`)
|
||||||
|
var profile_comments_row_32 = []byte(`?session=`)
|
||||||
|
var profile_comments_row_33 = []byte(`&type=user-reply"><button class="username report_item flag_label"></button></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`)
|
||||||
|
var profile_22 = []byte(`
|
||||||
|
</div>
|
||||||
|
|
||||||
`)
|
`)
|
||||||
var profile_39 = []byte(`
|
var profile_23 = []byte(`
|
||||||
<form id="profile_comments_form" class="hash_hide" action="/profile/reply/create/" method="post">
|
<form id="profile_comments_form" class="hash_hide" action="/profile/reply/create/" method="post">
|
||||||
<input name="uid" value='`)
|
<input name="uid" value='`)
|
||||||
var profile_40 = []byte(`' type="hidden" />
|
var profile_24 = []byte(`' type="hidden" />
|
||||||
<div class="colstack_item topic_reply_form" style="border-top: none;">
|
<div class="colstack_item topic_reply_form" style="border-top: none;">
|
||||||
<div class="formrow">
|
<div class="formrow">
|
||||||
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
<div class="formitem"><textarea name="reply-content" placeholder="Insert reply here"></textarea></div>
|
||||||
|
@ -651,13 +691,13 @@ var profile_40 = []byte(`' type="hidden" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
`)
|
`)
|
||||||
var profile_41 = []byte(`
|
var profile_25 = []byte(`
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
`)
|
`)
|
||||||
var profile_42 = []byte(`
|
var profile_26 = []byte(`
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function handle_profile_hashbit() {
|
function handle_profile_hashbit() {
|
||||||
var hash_class = ""
|
var hash_class = ""
|
||||||
|
@ -706,24 +746,26 @@ var forums_9 = []byte(`
|
||||||
<span class="forum_right shift_right">
|
<span class="forum_right shift_right">
|
||||||
`)
|
`)
|
||||||
var forums_10 = []byte(`<img class="extra_little_row_avatar" src="`)
|
var forums_10 = []byte(`<img class="extra_little_row_avatar" src="`)
|
||||||
var forums_11 = []byte(`" height=64 width=64 />`)
|
var forums_11 = []byte(`" height=64 width=64 alt="`)
|
||||||
var forums_12 = []byte(`
|
var forums_12 = []byte(`'s Avatar" title="`)
|
||||||
|
var forums_13 = []byte(`'s Avatar" />`)
|
||||||
|
var forums_14 = []byte(`
|
||||||
<span>
|
<span>
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var forums_13 = []byte(`">`)
|
var forums_15 = []byte(`">`)
|
||||||
var forums_14 = []byte(`None`)
|
var forums_16 = []byte(`None`)
|
||||||
var forums_15 = []byte(`</a>
|
var forums_17 = []byte(`</a>
|
||||||
`)
|
`)
|
||||||
var forums_16 = []byte(`<br /><span class="rowsmall">`)
|
var forums_18 = []byte(`<br /><span class="rowsmall">`)
|
||||||
var forums_17 = []byte(`</span>`)
|
var forums_19 = []byte(`</span>`)
|
||||||
var forums_18 = []byte(`
|
var forums_20 = []byte(`
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
var forums_19 = []byte(`<div class="rowitem passive">You don't have access to any forums.</div>`)
|
var forums_21 = []byte(`<div class="rowitem passive">You don't have access to any forums.</div>`)
|
||||||
var forums_20 = []byte(`
|
var forums_22 = []byte(`
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
@ -774,7 +816,7 @@ var topics_9 = []byte(`
|
||||||
<div class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
<div class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
||||||
<form name="topic_create_form_form" id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
<form name="topic_create_form_form" id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
||||||
<img class="little_row_avatar" src="`)
|
<img class="little_row_avatar" src="`)
|
||||||
var topics_10 = []byte(`" height="64" alt="Your Avatar" />
|
var topics_10 = []byte(`" height="64" alt="Your Avatar" title="Your Avatar" />
|
||||||
<div class="main_form">
|
<div class="main_form">
|
||||||
<div class="topic_meta">
|
<div class="topic_meta">
|
||||||
<div class="formrow topic_board_row real_first_child">
|
<div class="formrow topic_board_row real_first_child">
|
||||||
|
@ -827,51 +869,53 @@ var topics_24 = []byte(`">
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var topics_25 = []byte(`"><img src="`)
|
var topics_25 = []byte(`"><img src="`)
|
||||||
var topics_26 = []byte(`" height="64" alt="`)
|
var topics_26 = []byte(`" height="64" alt="`)
|
||||||
var topics_27 = []byte(`'s Avatar" /></a>
|
var topics_27 = []byte(`'s Avatar" title="`)
|
||||||
|
var topics_28 = []byte(`'s Avatar" /></a>
|
||||||
<span class="topic_inner_left">
|
<span class="topic_inner_left">
|
||||||
<a class="rowtopic" href="`)
|
<a class="rowtopic" href="`)
|
||||||
var topics_28 = []byte(`"><span>`)
|
var topics_29 = []byte(`"><span>`)
|
||||||
var topics_29 = []byte(`</span></a> `)
|
var topics_30 = []byte(`</span></a> `)
|
||||||
var topics_30 = []byte(`<a class="rowsmall parent_forum" href="`)
|
var topics_31 = []byte(`<a class="rowsmall parent_forum" href="`)
|
||||||
var topics_31 = []byte(`">`)
|
var topics_32 = []byte(`">`)
|
||||||
var topics_32 = []byte(`</a>`)
|
var topics_33 = []byte(`</a>`)
|
||||||
var topics_33 = []byte(`
|
var topics_34 = []byte(`
|
||||||
<br /><a class="rowsmall starter" href="`)
|
<br /><a class="rowsmall starter" href="`)
|
||||||
var topics_34 = []byte(`">`)
|
var topics_35 = []byte(`">`)
|
||||||
var topics_35 = []byte(`</a>
|
var topics_36 = []byte(`</a>
|
||||||
`)
|
`)
|
||||||
var topics_36 = []byte(`<span class="rowsmall topic_status_e topic_status_closed" title="Status: Closed"> | 🔒︎</span>`)
|
var topics_37 = []byte(`<span class="rowsmall topic_status_e topic_status_closed" title="Status: Closed"> | 🔒︎</span>`)
|
||||||
var topics_37 = []byte(`<span class="rowsmall topic_status_e topic_status_sticky" title="Status: Pinned"> | 📍︎</span>`)
|
var topics_38 = []byte(`<span class="rowsmall topic_status_e topic_status_sticky" title="Status: Pinned"> | 📍︎</span>`)
|
||||||
var topics_38 = []byte(`
|
var topics_39 = []byte(`
|
||||||
</span>
|
</span>
|
||||||
<span class="topic_inner_right rowsmall" style="float: right;">
|
<span class="topic_inner_right rowsmall" style="float: right;">
|
||||||
<span class="replyCount">`)
|
<span class="replyCount">`)
|
||||||
var topics_39 = []byte(`</span><br />
|
var topics_40 = []byte(`</span><br />
|
||||||
<span class="likeCount">`)
|
<span class="likeCount">`)
|
||||||
var topics_40 = []byte(`</span>
|
var topics_41 = []byte(`</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rowitem topic_right passive datarow `)
|
<div class="rowitem topic_right passive datarow `)
|
||||||
var topics_41 = []byte(`topic_sticky`)
|
var topics_42 = []byte(`topic_sticky`)
|
||||||
var topics_42 = []byte(`topic_closed`)
|
var topics_43 = []byte(`topic_closed`)
|
||||||
var topics_43 = []byte(`">
|
var topics_44 = []byte(`">
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var topics_44 = []byte(`"><img src="`)
|
var topics_45 = []byte(`"><img src="`)
|
||||||
var topics_45 = []byte(`" height="64" alt="`)
|
var topics_46 = []byte(`" height="64" alt="`)
|
||||||
var topics_46 = []byte(`'s Avatar" /></a>
|
var topics_47 = []byte(`'s Avatar" title="`)
|
||||||
|
var topics_48 = []byte(`'s Avatar" /></a>
|
||||||
<span>
|
<span>
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var topics_47 = []byte(`" class="lastName" style="font-size: 14px;">`)
|
var topics_49 = []byte(`" class="lastName" style="font-size: 14px;">`)
|
||||||
var topics_48 = []byte(`</a><br>
|
var topics_50 = []byte(`</a><br>
|
||||||
<span class="rowsmall lastReplyAt">`)
|
<span class="rowsmall lastReplyAt">`)
|
||||||
var topics_49 = []byte(`</span>
|
var topics_51 = []byte(`</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>`)
|
</div>`)
|
||||||
var topics_50 = []byte(`<div class="rowitem passive">There aren't any topics yet.`)
|
var topics_52 = []byte(`<div class="rowitem passive">There aren't any topics yet.`)
|
||||||
var topics_51 = []byte(` <a href="/topics/create/">Start one?</a>`)
|
var topics_53 = []byte(` <a href="/topics/create/">Start one?</a>`)
|
||||||
var topics_52 = []byte(`</div>`)
|
var topics_54 = []byte(`</div>`)
|
||||||
var topics_53 = []byte(`
|
var topics_55 = []byte(`
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
@ -933,7 +977,7 @@ var forum_19 = []byte(`
|
||||||
<div id="forum_topic_create_form" class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
<div id="forum_topic_create_form" class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
||||||
<form id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
<form id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
||||||
<img class="little_row_avatar" src="`)
|
<img class="little_row_avatar" src="`)
|
||||||
var forum_20 = []byte(`" height="64" alt="Your Avatar" />
|
var forum_20 = []byte(`" height="64" alt="Your Avatar" title="Your Avatar" />
|
||||||
<input form="topic_create_form_form" id="topic_board_input" name="topic-board" value="`)
|
<input form="topic_create_form_form" id="topic_board_input" name="topic-board" value="`)
|
||||||
var forum_21 = []byte(`" type="hidden">
|
var forum_21 = []byte(`" type="hidden">
|
||||||
<div class="main_form">
|
<div class="main_form">
|
||||||
|
@ -977,48 +1021,50 @@ var forum_29 = []byte(`">
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var forum_30 = []byte(`"><img src="`)
|
var forum_30 = []byte(`"><img src="`)
|
||||||
var forum_31 = []byte(`" height="64" alt="`)
|
var forum_31 = []byte(`" height="64" alt="`)
|
||||||
var forum_32 = []byte(`'s Avatar" /></a>
|
var forum_32 = []byte(`'s Avatar" title="`)
|
||||||
|
var forum_33 = []byte(`'s Avatar" /></a>
|
||||||
<span class="topic_inner_left">
|
<span class="topic_inner_left">
|
||||||
<a class="rowtopic" href="`)
|
<a class="rowtopic" href="`)
|
||||||
var forum_33 = []byte(`"><span>`)
|
var forum_34 = []byte(`"><span>`)
|
||||||
var forum_34 = []byte(`</span></a>
|
var forum_35 = []byte(`</span></a>
|
||||||
<br /><a class="rowsmall starter" href="`)
|
<br /><a class="rowsmall starter" href="`)
|
||||||
var forum_35 = []byte(`">`)
|
var forum_36 = []byte(`">`)
|
||||||
var forum_36 = []byte(`</a>
|
var forum_37 = []byte(`</a>
|
||||||
`)
|
`)
|
||||||
var forum_37 = []byte(`<span class="rowsmall topic_status_e topic_status_closed" title="Status: Closed"> | 🔒︎</span>`)
|
var forum_38 = []byte(`<span class="rowsmall topic_status_e topic_status_closed" title="Status: Closed"> | 🔒︎</span>`)
|
||||||
var forum_38 = []byte(`<span class="rowsmall topic_status_e topic_status_sticky" title="Status: Pinned"> | 📍︎</span>`)
|
var forum_39 = []byte(`<span class="rowsmall topic_status_e topic_status_sticky" title="Status: Pinned"> | 📍︎</span>`)
|
||||||
var forum_39 = []byte(`
|
var forum_40 = []byte(`
|
||||||
</span>
|
</span>
|
||||||
<span class="topic_inner_right rowsmall" style="float: right;">
|
<span class="topic_inner_right rowsmall" style="float: right;">
|
||||||
<span class="replyCount">`)
|
<span class="replyCount">`)
|
||||||
var forum_40 = []byte(`</span><br />
|
var forum_41 = []byte(`</span><br />
|
||||||
<span class="likeCount">`)
|
<span class="likeCount">`)
|
||||||
var forum_41 = []byte(`</span>
|
var forum_42 = []byte(`</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rowitem topic_right passive datarow `)
|
<div class="rowitem topic_right passive datarow `)
|
||||||
var forum_42 = []byte(`topic_sticky`)
|
var forum_43 = []byte(`topic_sticky`)
|
||||||
var forum_43 = []byte(`topic_closed`)
|
var forum_44 = []byte(`topic_closed`)
|
||||||
var forum_44 = []byte(`">
|
var forum_45 = []byte(`">
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var forum_45 = []byte(`"><img src="`)
|
var forum_46 = []byte(`"><img src="`)
|
||||||
var forum_46 = []byte(`" height="64" alt="`)
|
var forum_47 = []byte(`" height="64" alt="`)
|
||||||
var forum_47 = []byte(`'s Avatar" /></a>
|
var forum_48 = []byte(`'s Avatar" title="`)
|
||||||
|
var forum_49 = []byte(`'s Avatar" /></a>
|
||||||
<span>
|
<span>
|
||||||
<a href="`)
|
<a href="`)
|
||||||
var forum_48 = []byte(`" class="lastName" style="font-size: 14px;">`)
|
var forum_50 = []byte(`" class="lastName" style="font-size: 14px;">`)
|
||||||
var forum_49 = []byte(`</a><br>
|
var forum_51 = []byte(`</a><br>
|
||||||
<span class="rowsmall lastReplyAt">`)
|
<span class="rowsmall lastReplyAt">`)
|
||||||
var forum_50 = []byte(`</span>
|
var forum_52 = []byte(`</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>`)
|
</div>`)
|
||||||
var forum_51 = []byte(`<div class="rowitem passive">There aren't any topics in this forum yet.`)
|
var forum_53 = []byte(`<div class="rowitem passive">There aren't any topics in this forum yet.`)
|
||||||
var forum_52 = []byte(` <a href="/topics/create/`)
|
var forum_54 = []byte(` <a href="/topics/create/`)
|
||||||
var forum_53 = []byte(`">Start one?</a>`)
|
var forum_55 = []byte(`">Start one?</a>`)
|
||||||
var forum_54 = []byte(`</div>`)
|
var forum_56 = []byte(`</div>`)
|
||||||
var forum_55 = []byte(`
|
var forum_57 = []byte(`
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
`)
|
`)
|
||||||
|
|
|
@ -79,86 +79,128 @@ w.Write([]byte(tmpl_profile_vars.ProfileOwner.Avatar))
|
||||||
w.Write(profile_1)
|
w.Write(profile_1)
|
||||||
w.Write([]byte(tmpl_profile_vars.ProfileOwner.Name))
|
w.Write([]byte(tmpl_profile_vars.ProfileOwner.Name))
|
||||||
w.Write(profile_2)
|
w.Write(profile_2)
|
||||||
if tmpl_profile_vars.ProfileOwner.Tag != "" {
|
w.Write([]byte(tmpl_profile_vars.ProfileOwner.Name))
|
||||||
w.Write(profile_3)
|
w.Write(profile_3)
|
||||||
w.Write([]byte(tmpl_profile_vars.ProfileOwner.Tag))
|
w.Write([]byte(tmpl_profile_vars.ProfileOwner.Name))
|
||||||
w.Write(profile_4)
|
w.Write(profile_4)
|
||||||
}
|
if tmpl_profile_vars.ProfileOwner.Tag != "" {
|
||||||
w.Write(profile_5)
|
w.Write(profile_5)
|
||||||
if tmpl_profile_vars.CurrentUser.IsSuperMod && !tmpl_profile_vars.ProfileOwner.IsSuperMod {
|
w.Write([]byte(tmpl_profile_vars.ProfileOwner.Tag))
|
||||||
w.Write(profile_6)
|
w.Write(profile_6)
|
||||||
if tmpl_profile_vars.ProfileOwner.IsBanned {
|
}
|
||||||
w.Write(profile_7)
|
w.Write(profile_7)
|
||||||
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
if tmpl_profile_vars.CurrentUser.IsSuperMod && !tmpl_profile_vars.ProfileOwner.IsSuperMod {
|
||||||
w.Write(profile_8)
|
w.Write(profile_8)
|
||||||
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
if tmpl_profile_vars.ProfileOwner.IsBanned {
|
||||||
w.Write(profile_9)
|
w.Write(profile_9)
|
||||||
} else {
|
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
||||||
w.Write(profile_10)
|
w.Write(profile_10)
|
||||||
}
|
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
||||||
w.Write(profile_11)
|
w.Write(profile_11)
|
||||||
}
|
} else {
|
||||||
w.Write(profile_12)
|
w.Write(profile_12)
|
||||||
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
|
||||||
w.Write(profile_13)
|
|
||||||
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
|
||||||
w.Write(profile_14)
|
|
||||||
if tmpl_profile_vars.CurrentUser.Perms.BanUsers {
|
|
||||||
w.Write(profile_15)
|
|
||||||
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
|
||||||
w.Write(profile_16)
|
|
||||||
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
|
||||||
w.Write(profile_17)
|
|
||||||
w.Write(profile_18)
|
|
||||||
}
|
}
|
||||||
|
w.Write(profile_13)
|
||||||
|
}
|
||||||
|
w.Write(profile_14)
|
||||||
|
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
||||||
|
w.Write(profile_15)
|
||||||
|
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
||||||
|
w.Write(profile_16)
|
||||||
|
if tmpl_profile_vars.CurrentUser.Perms.BanUsers {
|
||||||
|
w.Write(profile_17)
|
||||||
|
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
||||||
|
w.Write(profile_18)
|
||||||
|
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
||||||
w.Write(profile_19)
|
w.Write(profile_19)
|
||||||
|
w.Write(profile_20)
|
||||||
|
}
|
||||||
|
w.Write(profile_21)
|
||||||
|
if tmpl_profile_vars.Header.Theme.BgAvatars {
|
||||||
if len(tmpl_profile_vars.ItemList) != 0 {
|
if len(tmpl_profile_vars.ItemList) != 0 {
|
||||||
for _, item := range tmpl_profile_vars.ItemList {
|
for _, item := range tmpl_profile_vars.ItemList {
|
||||||
w.Write(profile_20)
|
w.Write(profile_comments_row_0)
|
||||||
w.Write([]byte(item.ClassName))
|
w.Write([]byte(item.ClassName))
|
||||||
w.Write(profile_21)
|
w.Write(profile_comments_row_1)
|
||||||
w.Write([]byte(item.Avatar))
|
w.Write([]byte(item.Avatar))
|
||||||
w.Write(profile_22)
|
w.Write(profile_comments_row_2)
|
||||||
if item.ContentLines <= 5 {
|
if item.ContentLines <= 5 {
|
||||||
w.Write(profile_23)
|
w.Write(profile_comments_row_3)
|
||||||
}
|
}
|
||||||
w.Write(profile_24)
|
w.Write(profile_comments_row_4)
|
||||||
w.Write([]byte(item.Avatar))
|
|
||||||
w.Write(profile_25)
|
|
||||||
w.Write([]byte(item.ContentHtml))
|
w.Write([]byte(item.ContentHtml))
|
||||||
w.Write(profile_26)
|
w.Write(profile_comments_row_5)
|
||||||
w.Write([]byte(item.UserLink))
|
w.Write([]byte(item.UserLink))
|
||||||
w.Write(profile_27)
|
w.Write(profile_comments_row_6)
|
||||||
w.Write([]byte(item.CreatedByName))
|
w.Write([]byte(item.CreatedByName))
|
||||||
w.Write(profile_28)
|
w.Write(profile_comments_row_7)
|
||||||
if tmpl_profile_vars.CurrentUser.IsMod {
|
if tmpl_profile_vars.CurrentUser.IsMod {
|
||||||
w.Write(profile_29)
|
w.Write(profile_comments_row_8)
|
||||||
w.Write([]byte(strconv.Itoa(item.ID)))
|
w.Write([]byte(strconv.Itoa(item.ID)))
|
||||||
w.Write(profile_30)
|
w.Write(profile_comments_row_9)
|
||||||
w.Write([]byte(strconv.Itoa(item.ID)))
|
w.Write([]byte(strconv.Itoa(item.ID)))
|
||||||
w.Write(profile_31)
|
w.Write(profile_comments_row_10)
|
||||||
}
|
}
|
||||||
w.Write(profile_32)
|
w.Write(profile_comments_row_11)
|
||||||
w.Write([]byte(strconv.Itoa(item.ID)))
|
w.Write([]byte(strconv.Itoa(item.ID)))
|
||||||
w.Write(profile_33)
|
w.Write(profile_comments_row_12)
|
||||||
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
||||||
w.Write(profile_34)
|
w.Write(profile_comments_row_13)
|
||||||
if item.Tag != "" {
|
if item.Tag != "" {
|
||||||
w.Write(profile_35)
|
w.Write(profile_comments_row_14)
|
||||||
w.Write([]byte(item.Tag))
|
w.Write([]byte(item.Tag))
|
||||||
w.Write(profile_36)
|
w.Write(profile_comments_row_15)
|
||||||
}
|
}
|
||||||
w.Write(profile_37)
|
w.Write(profile_comments_row_16)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.Write(profile_38)
|
} else {
|
||||||
|
if len(tmpl_profile_vars.ItemList) != 0 {
|
||||||
|
for _, item := range tmpl_profile_vars.ItemList {
|
||||||
|
w.Write(profile_comments_row_17)
|
||||||
|
w.Write([]byte(item.ClassName))
|
||||||
|
w.Write(profile_comments_row_18)
|
||||||
|
w.Write([]byte(item.Avatar))
|
||||||
|
w.Write(profile_comments_row_19)
|
||||||
|
w.Write([]byte(item.CreatedByName))
|
||||||
|
w.Write(profile_comments_row_20)
|
||||||
|
w.Write([]byte(item.CreatedByName))
|
||||||
|
w.Write(profile_comments_row_21)
|
||||||
|
w.Write([]byte(item.UserLink))
|
||||||
|
w.Write(profile_comments_row_22)
|
||||||
|
w.Write([]byte(item.CreatedByName))
|
||||||
|
w.Write(profile_comments_row_23)
|
||||||
|
if item.Tag != "" {
|
||||||
|
w.Write(profile_comments_row_24)
|
||||||
|
w.Write([]byte(item.Tag))
|
||||||
|
w.Write(profile_comments_row_25)
|
||||||
|
}
|
||||||
|
w.Write(profile_comments_row_26)
|
||||||
|
w.Write([]byte(item.ContentHtml))
|
||||||
|
w.Write(profile_comments_row_27)
|
||||||
|
if tmpl_profile_vars.CurrentUser.IsMod {
|
||||||
|
w.Write(profile_comments_row_28)
|
||||||
|
w.Write([]byte(strconv.Itoa(item.ID)))
|
||||||
|
w.Write(profile_comments_row_29)
|
||||||
|
w.Write([]byte(strconv.Itoa(item.ID)))
|
||||||
|
w.Write(profile_comments_row_30)
|
||||||
|
}
|
||||||
|
w.Write(profile_comments_row_31)
|
||||||
|
w.Write([]byte(strconv.Itoa(item.ID)))
|
||||||
|
w.Write(profile_comments_row_32)
|
||||||
|
w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
||||||
|
w.Write(profile_comments_row_33)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
w.Write(profile_22)
|
||||||
if !tmpl_profile_vars.CurrentUser.IsBanned {
|
if !tmpl_profile_vars.CurrentUser.IsBanned {
|
||||||
w.Write(profile_39)
|
w.Write(profile_23)
|
||||||
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID)))
|
||||||
w.Write(profile_40)
|
w.Write(profile_24)
|
||||||
}
|
}
|
||||||
w.Write(profile_41)
|
w.Write(profile_25)
|
||||||
w.Write(profile_42)
|
w.Write(profile_26)
|
||||||
w.Write(footer_0)
|
w.Write(footer_0)
|
||||||
w.Write([]byte(common.BuildWidget("footer",tmpl_profile_vars.Header)))
|
w.Write([]byte(common.BuildWidget("footer",tmpl_profile_vars.Header)))
|
||||||
w.Write(footer_1)
|
w.Write(footer_1)
|
||||||
|
|
|
@ -135,62 +135,66 @@ w.Write([]byte(item.Creator.Avatar))
|
||||||
w.Write(topics_26)
|
w.Write(topics_26)
|
||||||
w.Write([]byte(item.Creator.Name))
|
w.Write([]byte(item.Creator.Name))
|
||||||
w.Write(topics_27)
|
w.Write(topics_27)
|
||||||
w.Write([]byte(item.Link))
|
|
||||||
w.Write(topics_28)
|
|
||||||
w.Write([]byte(item.Title))
|
|
||||||
w.Write(topics_29)
|
|
||||||
if item.ForumName != "" {
|
|
||||||
w.Write(topics_30)
|
|
||||||
w.Write([]byte(item.ForumLink))
|
|
||||||
w.Write(topics_31)
|
|
||||||
w.Write([]byte(item.ForumName))
|
|
||||||
w.Write(topics_32)
|
|
||||||
}
|
|
||||||
w.Write(topics_33)
|
|
||||||
w.Write([]byte(item.Creator.Link))
|
|
||||||
w.Write(topics_34)
|
|
||||||
w.Write([]byte(item.Creator.Name))
|
w.Write([]byte(item.Creator.Name))
|
||||||
w.Write(topics_35)
|
w.Write(topics_28)
|
||||||
if item.IsClosed {
|
w.Write([]byte(item.Link))
|
||||||
w.Write(topics_36)
|
w.Write(topics_29)
|
||||||
|
w.Write([]byte(item.Title))
|
||||||
|
w.Write(topics_30)
|
||||||
|
if item.ForumName != "" {
|
||||||
|
w.Write(topics_31)
|
||||||
|
w.Write([]byte(item.ForumLink))
|
||||||
|
w.Write(topics_32)
|
||||||
|
w.Write([]byte(item.ForumName))
|
||||||
|
w.Write(topics_33)
|
||||||
}
|
}
|
||||||
if item.Sticky {
|
w.Write(topics_34)
|
||||||
|
w.Write([]byte(item.Creator.Link))
|
||||||
|
w.Write(topics_35)
|
||||||
|
w.Write([]byte(item.Creator.Name))
|
||||||
|
w.Write(topics_36)
|
||||||
|
if item.IsClosed {
|
||||||
w.Write(topics_37)
|
w.Write(topics_37)
|
||||||
}
|
}
|
||||||
w.Write(topics_38)
|
|
||||||
w.Write([]byte(strconv.Itoa(item.PostCount)))
|
|
||||||
w.Write(topics_39)
|
|
||||||
w.Write([]byte(strconv.Itoa(item.LikeCount)))
|
|
||||||
w.Write(topics_40)
|
|
||||||
if item.Sticky {
|
if item.Sticky {
|
||||||
|
w.Write(topics_38)
|
||||||
|
}
|
||||||
|
w.Write(topics_39)
|
||||||
|
w.Write([]byte(strconv.Itoa(item.PostCount)))
|
||||||
|
w.Write(topics_40)
|
||||||
|
w.Write([]byte(strconv.Itoa(item.LikeCount)))
|
||||||
w.Write(topics_41)
|
w.Write(topics_41)
|
||||||
|
if item.Sticky {
|
||||||
|
w.Write(topics_42)
|
||||||
} else {
|
} else {
|
||||||
if item.IsClosed {
|
if item.IsClosed {
|
||||||
w.Write(topics_42)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
w.Write(topics_43)
|
w.Write(topics_43)
|
||||||
w.Write([]byte(item.LastUser.Link))
|
}
|
||||||
|
}
|
||||||
w.Write(topics_44)
|
w.Write(topics_44)
|
||||||
w.Write([]byte(item.LastUser.Avatar))
|
|
||||||
w.Write(topics_45)
|
|
||||||
w.Write([]byte(item.LastUser.Name))
|
|
||||||
w.Write(topics_46)
|
|
||||||
w.Write([]byte(item.LastUser.Link))
|
w.Write([]byte(item.LastUser.Link))
|
||||||
|
w.Write(topics_45)
|
||||||
|
w.Write([]byte(item.LastUser.Avatar))
|
||||||
|
w.Write(topics_46)
|
||||||
|
w.Write([]byte(item.LastUser.Name))
|
||||||
w.Write(topics_47)
|
w.Write(topics_47)
|
||||||
w.Write([]byte(item.LastUser.Name))
|
w.Write([]byte(item.LastUser.Name))
|
||||||
w.Write(topics_48)
|
w.Write(topics_48)
|
||||||
w.Write([]byte(item.RelativeLastReplyAt))
|
w.Write([]byte(item.LastUser.Link))
|
||||||
w.Write(topics_49)
|
w.Write(topics_49)
|
||||||
}
|
w.Write([]byte(item.LastUser.Name))
|
||||||
} else {
|
|
||||||
w.Write(topics_50)
|
w.Write(topics_50)
|
||||||
if tmpl_topics_vars.CurrentUser.Perms.CreateTopic {
|
w.Write([]byte(item.RelativeLastReplyAt))
|
||||||
w.Write(topics_51)
|
w.Write(topics_51)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
w.Write(topics_52)
|
w.Write(topics_52)
|
||||||
}
|
if tmpl_topics_vars.CurrentUser.Perms.CreateTopic {
|
||||||
w.Write(topics_53)
|
w.Write(topics_53)
|
||||||
|
}
|
||||||
|
w.Write(topics_54)
|
||||||
|
}
|
||||||
|
w.Write(topics_55)
|
||||||
w.Write(footer_0)
|
w.Write(footer_0)
|
||||||
w.Write([]byte(common.BuildWidget("footer",tmpl_topics_vars.Header)))
|
w.Write([]byte(common.BuildWidget("footer",tmpl_topics_vars.Header)))
|
||||||
w.Write(footer_1)
|
w.Write(footer_1)
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
{{if .CurrentUser.Perms.CreateTopic}}
|
{{if .CurrentUser.Perms.CreateTopic}}
|
||||||
<div id="forum_topic_create_form" class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
<div id="forum_topic_create_form" class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
||||||
<form id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
<form id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
||||||
<img class="little_row_avatar" src="{{.CurrentUser.Avatar}}" height="64" alt="Your Avatar" />
|
<img class="little_row_avatar" src="{{.CurrentUser.Avatar}}" height="64" alt="Your Avatar" title="Your Avatar" />
|
||||||
<input form="topic_create_form_form" id="topic_board_input" name="topic-board" value="{{.Forum.ID}}" type="hidden">
|
<input form="topic_create_form_form" id="topic_board_input" name="topic-board" value="{{.Forum.ID}}" type="hidden">
|
||||||
<div class="main_form">
|
<div class="main_form">
|
||||||
<div class="topic_meta">
|
<div class="topic_meta">
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
{{range .ItemList}}<div class="topic_row" data-tid="{{.ID}}">
|
{{range .ItemList}}<div class="topic_row" data-tid="{{.ID}}">
|
||||||
<div class="rowitem topic_left passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
<div class="rowitem topic_left passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
||||||
<span class="selector"></span>
|
<span class="selector"></span>
|
||||||
<a href="{{.Creator.Link}}"><img src="{{.Creator.Avatar}}" height="64" alt="{{.Creator.Avatar}}'s Avatar" /></a>
|
<a href="{{.Creator.Link}}"><img src="{{.Creator.Avatar}}" height="64" alt="{{.Creator.Name}}'s Avatar" title="{{.Creator.Name}}'s Avatar" /></a>
|
||||||
<span class="topic_inner_left">
|
<span class="topic_inner_left">
|
||||||
<a class="rowtopic" href="{{.Link}}"><span>{{.Title}}</span></a>
|
<a class="rowtopic" href="{{.Link}}"><span>{{.Title}}</span></a>
|
||||||
<br /><a class="rowsmall starter" href="{{.Creator.Link}}">{{.Creator.Name}}</a>
|
<br /><a class="rowsmall starter" href="{{.Creator.Link}}">{{.Creator.Name}}</a>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rowitem topic_right passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
<div class="rowitem topic_right passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
||||||
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.Avatar}}" height="64" alt="{{.LastUser.Name}}'s Avatar" /></a>
|
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.Avatar}}" height="64" alt="{{.LastUser.Name}}'s Avatar" title="{{.LastUser.Name}}'s Avatar" /></a>
|
||||||
<span>
|
<span>
|
||||||
<a href="{{.LastUser.Link}}" class="lastName" style="font-size: 14px;">{{.LastUser.Name}}</a><br>
|
<a href="{{.LastUser.Link}}" class="lastName" style="font-size: 14px;">{{.LastUser.Name}}</a><br>
|
||||||
<span class="rowsmall lastReplyAt">{{.RelativeLastReplyAt}}</span>
|
<span class="rowsmall lastReplyAt">{{.RelativeLastReplyAt}}</span>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="forum_right shift_right">
|
<span class="forum_right shift_right">
|
||||||
{{if .LastReplyer.Avatar}}<img class="extra_little_row_avatar" src="{{.LastReplyer.Avatar}}" height=64 width=64 />{{end}}
|
{{if .LastReplyer.Avatar}}<img class="extra_little_row_avatar" src="{{.LastReplyer.Avatar}}" height=64 width=64 alt="{{.LastReplyer.Name}}'s Avatar" title="{{.LastReplyer.Name}}'s Avatar" />{{end}}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{.LastTopic.Link}}">{{if .LastTopic.Title}}{{.LastTopic.Title}}{{else}}None{{end}}</a>
|
<a href="{{.LastTopic.Link}}">{{if .LastTopic.Title}}{{.LastTopic.Title}}{{else}}None{{end}}</a>
|
||||||
{{if .LastTopicTime}}<br /><span class="rowsmall">{{.LastTopicTime}}</span>{{end}}
|
{{if .LastTopicTime}}<br /><span class="rowsmall">{{.LastTopicTime}}</span>{{end}}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<div class="formitem"><input name="password" type="password" autocomplete="current-password" placeholder="*****" required /></div>
|
<div class="formitem"><input name="password" type="password" autocomplete="current-password" placeholder="*****" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="formrow">
|
<div class="formrow">
|
||||||
<div class="formitem"><button name="login-button" class="formbutton">Login</div>
|
<div class="formitem"><button name="login-button" class="formbutton">Login</button></div>
|
||||||
<div class="formitem" style="color: #505050; font-size: 12px; font-weight: normal; float: right;">Don't have an account?</div>
|
<div class="formitem" style="color: #505050; font-size: 12px; font-weight: normal; float: right;">Don't have an account?</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div id="profile_left_pane" class="rowmenu">
|
<div id="profile_left_pane" class="rowmenu">
|
||||||
<div class="topBlock">
|
<div class="topBlock">
|
||||||
<div class="rowitem avatarRow">
|
<div class="rowitem avatarRow">
|
||||||
<img src="{{.ProfileOwner.Avatar}}" class="avatar" />
|
<img src="{{.ProfileOwner.Avatar}}" class="avatar" alt="{{.ProfileOwner.Name}}'s Avatar" title="{{.ProfileOwner.Name}}'s Avatar" />
|
||||||
</div>
|
</div>
|
||||||
<div class="rowitem nameRow">
|
<div class="rowitem nameRow">
|
||||||
<span class="profileName">{{.ProfileOwner.Name}}</span>{{if .ProfileOwner.Tag}}<span class="username">{{.ProfileOwner.Tag}}</span>{{end}}
|
<span class="profileName">{{.ProfileOwner.Name}}</span>{{if .ProfileOwner.Tag}}<span class="username">{{.ProfileOwner.Tag}}</span>{{end}}
|
||||||
|
@ -69,23 +69,9 @@
|
||||||
<div id="profile_comments_head" class="colstack_item colstack_head hash_hide">
|
<div id="profile_comments_head" class="colstack_item colstack_head hash_hide">
|
||||||
<div class="rowitem"><h1>Comments</h1></div>
|
<div class="rowitem"><h1>Comments</h1></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="profile_comments" class="colstack_item hash_hide">{{range .ItemList}}
|
<div id="profile_comments" class="colstack_item hash_hide">
|
||||||
<div class="rowitem passive deletable_block editable_parent simple {{.ClassName}}" style="background-image: url({{.Avatar}}), url(/static/post-avatar-bg.jpg);background-position: 0px {{if le .ContentLines 5}}-1{{end}}0px;">
|
{{template "profile_comments_row.html" . }}
|
||||||
<img class="bgsub" src="{{.Avatar}}" />
|
</div>
|
||||||
<span class="editable_block user_content simple">{{.ContentHtml}}</span>
|
|
||||||
<span class="controls">
|
|
||||||
<a href="{{.UserLink}}" class="real_username username">{{.CreatedByName}}</a>
|
|
||||||
|
|
||||||
{{if $.CurrentUser.IsMod}}<a href="/profile/reply/edit/submit/{{.ID}}" class="mod_button" title="Edit Item"><button class="username edit_item edit_label"></button></a>
|
|
||||||
|
|
||||||
<a href="/profile/reply/delete/submit/{{.ID}}" class="mod_button" title="Delete Item"><button class="username delete_item trash_label"></button></a>{{end}}
|
|
||||||
|
|
||||||
<a class="mod_button" href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=user-reply"><button class="username report_item flag_label"></button></a>
|
|
||||||
|
|
||||||
{{if .Tag}}<a class="username hide_on_mobile user_tag" style="float: right;">{{.Tag}}</a>{{end}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{{end}}</div>
|
|
||||||
|
|
||||||
{{if not .CurrentUser.IsBanned}}
|
{{if not .CurrentUser.IsBanned}}
|
||||||
<form id="profile_comments_form" class="hash_hide" action="/profile/reply/create/" method="post">
|
<form id="profile_comments_form" class="hash_hide" action="/profile/reply/create/" method="post">
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
{{/** TODO: Temporary hack until we find a more granular way of doing this. Perhaps, a custom include function? **/}}
|
||||||
|
{{if .Header.Theme.BgAvatars}}
|
||||||
|
{{range .ItemList}}
|
||||||
|
<div class="rowitem passive deletable_block editable_parent simple {{.ClassName}}" style="background-image: url({{.Avatar}}), url(/static/post-avatar-bg.jpg);background-position: 0px {{if le .ContentLines 5}}-1{{end}}0px;">
|
||||||
|
<span class="editable_block user_content simple">{{.ContentHtml}}</span>
|
||||||
|
<span class="controls">
|
||||||
|
<a href="{{.UserLink}}" class="real_username username">{{.CreatedByName}}</a>
|
||||||
|
|
||||||
|
{{if $.CurrentUser.IsMod}}<a href="/profile/reply/edit/submit/{{.ID}}" class="mod_button" title="Edit Item"><button class="username edit_item edit_label"></button></a>
|
||||||
|
|
||||||
|
<a href="/profile/reply/delete/submit/{{.ID}}" class="mod_button" title="Delete Item"><button class="username delete_item trash_label"></button></a>{{end}}
|
||||||
|
|
||||||
|
<a class="mod_button" href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=user-reply"><button class="username report_item flag_label"></button></a>
|
||||||
|
|
||||||
|
{{if .Tag}}<a class="username hide_on_mobile user_tag" style="float: right;">{{.Tag}}</a>{{end}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{else}}
|
||||||
|
{{range .ItemList}}
|
||||||
|
<div class="rowitem passive deletable_block editable_parent comment {{.ClassName}}">
|
||||||
|
<div class="userbit">
|
||||||
|
<img src="{{.Avatar}}" alt="{{.CreatedByName}}'s Avatar" title="{{.CreatedByName}}'s Avatar" />
|
||||||
|
<span class="nameAndTitle">
|
||||||
|
<a href="{{.UserLink}}" class="real_username username">{{.CreatedByName}}</a>
|
||||||
|
{{if .Tag}}<a class="username hide_on_mobile user_tag" style="float: right;">{{.Tag}}</a>{{end}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="content_column">
|
||||||
|
<span class="editable_block user_content">{{.ContentHtml}}</span>
|
||||||
|
<span class="controls">
|
||||||
|
{{if $.CurrentUser.IsMod}}
|
||||||
|
<a href="/profile/reply/edit/submit/{{.ID}}" class="mod_button" title="Edit Item"><button class="username edit_item edit_label"></button></a>
|
||||||
|
<a href="/profile/reply/delete/submit/{{.ID}}" class="mod_button" title="Delete Item"><button class="username delete_item trash_label"></button></a>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
<a class="mod_button" href="/report/submit/{{.ID}}?session={{$.CurrentUser.Session}}&type=user-reply"><button class="username report_item flag_label"></button></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="formitem"><input name="confirm_password" type="password" placeholder="*****" aria-labelledby="confirm_password_label" required /></div>
|
<div class="formitem"><input name="confirm_password" type="password" placeholder="*****" aria-labelledby="confirm_password_label" required /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="formrow">
|
<div class="formrow">
|
||||||
<div class="formitem"><button name="register-button" class="formbutton">Create Account</div></div>
|
<div class="formitem"><button name="register-button" class="formbutton">Create Account</button></div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
{{if .ForumList}}
|
{{if .ForumList}}
|
||||||
<div class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
<div class="rowblock topic_create_form quick_create_form" style="display: none;" aria-label="Quick Topic Form">
|
||||||
<form name="topic_create_form_form" id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
<form name="topic_create_form_form" id="topic_create_form_form" enctype="multipart/form-data" action="/topic/create/submit/" method="post"></form>
|
||||||
<img class="little_row_avatar" src="{{.CurrentUser.Avatar}}" height="64" alt="Your Avatar" />
|
<img class="little_row_avatar" src="{{.CurrentUser.Avatar}}" height="64" alt="Your Avatar" title="Your Avatar" />
|
||||||
<div class="main_form">
|
<div class="main_form">
|
||||||
<div class="topic_meta">
|
<div class="topic_meta">
|
||||||
<div class="formrow topic_board_row real_first_child">
|
<div class="formrow topic_board_row real_first_child">
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
{{range .TopicList}}<div class="topic_row" data-tid="{{.ID}}">
|
{{range .TopicList}}<div class="topic_row" data-tid="{{.ID}}">
|
||||||
<div class="rowitem topic_left passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
<div class="rowitem topic_left passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
||||||
<span class="selector"></span>
|
<span class="selector"></span>
|
||||||
<a href="{{.Creator.Link}}"><img src="{{.Creator.Avatar}}" height="64" alt="{{.Creator.Name}}'s Avatar" /></a>
|
<a href="{{.Creator.Link}}"><img src="{{.Creator.Avatar}}" height="64" alt="{{.Creator.Name}}'s Avatar" title="{{.Creator.Name}}'s Avatar" /></a>
|
||||||
<span class="topic_inner_left">
|
<span class="topic_inner_left">
|
||||||
<a class="rowtopic" href="{{.Link}}"><span>{{.Title}}</span></a> {{if .ForumName}}<a class="rowsmall parent_forum" href="{{.ForumLink}}">{{.ForumName}}</a>{{end}}
|
<a class="rowtopic" href="{{.Link}}"><span>{{.Title}}</span></a> {{if .ForumName}}<a class="rowsmall parent_forum" href="{{.ForumLink}}">{{.ForumName}}</a>{{end}}
|
||||||
<br /><a class="rowsmall starter" href="{{.Creator.Link}}">{{.Creator.Name}}</a>
|
<br /><a class="rowsmall starter" href="{{.Creator.Link}}">{{.Creator.Name}}</a>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rowitem topic_right passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
<div class="rowitem topic_right passive datarow {{if .Sticky}}topic_sticky{{else if .IsClosed}}topic_closed{{end}}">
|
||||||
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.Avatar}}" height="64" alt="{{.LastUser.Name}}'s Avatar" /></a>
|
<a href="{{.LastUser.Link}}"><img src="{{.LastUser.Avatar}}" height="64" alt="{{.LastUser.Name}}'s Avatar" title="{{.LastUser.Name}}'s Avatar" /></a>
|
||||||
<span>
|
<span>
|
||||||
<a href="{{.LastUser.Link}}" class="lastName" style="font-size: 14px;">{{.LastUser.Name}}</a><br>
|
<a href="{{.LastUser.Link}}" class="lastName" style="font-size: 14px;">{{.LastUser.Name}}</a><br>
|
||||||
<span class="rowsmall lastReplyAt">{{.RelativeLastReplyAt}}</span>
|
<span class="rowsmall lastReplyAt">{{.RelativeLastReplyAt}}</span>
|
||||||
|
|
|
@ -929,6 +929,22 @@ select, input, textarea, button {
|
||||||
#profile_comments .rowitem {
|
#profile_comments .rowitem {
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
}
|
}
|
||||||
|
#profile_comments .comment .userbit {
|
||||||
|
display: flex;
|
||||||
|
margin-left: 14px;
|
||||||
|
margin-top: 14px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
#profile_comments .comment img {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 62px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
#profile_comments .comment .nameAndTitle {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
.colstack_item .formrow {
|
.colstack_item .formrow {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"Creator": "Azareal",
|
"Creator": "Azareal",
|
||||||
"FullImage": "shadow.png",
|
"FullImage": "shadow.png",
|
||||||
"URL": "github.com/Azareal/Gosora",
|
"URL": "github.com/Azareal/Gosora",
|
||||||
|
"BgAvatars":true,
|
||||||
"Resources": [
|
"Resources": [
|
||||||
{
|
{
|
||||||
"Name":"shadow/misc.js",
|
"Name":"shadow/misc.js",
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
"ForkOf": "tempra-simple",
|
"ForkOf": "tempra-simple",
|
||||||
"MobileFriendly": true,
|
"MobileFriendly": true,
|
||||||
"HideFromThemes": true,
|
"HideFromThemes": true,
|
||||||
|
"BgAvatars":true,
|
||||||
"URL": "github.com/Azareal/Gosora",
|
"URL": "github.com/Azareal/Gosora",
|
||||||
"Docks":["rightSidebar"]
|
"Docks":["rightSidebar"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"FullImage": "tempra-simple.png",
|
"FullImage": "tempra-simple.png",
|
||||||
"MobileFriendly": true,
|
"MobileFriendly": true,
|
||||||
"URL": "github.com/Azareal/Gosora",
|
"URL": "github.com/Azareal/Gosora",
|
||||||
|
"BgAvatars":true,
|
||||||
"Docks":["rightSidebar"],
|
"Docks":["rightSidebar"],
|
||||||
"Resources": [
|
"Resources": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue