Added support for meta descriptions. You can configure this from the Control Panel's Setting Manager.
Added tests for forum creation.
This commit is contained in:
parent
e492088b97
commit
e919812ee2
@ -17,9 +17,10 @@ type HeaderVars struct {
|
|||||||
Themes map[string]*Theme // TODO: Use a slice containing every theme instead of the main map for speed?
|
Themes map[string]*Theme // TODO: Use a slice containing every theme instead of the main map for speed?
|
||||||
Theme *Theme
|
Theme *Theme
|
||||||
//TemplateName string // TODO: Use this to move template calls to the router rather than duplicating them over and over and over?
|
//TemplateName string // TODO: Use this to move template calls to the router rather than duplicating them over and over and over?
|
||||||
Zone string
|
Zone string
|
||||||
Writer http.ResponseWriter
|
MetaDesc string
|
||||||
ExtData ExtData
|
Writer http.ResponseWriter
|
||||||
|
ExtData ExtData
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add this to routes which don't use templates. E.g. Json APIs.
|
// TODO: Add this to routes which don't use templates. E.g. Json APIs.
|
||||||
|
21
misc_test.go
21
misc_test.go
@ -129,6 +129,7 @@ func userStoreTest(t *testing.T, newUserID int) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
t.Error("We couldn't find UID #1 in the returned map")
|
t.Error("We couldn't find UID #1 in the returned map")
|
||||||
t.Error("userList", userList)
|
t.Error("userList", userList)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
expect(t, user.ID == 1, fmt.Sprintf("user.ID does not match the requested UID. Got '%d' instead.", user.ID))
|
expect(t, user.ID == 1, fmt.Sprintf("user.ID does not match the requested UID. Got '%d' instead.", user.ID))
|
||||||
|
|
||||||
@ -600,8 +601,26 @@ func TestForumStore(t *testing.T) {
|
|||||||
expect(t, !ok, "FID #0 shouldn't exist")
|
expect(t, !ok, "FID #0 shouldn't exist")
|
||||||
ok = common.Forums.Exists(1)
|
ok = common.Forums.Exists(1)
|
||||||
expect(t, ok, "FID #1 should exist")
|
expect(t, ok, "FID #1 should exist")
|
||||||
|
ok = common.Forums.Exists(2)
|
||||||
|
expect(t, ok, "FID #2 should exist")
|
||||||
|
ok = common.Forums.Exists(3)
|
||||||
|
expect(t, !ok, "FID #3 shouldn't exist")
|
||||||
|
|
||||||
// TODO: Test forum creation
|
fid, err := common.Forums.Create("Test Forum", "", true, "all")
|
||||||
|
expectNilErr(t, err)
|
||||||
|
expect(t, fid == 3, "The first forum we create should have an ID of 3")
|
||||||
|
ok = common.Forums.Exists(3)
|
||||||
|
expect(t, ok, "FID #2 should exist")
|
||||||
|
|
||||||
|
forum, err = common.Forums.Get(3)
|
||||||
|
recordMustExist(t, err, "Couldn't find FID #3")
|
||||||
|
|
||||||
|
expect(t, forum.ID == 2, fmt.Sprintf("The FID should be 3 not %d", forum.ID))
|
||||||
|
expect(t, forum.Name == "Test Forum", fmt.Sprintf("The name of the forum should be 'Test Forum' not '%s'", forum.Name))
|
||||||
|
expect(t, forum.Active, fmt.Sprintf("The test forum should be active"))
|
||||||
|
expect(t, forum.Desc == "", fmt.Sprintf("The forum description should be blank not '%s'", expectDesc, forum.Desc))
|
||||||
|
|
||||||
|
// TODO: More forum creation tests
|
||||||
// TODO: Test forum deletion
|
// TODO: Test forum deletion
|
||||||
// TODO: Test forum update
|
// TODO: Test forum update
|
||||||
}
|
}
|
||||||
|
@ -115,6 +115,7 @@ func seedTables(adapter qgen.Adapter) error {
|
|||||||
qgen.Install.SimpleInsert("settings", "name, content, type, constraints", "'activation_type','1','list','1-3'")
|
qgen.Install.SimpleInsert("settings", "name, content, type, constraints", "'activation_type','1','list','1-3'")
|
||||||
qgen.Install.SimpleInsert("settings", "name, content, type", "'bigpost_min_words','250','int'")
|
qgen.Install.SimpleInsert("settings", "name, content, type", "'bigpost_min_words','250','int'")
|
||||||
qgen.Install.SimpleInsert("settings", "name, content, type", "'megapost_min_words','1000','int'")
|
qgen.Install.SimpleInsert("settings", "name, content, type", "'megapost_min_words','1000','int'")
|
||||||
|
qgen.Install.SimpleInsert("settings", "name, content, type", "'meta_desc','','html-attribute'")
|
||||||
qgen.Install.SimpleInsert("themes", "uname, default", "'tempra-simple',1")
|
qgen.Install.SimpleInsert("themes", "uname, default", "'tempra-simple',1")
|
||||||
qgen.Install.SimpleInsert("emails", "email, uid, validated", "'admin@localhost',1,1") // ? - Use a different default email or let the admin input it during installation?
|
qgen.Install.SimpleInsert("emails", "email, uid, validated", "'admin@localhost',1,1") // ? - Use a different default email or let the admin input it during installation?
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ func routeTopics(w http.ResponseWriter, r *http.Request, user common.User) commo
|
|||||||
return ferr
|
return ferr
|
||||||
}
|
}
|
||||||
headerVars.Zone = "topics"
|
headerVars.Zone = "topics"
|
||||||
|
headerVars.MetaDesc = headerVars.Settings["meta_desc"].(string)
|
||||||
|
|
||||||
// TODO: Add a function for the qlist stuff
|
// TODO: Add a function for the qlist stuff
|
||||||
var qlist string
|
var qlist string
|
||||||
@ -316,6 +317,7 @@ func routeForum(w http.ResponseWriter, r *http.Request, user common.User, sfid s
|
|||||||
return common.InternalError(err, w, r)
|
return common.InternalError(err, w, r)
|
||||||
}
|
}
|
||||||
headerVars.Zone = "view_forum"
|
headerVars.Zone = "view_forum"
|
||||||
|
headerVars.MetaDesc = headerVars.Settings["meta_desc"].(string)
|
||||||
|
|
||||||
// Calculate the offset
|
// Calculate the offset
|
||||||
var offset int
|
var offset int
|
||||||
|
@ -3,6 +3,7 @@ INSERT INTO [settings] ([name],[content],[type]) VALUES ('url_tags','1','bool');
|
|||||||
INSERT INTO [settings] ([name],[content],[type],[constraints]) VALUES ('activation_type','1','list','1-3');
|
INSERT INTO [settings] ([name],[content],[type],[constraints]) VALUES ('activation_type','1','list','1-3');
|
||||||
INSERT INTO [settings] ([name],[content],[type]) VALUES ('bigpost_min_words','250','int');
|
INSERT INTO [settings] ([name],[content],[type]) VALUES ('bigpost_min_words','250','int');
|
||||||
INSERT INTO [settings] ([name],[content],[type]) VALUES ('megapost_min_words','1000','int');
|
INSERT INTO [settings] ([name],[content],[type]) VALUES ('megapost_min_words','1000','int');
|
||||||
|
INSERT INTO [settings] ([name],[content],[type]) VALUES ('meta_desc','','html-attribute');
|
||||||
INSERT INTO [themes] ([uname],[default]) VALUES ('tempra-simple',1);
|
INSERT INTO [themes] ([uname],[default]) VALUES ('tempra-simple',1);
|
||||||
INSERT INTO [emails] ([email],[uid],[validated]) VALUES ('admin@localhost',1,1);
|
INSERT INTO [emails] ([email],[uid],[validated]) VALUES ('admin@localhost',1,1);
|
||||||
INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[is_admin],[tag]) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,1,'Admin');
|
INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[is_admin],[tag]) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,1,'Admin');
|
||||||
|
@ -3,6 +3,7 @@ INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('url_tags','1','bool');
|
|||||||
INSERT INTO `settings`(`name`,`content`,`type`,`constraints`) VALUES ('activation_type','1','list','1-3');
|
INSERT INTO `settings`(`name`,`content`,`type`,`constraints`) VALUES ('activation_type','1','list','1-3');
|
||||||
INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('bigpost_min_words','250','int');
|
INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('bigpost_min_words','250','int');
|
||||||
INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('megapost_min_words','1000','int');
|
INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('megapost_min_words','1000','int');
|
||||||
|
INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('meta_desc','','html-attribute');
|
||||||
INSERT INTO `themes`(`uname`,`default`) VALUES ('tempra-simple',1);
|
INSERT INTO `themes`(`uname`,`default`) VALUES ('tempra-simple',1);
|
||||||
INSERT INTO `emails`(`email`,`uid`,`validated`) VALUES ('admin@localhost',1,1);
|
INSERT INTO `emails`(`email`,`uid`,`validated`) VALUES ('admin@localhost',1,1);
|
||||||
INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`is_admin`,`tag`) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,1,'Admin');
|
INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`is_admin`,`tag`) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}','{}',1,1,'Admin');
|
||||||
|
@ -27,3 +27,4 @@
|
|||||||
;
|
;
|
||||||
;
|
;
|
||||||
;
|
;
|
||||||
|
;
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
// Code generated by Gosora. More below:
|
// Code generated by Gosora. More below:
|
||||||
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
||||||
package main
|
package main
|
||||||
|
import "strconv"
|
||||||
import "net/http"
|
import "net/http"
|
||||||
import "./common"
|
import "./common"
|
||||||
import "strconv"
|
|
||||||
|
|
||||||
// nolint
|
// nolint
|
||||||
func init() {
|
func init() {
|
||||||
@ -44,10 +44,16 @@ w.Write([]byte(tmpl_forum_vars.CurrentUser.Session))
|
|||||||
w.Write(header_10)
|
w.Write(header_10)
|
||||||
w.Write([]byte(tmpl_forum_vars.Header.Site.URL))
|
w.Write([]byte(tmpl_forum_vars.Header.Site.URL))
|
||||||
w.Write(header_11)
|
w.Write(header_11)
|
||||||
if !tmpl_forum_vars.CurrentUser.IsSuperMod {
|
if tmpl_forum_vars.Header.MetaDesc != "" {
|
||||||
w.Write(header_12)
|
w.Write(header_12)
|
||||||
}
|
w.Write([]byte(tmpl_forum_vars.Header.MetaDesc))
|
||||||
w.Write(header_13)
|
w.Write(header_13)
|
||||||
|
}
|
||||||
|
w.Write(header_14)
|
||||||
|
if !tmpl_forum_vars.CurrentUser.IsSuperMod {
|
||||||
|
w.Write(header_15)
|
||||||
|
}
|
||||||
|
w.Write(header_16)
|
||||||
w.Write(menu_0)
|
w.Write(menu_0)
|
||||||
w.Write(menu_1)
|
w.Write(menu_1)
|
||||||
w.Write([]byte(tmpl_forum_vars.Header.Site.ShortName))
|
w.Write([]byte(tmpl_forum_vars.Header.Site.ShortName))
|
||||||
@ -62,16 +68,16 @@ w.Write(menu_5)
|
|||||||
w.Write(menu_6)
|
w.Write(menu_6)
|
||||||
}
|
}
|
||||||
w.Write(menu_7)
|
w.Write(menu_7)
|
||||||
w.Write(header_14)
|
w.Write(header_17)
|
||||||
if tmpl_forum_vars.Header.Widgets.RightSidebar != "" {
|
if tmpl_forum_vars.Header.Widgets.RightSidebar != "" {
|
||||||
w.Write(header_15)
|
w.Write(header_18)
|
||||||
}
|
}
|
||||||
w.Write(header_16)
|
w.Write(header_19)
|
||||||
if len(tmpl_forum_vars.Header.NoticeList) != 0 {
|
if len(tmpl_forum_vars.Header.NoticeList) != 0 {
|
||||||
for _, item := range tmpl_forum_vars.Header.NoticeList {
|
for _, item := range tmpl_forum_vars.Header.NoticeList {
|
||||||
w.Write(header_17)
|
w.Write(header_20)
|
||||||
w.Write([]byte(item))
|
w.Write([]byte(item))
|
||||||
w.Write(header_18)
|
w.Write(header_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if tmpl_forum_vars.Page > 1 {
|
if tmpl_forum_vars.Page > 1 {
|
||||||
|
@ -43,10 +43,16 @@ w.Write([]byte(tmpl_forums_vars.CurrentUser.Session))
|
|||||||
w.Write(header_10)
|
w.Write(header_10)
|
||||||
w.Write([]byte(tmpl_forums_vars.Header.Site.URL))
|
w.Write([]byte(tmpl_forums_vars.Header.Site.URL))
|
||||||
w.Write(header_11)
|
w.Write(header_11)
|
||||||
if !tmpl_forums_vars.CurrentUser.IsSuperMod {
|
if tmpl_forums_vars.Header.MetaDesc != "" {
|
||||||
w.Write(header_12)
|
w.Write(header_12)
|
||||||
}
|
w.Write([]byte(tmpl_forums_vars.Header.MetaDesc))
|
||||||
w.Write(header_13)
|
w.Write(header_13)
|
||||||
|
}
|
||||||
|
w.Write(header_14)
|
||||||
|
if !tmpl_forums_vars.CurrentUser.IsSuperMod {
|
||||||
|
w.Write(header_15)
|
||||||
|
}
|
||||||
|
w.Write(header_16)
|
||||||
w.Write(menu_0)
|
w.Write(menu_0)
|
||||||
w.Write(menu_1)
|
w.Write(menu_1)
|
||||||
w.Write([]byte(tmpl_forums_vars.Header.Site.ShortName))
|
w.Write([]byte(tmpl_forums_vars.Header.Site.ShortName))
|
||||||
@ -61,16 +67,16 @@ w.Write(menu_5)
|
|||||||
w.Write(menu_6)
|
w.Write(menu_6)
|
||||||
}
|
}
|
||||||
w.Write(menu_7)
|
w.Write(menu_7)
|
||||||
w.Write(header_14)
|
w.Write(header_17)
|
||||||
if tmpl_forums_vars.Header.Widgets.RightSidebar != "" {
|
if tmpl_forums_vars.Header.Widgets.RightSidebar != "" {
|
||||||
w.Write(header_15)
|
w.Write(header_18)
|
||||||
}
|
}
|
||||||
w.Write(header_16)
|
w.Write(header_19)
|
||||||
if len(tmpl_forums_vars.Header.NoticeList) != 0 {
|
if len(tmpl_forums_vars.Header.NoticeList) != 0 {
|
||||||
for _, item := range tmpl_forums_vars.Header.NoticeList {
|
for _, item := range tmpl_forums_vars.Header.NoticeList {
|
||||||
w.Write(header_17)
|
w.Write(header_20)
|
||||||
w.Write([]byte(item))
|
w.Write([]byte(item))
|
||||||
w.Write(header_18)
|
w.Write(header_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.Write(forums_0)
|
w.Write(forums_0)
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
// Code generated by Gosora. More below:
|
// Code generated by Gosora. More below:
|
||||||
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
||||||
package main
|
package main
|
||||||
import "net/http"
|
|
||||||
import "./common"
|
|
||||||
import "./extend/guilds/lib"
|
import "./extend/guilds/lib"
|
||||||
import "strconv"
|
import "strconv"
|
||||||
|
import "net/http"
|
||||||
|
import "./common"
|
||||||
|
|
||||||
// nolint
|
// nolint
|
||||||
func init() {
|
func init() {
|
||||||
@ -42,10 +42,16 @@ w.Write([]byte(tmpl_guilds_guild_list_vars.CurrentUser.Session))
|
|||||||
w.Write(header_10)
|
w.Write(header_10)
|
||||||
w.Write([]byte(tmpl_guilds_guild_list_vars.Header.Site.URL))
|
w.Write([]byte(tmpl_guilds_guild_list_vars.Header.Site.URL))
|
||||||
w.Write(header_11)
|
w.Write(header_11)
|
||||||
if !tmpl_guilds_guild_list_vars.CurrentUser.IsSuperMod {
|
if tmpl_guilds_guild_list_vars.Header.MetaDesc != "" {
|
||||||
w.Write(header_12)
|
w.Write(header_12)
|
||||||
}
|
w.Write([]byte(tmpl_guilds_guild_list_vars.Header.MetaDesc))
|
||||||
w.Write(header_13)
|
w.Write(header_13)
|
||||||
|
}
|
||||||
|
w.Write(header_14)
|
||||||
|
if !tmpl_guilds_guild_list_vars.CurrentUser.IsSuperMod {
|
||||||
|
w.Write(header_15)
|
||||||
|
}
|
||||||
|
w.Write(header_16)
|
||||||
w.Write(menu_0)
|
w.Write(menu_0)
|
||||||
w.Write(menu_1)
|
w.Write(menu_1)
|
||||||
w.Write([]byte(tmpl_guilds_guild_list_vars.Header.Site.ShortName))
|
w.Write([]byte(tmpl_guilds_guild_list_vars.Header.Site.ShortName))
|
||||||
@ -60,16 +66,16 @@ w.Write(menu_5)
|
|||||||
w.Write(menu_6)
|
w.Write(menu_6)
|
||||||
}
|
}
|
||||||
w.Write(menu_7)
|
w.Write(menu_7)
|
||||||
w.Write(header_14)
|
w.Write(header_17)
|
||||||
if tmpl_guilds_guild_list_vars.Header.Widgets.RightSidebar != "" {
|
if tmpl_guilds_guild_list_vars.Header.Widgets.RightSidebar != "" {
|
||||||
w.Write(header_15)
|
w.Write(header_18)
|
||||||
}
|
}
|
||||||
w.Write(header_16)
|
w.Write(header_19)
|
||||||
if len(tmpl_guilds_guild_list_vars.Header.NoticeList) != 0 {
|
if len(tmpl_guilds_guild_list_vars.Header.NoticeList) != 0 {
|
||||||
for _, item := range tmpl_guilds_guild_list_vars.Header.NoticeList {
|
for _, item := range tmpl_guilds_guild_list_vars.Header.NoticeList {
|
||||||
w.Write(header_17)
|
w.Write(header_20)
|
||||||
w.Write([]byte(item))
|
w.Write([]byte(item))
|
||||||
w.Write(header_18)
|
w.Write(header_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.Write(guilds_guild_list_0)
|
w.Write(guilds_guild_list_0)
|
||||||
|
@ -30,11 +30,15 @@ var header_11 = []byte(`";
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="/static/global.js"></script>
|
<script type="text/javascript" src="/static/global.js"></script>
|
||||||
<meta name="viewport" content="width=device-width,initial-scale = 1.0, maximum-scale=1.0,user-scalable=no" />
|
<meta name="viewport" content="width=device-width,initial-scale = 1.0, maximum-scale=1.0,user-scalable=no" />
|
||||||
|
`)
|
||||||
|
var header_12 = []byte(`<meta name="description" content="`)
|
||||||
|
var header_13 = []byte(`" />`)
|
||||||
|
var header_14 = []byte(`
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<style>`)
|
<style>`)
|
||||||
var header_12 = []byte(`.supermod_only { display: none !important; }`)
|
var header_15 = []byte(`.supermod_only { display: none !important; }`)
|
||||||
var header_13 = []byte(`</style>
|
var header_16 = []byte(`</style>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
`)
|
`)
|
||||||
var menu_0 = []byte(`<nav class="nav">
|
var menu_0 = []byte(`<nav class="nav">
|
||||||
@ -73,13 +77,13 @@ var menu_7 = []byte(`
|
|||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
</nav>
|
</nav>
|
||||||
`)
|
`)
|
||||||
var header_14 = []byte(`
|
var header_17 = []byte(`
|
||||||
<div id="back"><div id="main" `)
|
<div id="back"><div id="main" `)
|
||||||
var header_15 = []byte(`class="shrink_main"`)
|
var header_18 = []byte(`class="shrink_main"`)
|
||||||
var header_16 = []byte(`>
|
var header_19 = []byte(`>
|
||||||
`)
|
`)
|
||||||
var header_17 = []byte(`<div class="alert">`)
|
var header_20 = []byte(`<div class="alert">`)
|
||||||
var header_18 = []byte(`</div>`)
|
var header_21 = []byte(`</div>`)
|
||||||
var topic_0 = []byte(`
|
var topic_0 = []byte(`
|
||||||
|
|
||||||
<form id="edit_topic_form" action='/topic/edit/submit/`)
|
<form id="edit_topic_form" action='/topic/edit/submit/`)
|
||||||
|
@ -44,10 +44,16 @@ w.Write([]byte(tmpl_profile_vars.CurrentUser.Session))
|
|||||||
w.Write(header_10)
|
w.Write(header_10)
|
||||||
w.Write([]byte(tmpl_profile_vars.Header.Site.URL))
|
w.Write([]byte(tmpl_profile_vars.Header.Site.URL))
|
||||||
w.Write(header_11)
|
w.Write(header_11)
|
||||||
if !tmpl_profile_vars.CurrentUser.IsSuperMod {
|
if tmpl_profile_vars.Header.MetaDesc != "" {
|
||||||
w.Write(header_12)
|
w.Write(header_12)
|
||||||
}
|
w.Write([]byte(tmpl_profile_vars.Header.MetaDesc))
|
||||||
w.Write(header_13)
|
w.Write(header_13)
|
||||||
|
}
|
||||||
|
w.Write(header_14)
|
||||||
|
if !tmpl_profile_vars.CurrentUser.IsSuperMod {
|
||||||
|
w.Write(header_15)
|
||||||
|
}
|
||||||
|
w.Write(header_16)
|
||||||
w.Write(menu_0)
|
w.Write(menu_0)
|
||||||
w.Write(menu_1)
|
w.Write(menu_1)
|
||||||
w.Write([]byte(tmpl_profile_vars.Header.Site.ShortName))
|
w.Write([]byte(tmpl_profile_vars.Header.Site.ShortName))
|
||||||
@ -62,16 +68,16 @@ w.Write(menu_5)
|
|||||||
w.Write(menu_6)
|
w.Write(menu_6)
|
||||||
}
|
}
|
||||||
w.Write(menu_7)
|
w.Write(menu_7)
|
||||||
w.Write(header_14)
|
w.Write(header_17)
|
||||||
if tmpl_profile_vars.Header.Widgets.RightSidebar != "" {
|
if tmpl_profile_vars.Header.Widgets.RightSidebar != "" {
|
||||||
w.Write(header_15)
|
w.Write(header_18)
|
||||||
}
|
}
|
||||||
w.Write(header_16)
|
w.Write(header_19)
|
||||||
if len(tmpl_profile_vars.Header.NoticeList) != 0 {
|
if len(tmpl_profile_vars.Header.NoticeList) != 0 {
|
||||||
for _, item := range tmpl_profile_vars.Header.NoticeList {
|
for _, item := range tmpl_profile_vars.Header.NoticeList {
|
||||||
w.Write(header_17)
|
w.Write(header_20)
|
||||||
w.Write([]byte(item))
|
w.Write([]byte(item))
|
||||||
w.Write(header_18)
|
w.Write(header_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.Write(profile_0)
|
w.Write(profile_0)
|
||||||
|
@ -44,10 +44,16 @@ w.Write([]byte(tmpl_topic_vars.CurrentUser.Session))
|
|||||||
w.Write(header_10)
|
w.Write(header_10)
|
||||||
w.Write([]byte(tmpl_topic_vars.Header.Site.URL))
|
w.Write([]byte(tmpl_topic_vars.Header.Site.URL))
|
||||||
w.Write(header_11)
|
w.Write(header_11)
|
||||||
if !tmpl_topic_vars.CurrentUser.IsSuperMod {
|
if tmpl_topic_vars.Header.MetaDesc != "" {
|
||||||
w.Write(header_12)
|
w.Write(header_12)
|
||||||
}
|
w.Write([]byte(tmpl_topic_vars.Header.MetaDesc))
|
||||||
w.Write(header_13)
|
w.Write(header_13)
|
||||||
|
}
|
||||||
|
w.Write(header_14)
|
||||||
|
if !tmpl_topic_vars.CurrentUser.IsSuperMod {
|
||||||
|
w.Write(header_15)
|
||||||
|
}
|
||||||
|
w.Write(header_16)
|
||||||
w.Write(menu_0)
|
w.Write(menu_0)
|
||||||
w.Write(menu_1)
|
w.Write(menu_1)
|
||||||
w.Write([]byte(tmpl_topic_vars.Header.Site.ShortName))
|
w.Write([]byte(tmpl_topic_vars.Header.Site.ShortName))
|
||||||
@ -62,16 +68,16 @@ w.Write(menu_5)
|
|||||||
w.Write(menu_6)
|
w.Write(menu_6)
|
||||||
}
|
}
|
||||||
w.Write(menu_7)
|
w.Write(menu_7)
|
||||||
w.Write(header_14)
|
w.Write(header_17)
|
||||||
if tmpl_topic_vars.Header.Widgets.RightSidebar != "" {
|
if tmpl_topic_vars.Header.Widgets.RightSidebar != "" {
|
||||||
w.Write(header_15)
|
w.Write(header_18)
|
||||||
}
|
}
|
||||||
w.Write(header_16)
|
w.Write(header_19)
|
||||||
if len(tmpl_topic_vars.Header.NoticeList) != 0 {
|
if len(tmpl_topic_vars.Header.NoticeList) != 0 {
|
||||||
for _, item := range tmpl_topic_vars.Header.NoticeList {
|
for _, item := range tmpl_topic_vars.Header.NoticeList {
|
||||||
w.Write(header_17)
|
w.Write(header_20)
|
||||||
w.Write([]byte(item))
|
w.Write([]byte(item))
|
||||||
w.Write(header_18)
|
w.Write(header_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.Write(topic_0)
|
w.Write(topic_0)
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
// Code generated by Gosora. More below:
|
// Code generated by Gosora. More below:
|
||||||
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
/* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */
|
||||||
package main
|
package main
|
||||||
|
import "strconv"
|
||||||
import "net/http"
|
import "net/http"
|
||||||
import "./common"
|
import "./common"
|
||||||
import "strconv"
|
|
||||||
|
|
||||||
// nolint
|
// nolint
|
||||||
func init() {
|
func init() {
|
||||||
@ -44,10 +44,16 @@ w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session))
|
|||||||
w.Write(header_10)
|
w.Write(header_10)
|
||||||
w.Write([]byte(tmpl_topic_alt_vars.Header.Site.URL))
|
w.Write([]byte(tmpl_topic_alt_vars.Header.Site.URL))
|
||||||
w.Write(header_11)
|
w.Write(header_11)
|
||||||
if !tmpl_topic_alt_vars.CurrentUser.IsSuperMod {
|
if tmpl_topic_alt_vars.Header.MetaDesc != "" {
|
||||||
w.Write(header_12)
|
w.Write(header_12)
|
||||||
}
|
w.Write([]byte(tmpl_topic_alt_vars.Header.MetaDesc))
|
||||||
w.Write(header_13)
|
w.Write(header_13)
|
||||||
|
}
|
||||||
|
w.Write(header_14)
|
||||||
|
if !tmpl_topic_alt_vars.CurrentUser.IsSuperMod {
|
||||||
|
w.Write(header_15)
|
||||||
|
}
|
||||||
|
w.Write(header_16)
|
||||||
w.Write(menu_0)
|
w.Write(menu_0)
|
||||||
w.Write(menu_1)
|
w.Write(menu_1)
|
||||||
w.Write([]byte(tmpl_topic_alt_vars.Header.Site.ShortName))
|
w.Write([]byte(tmpl_topic_alt_vars.Header.Site.ShortName))
|
||||||
@ -62,16 +68,16 @@ w.Write(menu_5)
|
|||||||
w.Write(menu_6)
|
w.Write(menu_6)
|
||||||
}
|
}
|
||||||
w.Write(menu_7)
|
w.Write(menu_7)
|
||||||
w.Write(header_14)
|
w.Write(header_17)
|
||||||
if tmpl_topic_alt_vars.Header.Widgets.RightSidebar != "" {
|
if tmpl_topic_alt_vars.Header.Widgets.RightSidebar != "" {
|
||||||
w.Write(header_15)
|
w.Write(header_18)
|
||||||
}
|
}
|
||||||
w.Write(header_16)
|
w.Write(header_19)
|
||||||
if len(tmpl_topic_alt_vars.Header.NoticeList) != 0 {
|
if len(tmpl_topic_alt_vars.Header.NoticeList) != 0 {
|
||||||
for _, item := range tmpl_topic_alt_vars.Header.NoticeList {
|
for _, item := range tmpl_topic_alt_vars.Header.NoticeList {
|
||||||
w.Write(header_17)
|
w.Write(header_20)
|
||||||
w.Write([]byte(item))
|
w.Write([]byte(item))
|
||||||
w.Write(header_18)
|
w.Write(header_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if tmpl_topic_alt_vars.Page > 1 {
|
if tmpl_topic_alt_vars.Page > 1 {
|
||||||
|
@ -44,10 +44,16 @@ w.Write([]byte(tmpl_topics_vars.CurrentUser.Session))
|
|||||||
w.Write(header_10)
|
w.Write(header_10)
|
||||||
w.Write([]byte(tmpl_topics_vars.Header.Site.URL))
|
w.Write([]byte(tmpl_topics_vars.Header.Site.URL))
|
||||||
w.Write(header_11)
|
w.Write(header_11)
|
||||||
if !tmpl_topics_vars.CurrentUser.IsSuperMod {
|
if tmpl_topics_vars.Header.MetaDesc != "" {
|
||||||
w.Write(header_12)
|
w.Write(header_12)
|
||||||
}
|
w.Write([]byte(tmpl_topics_vars.Header.MetaDesc))
|
||||||
w.Write(header_13)
|
w.Write(header_13)
|
||||||
|
}
|
||||||
|
w.Write(header_14)
|
||||||
|
if !tmpl_topics_vars.CurrentUser.IsSuperMod {
|
||||||
|
w.Write(header_15)
|
||||||
|
}
|
||||||
|
w.Write(header_16)
|
||||||
w.Write(menu_0)
|
w.Write(menu_0)
|
||||||
w.Write(menu_1)
|
w.Write(menu_1)
|
||||||
w.Write([]byte(tmpl_topics_vars.Header.Site.ShortName))
|
w.Write([]byte(tmpl_topics_vars.Header.Site.ShortName))
|
||||||
@ -62,16 +68,16 @@ w.Write(menu_5)
|
|||||||
w.Write(menu_6)
|
w.Write(menu_6)
|
||||||
}
|
}
|
||||||
w.Write(menu_7)
|
w.Write(menu_7)
|
||||||
w.Write(header_14)
|
w.Write(header_17)
|
||||||
if tmpl_topics_vars.Header.Widgets.RightSidebar != "" {
|
if tmpl_topics_vars.Header.Widgets.RightSidebar != "" {
|
||||||
w.Write(header_15)
|
w.Write(header_18)
|
||||||
}
|
}
|
||||||
w.Write(header_16)
|
w.Write(header_19)
|
||||||
if len(tmpl_topics_vars.Header.NoticeList) != 0 {
|
if len(tmpl_topics_vars.Header.NoticeList) != 0 {
|
||||||
for _, item := range tmpl_topics_vars.Header.NoticeList {
|
for _, item := range tmpl_topics_vars.Header.NoticeList {
|
||||||
w.Write(header_17)
|
w.Write(header_20)
|
||||||
w.Write([]byte(item))
|
w.Write([]byte(item))
|
||||||
w.Write(header_18)
|
w.Write(header_21)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.Write(topics_0)
|
w.Write(topics_0)
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="/static/global.js"></script>
|
<script type="text/javascript" src="/static/global.js"></script>
|
||||||
<meta name="viewport" content="width=device-width,initial-scale = 1.0, maximum-scale=1.0,user-scalable=no" />
|
<meta name="viewport" content="width=device-width,initial-scale = 1.0, maximum-scale=1.0,user-scalable=no" />
|
||||||
|
{{if .Header.MetaDesc}}<meta name="description" content="{{.Header.MetaDesc}}" />{{end}}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<style>{{if not .CurrentUser.IsSuperMod}}.supermod_only { display: none !important; }{{end}}</style>
|
<style>{{if not .CurrentUser.IsSuperMod}}.supermod_only { display: none !important; }{{end}}</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user