From dbf2b8606e8b71608df53894a249e79ef42db38f Mon Sep 17 00:00:00 2001 From: Azareal Date: Mon, 23 Apr 2018 09:38:25 +0100 Subject: [PATCH] All the menu items are dynamic now, all that needs to be done now is the Control Panel part of the Menu Manager. Travis should now build the patcher to see if that works. Merged menu.html into header.html Removed a redundant SetAdapter call in mysql.go. Fixed a bug where inserting will sometimes strip the spaces in strings. Bumped the minimum Go Version in schema.json to 1.10 Bumped the DBVersion to 1, so that we don't install these patches twice. The patcher was botched in the previous commit, drop menus and menu_items and run it again --- .travis.yml | 2 + common/menus.go | 5 +- dev-update-travis | 11 ++ gen_tables.go | 13 +-- mysql.go | 6 -- patcher/main.go | 86 ++++----------- patcher/patches.go | 106 ++++++++++++++++++ query_gen/lib/querygen.go | 54 ++++++++++ query_gen/lib/utils.go | 2 +- query_gen/main.go | 74 +++++++++++-- schema/mssql/inserts.sql | 18 ++-- schema/mysql/inserts.sql | 18 ++-- schema/pgsql/inserts.sql | 6 ++ schema/schema.json | 4 +- template_error.go | 81 +++----------- template_forum.go | 147 +++++++++---------------- template_forums.go | 89 ++++----------- template_guilds_guild_list.go | 79 +++----------- template_ip_search.go | 87 ++++----------- template_list.go | 109 +++++++------------ template_login.go | 91 ++++------------ template_profile.go | 135 ++++++++--------------- template_register.go | 93 ++++------------ template_topic.go | 197 +++++++++++++--------------------- template_topic_alt.go | 173 +++++++++++------------------ template_topics.go | 147 +++++++++---------------- templates/header.html | 25 +++-- templates/menu.html | 23 ---- 28 files changed, 762 insertions(+), 1119 deletions(-) create mode 100644 dev-update-travis create mode 100644 patcher/patches.go delete mode 100644 templates/menu.html diff --git a/.travis.yml b/.travis.yml index 4a16e25b..c22196f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,10 @@ before_install: - cd Gosora - mv config_default.noparse config.go - chmod 755 ./update-deps-linux + - chmod 755 ./dev-update-travis - chmod 755 ./run-linux-tests - ./update-deps-linux + - ./dev-update-travis install: true script: ./run-linux-tests addons: diff --git a/common/menus.go b/common/menus.go index 8fb73745..032182f9 100644 --- a/common/menus.go +++ b/common/menus.go @@ -385,10 +385,11 @@ func (hold *MenuListHolder) Build(w io.Writer, user *User) error { if !hasDot { continue } - if bytes.Equal(variable[fenceStart:dotAt], []byte("me")) { + //fmt.Println("checking me: ", string(variable[fenceStart+1:dotAt])) + if bytes.Equal(variable[fenceStart+1:dotAt], []byte("me")) { //fmt.Println("maybe me variable") w.Write(variable[prevIndex:fenceStart]) - switch string(variable[dotAt:fenceEnd]) { + switch string(variable[dotAt+1 : fenceEnd]) { case "Link": w.Write([]byte(user.Link)) case "Session": diff --git a/dev-update-travis b/dev-update-travis new file mode 100644 index 00000000..9fd16dae --- /dev/null +++ b/dev-update-travis @@ -0,0 +1,11 @@ +echo "Building the patcher" +cp ./schema/schema.json ./schema/lastSchema.json +rm ./patcher/config.go +cp ./config.go ./patcher/config.go +rm ./patcher/common/site.go +cp ./common/site.go ./patcher/common/site.go +cd ./patcher +go generate +go build -o Patcher +mv ./Patcher .. +cd .. \ No newline at end of file diff --git a/gen_tables.go b/gen_tables.go index 304e49ad..703a8a05 100644 --- a/gen_tables.go +++ b/gen_tables.go @@ -2,16 +2,17 @@ package main var dbTablePrimaryKeys = map[string]string{ - "replies":"rid", + "users":"uid", + "topics":"tid", "revisions":"reviseID", + "polls":"pollID", "users_replies":"rid", "activity_stream":"asid", "word_filters":"wfid", "users_groups":"gid", - "topics":"tid", - "forums":"fid", - "attachments":"attachID", - "polls":"pollID", - "users":"uid", "users_groups_scheduler":"uid", + "forums":"fid", + "replies":"rid", + "attachments":"attachID", + "menus":"mid", } diff --git a/mysql.go b/mysql.go index 81cd0e0f..de509031 100644 --- a/mysql.go +++ b/mysql.go @@ -50,12 +50,6 @@ func initMySQL() (err error) { return err } - // Ready the query builder - err = qgen.Builder.SetAdapter("mysql") - if err != nil { - return err - } - // TODO: Is there a less noisy way of doing this for tests? log.Print("Preparing getActivityFeedByWatcher statement.") stmts.getActivityFeedByWatcher, err = db.Prepare("SELECT activity_stream_matches.asid, activity_stream.actor, activity_stream.targetUser, activity_stream.event, activity_stream.elementType, activity_stream.elementID FROM `activity_stream_matches` INNER JOIN `activity_stream` ON activity_stream_matches.asid = activity_stream.asid AND activity_stream_matches.watcher != activity_stream.actor WHERE `watcher` = ? ORDER BY activity_stream.asid DESC LIMIT 8") diff --git a/patcher/main.go b/patcher/main.go index 982810a9..41716024 100644 --- a/patcher/main.go +++ b/patcher/main.go @@ -3,7 +3,9 @@ package main import ( "bufio" "database/sql" + "encoding/json" "fmt" + "io/ioutil" "log" "os" "runtime/debug" @@ -13,8 +15,6 @@ import ( _ "github.com/go-sql-driver/mysql" ) -var db *sql.DB - func main() { scanner := bufio.NewScanner(os.Stdin) @@ -62,7 +62,7 @@ func pressAnyKey(scanner *bufio.Scanner) { } func prepMySQL() error { - err := qgen.Builder.Init("mysql", map[string]string{ + return qgen.Builder.Init("mysql", map[string]string{ "host": common.DbConfig.Host, "port": common.DbConfig.Port, "name": common.DbConfig.Dbname, @@ -70,13 +70,28 @@ func prepMySQL() error { "password": common.DbConfig.Password, "collation": "utf8mb4_general_ci", }) +} + +type SchemaFile struct { + DBVersion int // Current version of the database schema + DynamicFileVersion int + MinGoVersion string // TODO: Minimum version of Go needed to install this version + MinVersion string // TODO: Minimum version of Gosora to jump to this version, might be tricky as we don't store this in the schema file, maybe store it in the database +} + +func patcher(scanner *bufio.Scanner) error { + data, err := ioutil.ReadFile("./schema/lastSchema.json") if err != nil { return err } - // Ready the query builder - db = qgen.Builder.GetConn() - return qgen.Builder.SetAdapter("mysql") + var schemaFile LanguagePack + err = json.Unmarshal(data, &schemaFile) + if err != nil { + return err + } + _ = schemaFile + return patch0(scanner) } func execStmt(stmt *sql.Stmt, err error) error { @@ -87,65 +102,6 @@ func execStmt(stmt *sql.Stmt, err error) error { return err } -func patcher(scanner *bufio.Scanner) error { - err := execStmt(qgen.Builder.CreateTable("menus", "", "", - []qgen.DBTableColumn{ - qgen.DBTableColumn{"mid", "int", 0, false, true, ""}, - }, - []qgen.DBTableKey{ - qgen.DBTableKey{"mid", "primary"}, - }, - )) - if err != nil { - return err - } - - err = execStmt(qgen.Builder.CreateTable("menu_items", "", "", - []qgen.DBTableColumn{ - qgen.DBTableColumn{"mid", "int", 0, false, false, ""}, - qgen.DBTableColumn{"htmlID", "varchar", 200, false, false, "''"}, - qgen.DBTableColumn{"cssClass", "varchar", 200, false, false, "''"}, - qgen.DBTableColumn{"position", "varchar", 100, false, false, ""}, - qgen.DBTableColumn{"path", "varchar", 200, false, false, "''"}, - qgen.DBTableColumn{"aria", "varchar", 200, false, false, "''"}, - qgen.DBTableColumn{"tooltip", "varchar", 200, false, false, "''"}, - qgen.DBTableColumn{"tmplName", "varchar", 200, false, false, "''"}, - qgen.DBTableColumn{"order", "int", 0, false, false, "0"}, - - qgen.DBTableColumn{"guestOnly", "boolean", 0, false, false, "0"}, - qgen.DBTableColumn{"memberOnly", "boolean", 0, false, false, "0"}, - qgen.DBTableColumn{"staffOnly", "boolean", 0, false, false, "0"}, - qgen.DBTableColumn{"adminOnly", "boolean", 0, false, false, "0"}, - }, - []qgen.DBTableKey{}, - )) - if err != nil { - return err - } - - err = execStmt(qgen.Builder.SimpleInsert("menus", "", "")) - if err != nil { - return err - } - - err = execStmt(qgen.Builder.SimpleInsert("menu_items", "mid, htmlID, position, path, aria, tooltip, order", "1,'menu_forums','left','/forums/','{lang.menu_forums_aria}','{lang.menu_forums_tooltip}',0")) - if err != nil { - return err - } - - err = execStmt(qgen.Builder.SimpleInsert("menu_items", "mid, htmlID, cssClass, position, path, aria, tooltip, order", "1,'menu_topics','menu_topics','left','/topics/','{lang.menu_topics_aria}','{lang.menu_topics_tooltip}',1")) - if err != nil { - return err - } - - stmt, err = execStmt(qgen.Builder.SimpleInsert("menu_items", "mid, htmlID, cssClass, position, tmplName, order", "1,'general_alerts','menu_alerts','right','menu_alerts',2")) - if err != nil { - return err - } - - return nil -} - /*func eachUserQuick(handle func(int)) error { stmt, err := qgen.Builder.Select("users").Orderby("uid desc").Limit(1).Prepare() if err != nil { diff --git a/patcher/patches.go b/patcher/patches.go new file mode 100644 index 00000000..ca36e2b5 --- /dev/null +++ b/patcher/patches.go @@ -0,0 +1,106 @@ +package main + +import ( + "bufio" + "strconv" + + "../query_gen/lib" +) + +func patch0(scanner *bufio.Scanner) error { + err := execStmt(qgen.Builder.CreateTable("menus", "", "", + []qgen.DBTableColumn{ + qgen.DBTableColumn{"mid", "int", 0, false, true, ""}, + }, + []qgen.DBTableKey{ + qgen.DBTableKey{"mid", "primary"}, + }, + )) + if err != nil { + return err + } + + err = execStmt(qgen.Builder.CreateTable("menu_items", "", "", + []qgen.DBTableColumn{ + qgen.DBTableColumn{"mid", "int", 0, false, false, ""}, + qgen.DBTableColumn{"htmlID", "varchar", 200, false, false, "''"}, + qgen.DBTableColumn{"cssClass", "varchar", 200, false, false, "''"}, + qgen.DBTableColumn{"position", "varchar", 100, false, false, ""}, + qgen.DBTableColumn{"path", "varchar", 200, false, false, "''"}, + qgen.DBTableColumn{"aria", "varchar", 200, false, false, "''"}, + qgen.DBTableColumn{"tooltip", "varchar", 200, false, false, "''"}, + qgen.DBTableColumn{"tmplName", "varchar", 200, false, false, "''"}, + qgen.DBTableColumn{"order", "int", 0, false, false, "0"}, + + qgen.DBTableColumn{"guestOnly", "boolean", 0, false, false, "0"}, + qgen.DBTableColumn{"memberOnly", "boolean", 0, false, false, "0"}, + qgen.DBTableColumn{"staffOnly", "boolean", 0, false, false, "0"}, + qgen.DBTableColumn{"adminOnly", "boolean", 0, false, false, "0"}, + }, + []qgen.DBTableKey{}, + )) + if err != nil { + return err + } + + err = execStmt(qgen.Builder.SimpleInsert("menus", "", "")) + if err != nil { + return err + } + + var mOrder int + var mOrder = "mid, htmlID, cssClass, position, path, aria, tooltip, guestOnly, memberOnly, staffOnly, adminOnly" + var addMenuItem = func(data map[string]interface{}) error { + cols, values := qgen.InterfaceMapToInsertStrings(data, mOrder) + err := execStmt(qgen.Builder.SimpleInsert("menu_items", cols+", order", values+","+strconv.Itoa(mOrder))) + mOrder++ + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "htmlID": "menu_forums", "position": "left", "path": "/forums/", "aria": "{lang.menu_forums_aria}", "tooltip": "{lang.menu_forums_tooltip}"}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "htmlID": "menu_topics", "cssClass": "menu_topics", "position": "left", "path": "/topics/", "aria": "{lang.menu_topics_aria}", "tooltip": "{lang.menu_topics_tooltip}"}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "htmlID": "general_alerts", "cssClass": "menu_alerts", "position": "right", "tmplName": "menu_alerts"}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_account", "position": "left", "path": "/user/edit/critical/", "aria": "{lang.menu_account_aria}", "tooltip": "{lang.menu_account_tooltip}", "memberOnly": true}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_profile", "position": "left", "path": "{me.Link}", "aria": "{lang.menu_profile_aria}", "tooltip": "{lang.menu_profile_tooltip}", "memberOnly": true}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_panel menu_account", "position": "left", "path": "/panel/", "aria": "{lang.menu_panel_aria}", "tooltip": "{lang.menu_panel_tooltip}", "memberOnly": true, "staffOnly": true}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_logout", "position": "left", "path": "/accounts/logout/?session={me.Session}", "aria": "{lang.menu_logout_aria}", "tooltip": "{lang.menu_logout_tooltip}", "memberOnly": true}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_register", "position": "left", "path": "/accounts/create/", "aria": "{lang.menu_register_aria}", "tooltip": "{lang.menu_register_tooltip}", "guestOnly": true}) + if err != nil { + return err + } + + err = addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_login", "position": "left", "path": "/accounts/login/", "aria": "{lang.menu_login_aria}", "tooltip": "{lang.menu_login_tooltip}", "guestOnly": true}) + if err != nil { + return err + } + + return nil +} diff --git a/query_gen/lib/querygen.go b/query_gen/lib/querygen.go index 1808f311..5eac6431 100644 --- a/query_gen/lib/querygen.go +++ b/query_gen/lib/querygen.go @@ -4,6 +4,8 @@ package qgen import ( "database/sql" "errors" + "strconv" + "strings" ) var Registry []Adapter @@ -150,3 +152,55 @@ func PrepareMySQLUpsertCallback(db *sql.DB, query string) (*MySQLUpsertCallback, stmt, err := db.Prepare(query) return &MySQLUpsertCallback{stmt}, err } + +type LitStr string + +// TODO: Test this +func InterfaceMapToInsertStrings(data map[string]interface{}, order string) (cols string, values string) { + var done = make(map[string]bool) + var addValue = func(value interface{}) { + switch value := value.(type) { + case string: + values += "'" + strings.Replace(value, "'", "\\'", -1) + "'," + case int: + values += strconv.Itoa(value) + "," + case LitStr: + values += string(value) + "," + case bool: + if value { + values += "1," + } else { + values += "0," + } + } + } + + // Add the ordered items + for _, col := range strings.Split(order, ",") { + col = strings.TrimSpace(col) + value, ok := data[col] + if ok { + cols += col + "," + addValue(value) + done[col] = true + } + } + + // Go over any unordered items and add them at the end + if len(data) > len(done) { + for col, value := range data { + _, ok := done[col] + if ok { + continue + } + cols += col + "," + addValue(value) + } + } + + if cols != "" { + cols = cols[:len(cols)-1] + values = values[:len(values)-1] + } + return cols, values +} diff --git a/query_gen/lib/utils.go b/query_gen/lib/utils.go index 9c77aff9..e6cb5197 100644 --- a/query_gen/lib/utils.go +++ b/query_gen/lib/utils.go @@ -371,7 +371,7 @@ func processFields(fieldstr string) (fields []DBField) { fields = append(fields, DBField{Name: buffer, Type: getIdentifierType(buffer)}) buffer = "" lastItem = i + 1 - } else if (fieldstr[i] > 32) && fieldstr[i] != ',' && fieldstr[i] != ')' { + } else if (fieldstr[i] >= 32) && fieldstr[i] != ',' && fieldstr[i] != ')' { buffer += string(fieldstr[i]) } } diff --git a/query_gen/main.go b/query_gen/main.go index 49595b7e..77bdf352 100644 --- a/query_gen/main.go +++ b/query_gen/main.go @@ -6,6 +6,7 @@ import ( "log" "os" "runtime/debug" + "strconv" "./lib" ) @@ -210,16 +211,11 @@ func seedTables(adapter qgen.Adapter) error { qgen.Install.SimpleInsert("replies", "tid, content, parsed_content, createdAt, createdBy, lastUpdated, lastEdit, lastEditBy, ipaddress", "1,'A reply!','A reply!',UTC_TIMESTAMP(),1,UTC_TIMESTAMP(),0,0,'::1'") /* + Quick Reminder of the HTML layout, so I don't need to flip back and forth between menu_item.html, etc. + {{range .MenuItems}} {{end}} - - qgen.DBTableColumn{"guestOnly", "boolean", 1, false, false, "0"}, qgen.DBTableColumn{"memberOnly", "boolean", 1, false, false, "0"}, @@ -229,15 +225,73 @@ func seedTables(adapter qgen.Adapter) error { qgen.Install.SimpleInsert("menus", "", "") - qgen.Install.SimpleInsert("menu_items", "mid, htmlID, position, path, aria, tooltip, order", "1,'menu_forums','left','/forums/','{lang.menu_forums_aria}','{lang.menu_forums_tooltip}',0") + var order = 0 + var mOrder = "mid, htmlID, cssClass, position, path, aria, tooltip, guestOnly, memberOnly, staffOnly, adminOnly" + /*var addMenuItem = func(data map[string]interface{}) { + var cols, values string + for col, value := range data { + cols += col + "," + switch value := value.(type) { + case string: + values += "'" + strings.Replace(value, "'", "\\'", -1) + "'," + case int: + values += strconv.Itoa(value) + "," + case LitStr: + values += string(value) + "," + case bool: + if value { + values += "1," + } else { + values += "0," + } + } + } + if cols != "" { + cols = cols[:len(cols)-1] + values = values[:len(values)-1] + } + qgen.Install.SimpleInsert("menu_items", cols+", order", values+","+strconv.Itoa(order)) + order++ + }*/ - qgen.Install.SimpleInsert("menu_items", "mid, htmlID, cssClass, position, path, aria, tooltip, order", "1,'menu_topics','menu_topics','left','/topics/','{lang.menu_topics_aria}','{lang.menu_topics_tooltip}',1") + // Go maps have a random iteration order, so we have to do this, otherwise the schema files will become unstable and harder to audit + var addMenuItem = func(data map[string]interface{}) { + cols, values := qgen.InterfaceMapToInsertStrings(data, mOrder) + qgen.Install.SimpleInsert("menu_items", cols+", order", values+","+strconv.Itoa(order)) + order++ + } - qgen.Install.SimpleInsert("menu_items", "mid, htmlID, cssClass, position, tmplName, order", "1,'general_alerts','menu_alerts','right','menu_alerts',2") + addMenuItem(map[string]interface{}{"mid": 1, "htmlID": "menu_forums", "position": "left", "path": "/forums/", "aria": "{lang.menu_forums_aria}", "tooltip": "{lang.menu_forums_tooltip}"}) + + addMenuItem(map[string]interface{}{"mid": 1, "htmlID": "menu_topics", "cssClass": "menu_topics", "position": "left", "path": "/topics/", "aria": "{lang.menu_topics_aria}", "tooltip": "{lang.menu_topics_tooltip}"}) + + addMenuItem(map[string]interface{}{"mid": 1, "htmlID": "general_alerts", "cssClass": "menu_alerts", "position": "right", "tmplName": "menu_alerts"}) + + addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_account", "position": "left", "path": "/user/edit/critical/", "aria": "{lang.menu_account_aria}", "tooltip": "{lang.menu_account_tooltip}", "memberOnly": true}) + + addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_profile", "position": "left", "path": "{me.Link}", "aria": "{lang.menu_profile_aria}", "tooltip": "{lang.menu_profile_tooltip}", "memberOnly": true}) + + addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_panel menu_account", "position": "left", "path": "/panel/", "aria": "{lang.menu_panel_aria}", "tooltip": "{lang.menu_panel_tooltip}", "memberOnly": true, "staffOnly": true}) + + addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_logout", "position": "left", "path": "/accounts/logout/?session={me.Session}", "aria": "{lang.menu_logout_aria}", "tooltip": "{lang.menu_logout_tooltip}", "memberOnly": true}) + + addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_register", "position": "left", "path": "/accounts/create/", "aria": "{lang.menu_register_aria}", "tooltip": "{lang.menu_register_tooltip}", "guestOnly": true}) + + addMenuItem(map[string]interface{}{"mid": 1, "cssClass": "menu_login", "position": "left", "path": "/accounts/login/", "aria": "{lang.menu_login_aria}", "tooltip": "{lang.menu_login_tooltip}", "guestOnly": true}) return nil } +func copyInsertMap(in map[string]interface{}) (out map[string]interface{}) { + out = make(map[string]interface{}) + for col, value := range in { + out[col] = value + } + return out +} + +type LitStr string + func writeSelects(adapter qgen.Adapter) error { build := adapter.Builder() diff --git a/schema/mssql/inserts.sql b/schema/mssql/inserts.sql index f69a0924..b47026db 100644 --- a/schema/mssql/inserts.sql +++ b/schema/mssql/inserts.sql @@ -10,10 +10,10 @@ INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[is_adm INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[tag]) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":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,"MoveTopic":true}','{}',1,'Mod'); INSERT INTO [users_groups] ([name],[permissions],[plugin_perms]) VALUES ('Member','{"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"CreateReply":true}','{}'); INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_banned]) VALUES ('Banned','{"ViewTopic":true}','{}',1); -INSERT INTO [users_groups] ([name],[permissions],[plugin_perms]) VALUES ('AwaitingActivation','{"ViewTopic":true}','{}'); -INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[tag]) VALUES ('NotLoggedin','{"ViewTopic":true}','{}','Guest'); -INSERT INTO [forums] ([name],[active],[desc]) VALUES ('Reports',0,'Allthereportsgohere'); -INSERT INTO [forums] ([name],[lastTopicID],[lastReplyerID],[desc]) VALUES ('General',1,1,'Aplaceforgeneraldiscussionswhichdon''tfitelsewhere'); +INSERT INTO [users_groups] ([name],[permissions],[plugin_perms]) VALUES ('Awaiting Activation','{"ViewTopic":true}','{}'); +INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[tag]) VALUES ('Not Loggedin','{"ViewTopic":true}','{}','Guest'); +INSERT INTO [forums] ([name],[active],[desc]) VALUES ('Reports',0,'All the reports go here'); +INSERT INTO [forums] ([name],[lastTopicID],[lastReplyerID],[desc]) VALUES ('General',1,1,'A place for general discussions which don''t fit elsewhere'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (1,1,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"PinTopic":true,"CloseTopic":true}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (2,1,'{"ViewTopic":true,"CreateReply":true,"CloseTopic":true}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (3,1,'{}'); @@ -26,9 +26,15 @@ INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (3,2,'{"View INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (4,2,'{"ViewTopic":true}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (5,2,'{"ViewTopic":true}'); INSERT INTO [forums_permissions] ([gid],[fid],[permissions]) VALUES (6,2,'{"ViewTopic":true}'); -INSERT INTO [topics] ([title],[content],[parsed_content],[createdAt],[lastReplyAt],[lastReplyBy],[createdBy],[parentID],[ipaddress]) VALUES ('TestTopic','Atopicautomaticallygeneratedbythesoftware.','Atopicautomaticallygeneratedbythesoftware.',GETUTCDATE(),GETUTCDATE(),1,1,2,'::1'); -INSERT INTO [replies] ([tid],[content],[parsed_content],[createdAt],[createdBy],[lastUpdated],[lastEdit],[lastEditBy],[ipaddress]) VALUES (1,'Areply!','Areply!',GETUTCDATE(),1,GETUTCDATE(),0,0,'::1'); +INSERT INTO [topics] ([title],[content],[parsed_content],[createdAt],[lastReplyAt],[lastReplyBy],[createdBy],[parentID],[ipaddress]) VALUES ('Test Topic','A topic automatically generated by the software.','A topic automatically generated by the software.',GETUTCDATE(),GETUTCDATE(),1,1,2,'::1'); +INSERT INTO [replies] ([tid],[content],[parsed_content],[createdAt],[createdBy],[lastUpdated],[lastEdit],[lastEditBy],[ipaddress]) VALUES (1,'A reply!','A reply!',GETUTCDATE(),1,GETUTCDATE(),0,0,'::1'); INSERT INTO [menus]; INSERT INTO [menu_items] ([mid],[htmlID],[position],[path],[aria],[tooltip],[order]) VALUES (1,'menu_forums','left','/forums/','{lang.menu_forums_aria}','{lang.menu_forums_tooltip}',0); INSERT INTO [menu_items] ([mid],[htmlID],[cssClass],[position],[path],[aria],[tooltip],[order]) VALUES (1,'menu_topics','menu_topics','left','/topics/','{lang.menu_topics_aria}','{lang.menu_topics_tooltip}',1); INSERT INTO [menu_items] ([mid],[htmlID],[cssClass],[position],[tmplName],[order]) VALUES (1,'general_alerts','menu_alerts','right','menu_alerts',2); +INSERT INTO [menu_items] ([mid],[cssClass],[position],[path],[aria],[tooltip],[memberOnly],[order]) VALUES (1,'menu_account','left','/user/edit/critical/','{lang.menu_account_aria}','{lang.menu_account_tooltip}',1,3); +INSERT INTO [menu_items] ([mid],[cssClass],[position],[path],[aria],[tooltip],[memberOnly],[order]) VALUES (1,'menu_profile','left','{me.Link}','{lang.menu_profile_aria}','{lang.menu_profile_tooltip}',1,4); +INSERT INTO [menu_items] ([mid],[cssClass],[position],[path],[aria],[tooltip],[memberOnly],[staffOnly],[order]) VALUES (1,'menu_panel menu_account','left','/panel/','{lang.menu_panel_aria}','{lang.menu_panel_tooltip}',1,1,5); +INSERT INTO [menu_items] ([mid],[cssClass],[position],[path],[aria],[tooltip],[memberOnly],[order]) VALUES (1,'menu_logout','left','/accounts/logout/?session={me.Session}','{lang.menu_logout_aria}','{lang.menu_logout_tooltip}',1,6); +INSERT INTO [menu_items] ([mid],[cssClass],[position],[path],[aria],[tooltip],[guestOnly],[order]) VALUES (1,'menu_register','left','/accounts/create/','{lang.menu_register_aria}','{lang.menu_register_tooltip}',1,7); +INSERT INTO [menu_items] ([mid],[cssClass],[position],[path],[aria],[tooltip],[guestOnly],[order]) VALUES (1,'menu_login','left','/accounts/login/','{lang.menu_login_aria}','{lang.menu_login_tooltip}',1,8); diff --git a/schema/mysql/inserts.sql b/schema/mysql/inserts.sql index 991bbb8b..d4632c22 100644 --- a/schema/mysql/inserts.sql +++ b/schema/mysql/inserts.sql @@ -10,10 +10,10 @@ INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`is_admi INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`tag`) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":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,"MoveTopic":true}','{}',1,'Mod'); INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`) VALUES ('Member','{"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"CreateReply":true}','{}'); INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_banned`) VALUES ('Banned','{"ViewTopic":true}','{}',1); -INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`) VALUES ('AwaitingActivation','{"ViewTopic":true}','{}'); -INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`tag`) VALUES ('NotLoggedin','{"ViewTopic":true}','{}','Guest'); -INSERT INTO `forums`(`name`,`active`,`desc`) VALUES ('Reports',0,'Allthereportsgohere'); -INSERT INTO `forums`(`name`,`lastTopicID`,`lastReplyerID`,`desc`) VALUES ('General',1,1,'Aplaceforgeneraldiscussionswhichdon''tfitelsewhere'); +INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`) VALUES ('Awaiting Activation','{"ViewTopic":true}','{}'); +INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`tag`) VALUES ('Not Loggedin','{"ViewTopic":true}','{}','Guest'); +INSERT INTO `forums`(`name`,`active`,`desc`) VALUES ('Reports',0,'All the reports go here'); +INSERT INTO `forums`(`name`,`lastTopicID`,`lastReplyerID`,`desc`) VALUES ('General',1,1,'A place for general discussions which don''t fit elsewhere'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (1,1,'{"ViewTopic":true,"CreateReply":true,"CreateTopic":true,"PinTopic":true,"CloseTopic":true}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (2,1,'{"ViewTopic":true,"CreateReply":true,"CloseTopic":true}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (3,1,'{}'); @@ -26,9 +26,15 @@ INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (3,2,'{"ViewT INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (4,2,'{"ViewTopic":true}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (5,2,'{"ViewTopic":true}'); INSERT INTO `forums_permissions`(`gid`,`fid`,`permissions`) VALUES (6,2,'{"ViewTopic":true}'); -INSERT INTO `topics`(`title`,`content`,`parsed_content`,`createdAt`,`lastReplyAt`,`lastReplyBy`,`createdBy`,`parentID`,`ipaddress`) VALUES ('TestTopic','Atopicautomaticallygeneratedbythesoftware.','Atopicautomaticallygeneratedbythesoftware.',UTC_TIMESTAMP(),UTC_TIMESTAMP(),1,1,2,'::1'); -INSERT INTO `replies`(`tid`,`content`,`parsed_content`,`createdAt`,`createdBy`,`lastUpdated`,`lastEdit`,`lastEditBy`,`ipaddress`) VALUES (1,'Areply!','Areply!',UTC_TIMESTAMP(),1,UTC_TIMESTAMP(),0,0,'::1'); +INSERT INTO `topics`(`title`,`content`,`parsed_content`,`createdAt`,`lastReplyAt`,`lastReplyBy`,`createdBy`,`parentID`,`ipaddress`) VALUES ('Test Topic','A topic automatically generated by the software.','A topic automatically generated by the software.',UTC_TIMESTAMP(),UTC_TIMESTAMP(),1,1,2,'::1'); +INSERT INTO `replies`(`tid`,`content`,`parsed_content`,`createdAt`,`createdBy`,`lastUpdated`,`lastEdit`,`lastEditBy`,`ipaddress`) VALUES (1,'A reply!','A reply!',UTC_TIMESTAMP(),1,UTC_TIMESTAMP(),0,0,'::1'); INSERT INTO `menus`; INSERT INTO `menu_items`(`mid`,`htmlID`,`position`,`path`,`aria`,`tooltip`,`order`) VALUES (1,'menu_forums','left','/forums/','{lang.menu_forums_aria}','{lang.menu_forums_tooltip}',0); INSERT INTO `menu_items`(`mid`,`htmlID`,`cssClass`,`position`,`path`,`aria`,`tooltip`,`order`) VALUES (1,'menu_topics','menu_topics','left','/topics/','{lang.menu_topics_aria}','{lang.menu_topics_tooltip}',1); INSERT INTO `menu_items`(`mid`,`htmlID`,`cssClass`,`position`,`tmplName`,`order`) VALUES (1,'general_alerts','menu_alerts','right','menu_alerts',2); +INSERT INTO `menu_items`(`mid`,`cssClass`,`position`,`path`,`aria`,`tooltip`,`memberOnly`,`order`) VALUES (1,'menu_account','left','/user/edit/critical/','{lang.menu_account_aria}','{lang.menu_account_tooltip}',1,3); +INSERT INTO `menu_items`(`mid`,`cssClass`,`position`,`path`,`aria`,`tooltip`,`memberOnly`,`order`) VALUES (1,'menu_profile','left','{me.Link}','{lang.menu_profile_aria}','{lang.menu_profile_tooltip}',1,4); +INSERT INTO `menu_items`(`mid`,`cssClass`,`position`,`path`,`aria`,`tooltip`,`memberOnly`,`staffOnly`,`order`) VALUES (1,'menu_panel menu_account','left','/panel/','{lang.menu_panel_aria}','{lang.menu_panel_tooltip}',1,1,5); +INSERT INTO `menu_items`(`mid`,`cssClass`,`position`,`path`,`aria`,`tooltip`,`memberOnly`,`order`) VALUES (1,'menu_logout','left','/accounts/logout/?session={me.Session}','{lang.menu_logout_aria}','{lang.menu_logout_tooltip}',1,6); +INSERT INTO `menu_items`(`mid`,`cssClass`,`position`,`path`,`aria`,`tooltip`,`guestOnly`,`order`) VALUES (1,'menu_register','left','/accounts/create/','{lang.menu_register_aria}','{lang.menu_register_tooltip}',1,7); +INSERT INTO `menu_items`(`mid`,`cssClass`,`position`,`path`,`aria`,`tooltip`,`guestOnly`,`order`) VALUES (1,'menu_login','left','/accounts/login/','{lang.menu_login_aria}','{lang.menu_login_tooltip}',1,8); diff --git a/schema/pgsql/inserts.sql b/schema/pgsql/inserts.sql index 6c0f09b2..b5613872 100644 --- a/schema/pgsql/inserts.sql +++ b/schema/pgsql/inserts.sql @@ -32,3 +32,9 @@ ; ; ; +; +; +; +; +; +; diff --git a/schema/schema.json b/schema/schema.json index dac8f864..6ba0573e 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,6 +1,6 @@ { - "DBVersion":"0", + "DBVersion":"1", "DynamicFileVersion":"0", - "MinGoVersion":"1.9", + "MinGoVersion":"1.10", "MinVersion":"" } \ No newline at end of file diff --git a/template_error.go b/template_error.go index e67badf0..71d52a62 100644 --- a/template_error.go +++ b/template_error.go @@ -15,18 +15,6 @@ func init() { common.TmplPtrMap["error"] = &common.Template_error_handle common.TmplPtrMap["o_error"] = Template_error error_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "error_head", "footer_powered_by", @@ -75,76 +63,41 @@ if !tmpl_error_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_error_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_error_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_error_vars.Header))) -if tmpl_error_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_error_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_error_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_error_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_error_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_error_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_error_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_error_vars.Header))) +w.Write(header_frags[21]) +if tmpl_error_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_error_vars.Header.NoticeList) != 0 { for _, item := range tmpl_error_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(error_frags[0]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(error_frags[1]) w.Write([]byte(tmpl_error_vars.Something.(string))) w.Write(error_frags[2]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_error_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(footer_frags[2]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(footer_frags[3]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(footer_frags[4]) if len(tmpl_error_vars.Header.Themes) != 0 { for _, item := range tmpl_error_vars.Header.Themes { diff --git a/template_forum.go b/template_forum.go index a2d37710..0b2f16a5 100644 --- a/template_forum.go +++ b/template_forum.go @@ -3,8 +3,8 @@ // 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. */ package main -import "io" import "./common" +import "io" import "strconv" var forum_tmpl_phrase_id int @@ -16,18 +16,6 @@ func init() { common.TmplPtrMap["forum"] = &common.Template_forum_handle common.TmplPtrMap["o_forum"] = Template_forum forum_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "paginator_prev_page_aria", "paginator_less_than", @@ -108,83 +96,48 @@ if !tmpl_forum_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_forum_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_forum_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_forum_vars.Header))) -if tmpl_forum_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_forum_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_forum_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_forum_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_forum_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_forum_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_forum_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_forum_vars.Header))) +w.Write(header_frags[21]) +if tmpl_forum_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_forum_vars.Header.NoticeList) != 0 { for _, item := range tmpl_forum_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) if tmpl_forum_vars.Page > 1 { w.Write(forum_frags[0]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(forum_frags[1]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) w.Write(forum_frags[2]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page - 1))) w.Write(forum_frags[3]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(forum_frags[4]) } if tmpl_forum_vars.LastPage != tmpl_forum_vars.Page { w.Write(forum_frags[5]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(forum_frags[6]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) w.Write(forum_frags[7]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page + 1))) w.Write(forum_frags[8]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(forum_frags[9]) } w.Write(forum_frags[10]) @@ -198,22 +151,22 @@ if tmpl_forum_vars.CurrentUser.ID != 0 { w.Write(forum_frags[14]) if tmpl_forum_vars.CurrentUser.Perms.CreateTopic { w.Write(forum_frags[15]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(forum_frags[16]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(forum_frags[17]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) w.Write(forum_frags[18]) w.Write(forum_frags[19]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(forum_frags[20]) -w.Write(phrases[20]) +w.Write(phrases[8]) w.Write(forum_frags[21]) } else { w.Write(forum_frags[22]) -w.Write(phrases[21]) +w.Write(phrases[9]) w.Write(forum_frags[23]) -w.Write(phrases[22]) +w.Write(phrases[10]) w.Write(forum_frags[24]) } w.Write(forum_frags[25]) @@ -221,48 +174,48 @@ w.Write(forum_frags[25]) w.Write(forum_frags[26]) if tmpl_forum_vars.CurrentUser.ID != 0 { w.Write(forum_frags[27]) -w.Write(phrases[23]) +w.Write(phrases[11]) w.Write(forum_frags[28]) -w.Write(phrases[24]) +w.Write(phrases[12]) w.Write(forum_frags[29]) -w.Write(phrases[25]) +w.Write(phrases[13]) w.Write(forum_frags[30]) -w.Write(phrases[26]) +w.Write(phrases[14]) w.Write(forum_frags[31]) -w.Write(phrases[27]) +w.Write(phrases[15]) w.Write(forum_frags[32]) if tmpl_forum_vars.CurrentUser.Perms.CreateTopic { w.Write(forum_frags[33]) -w.Write(phrases[28]) +w.Write(phrases[16]) w.Write(forum_frags[34]) w.Write([]byte(tmpl_forum_vars.CurrentUser.Avatar)) w.Write(forum_frags[35]) -w.Write(phrases[29]) +w.Write(phrases[17]) w.Write(forum_frags[36]) -w.Write(phrases[30]) +w.Write(phrases[18]) w.Write(forum_frags[37]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) w.Write(forum_frags[38]) -w.Write(phrases[31]) +w.Write(phrases[19]) w.Write(forum_frags[39]) -w.Write(phrases[32]) +w.Write(phrases[20]) w.Write(forum_frags[40]) -w.Write(phrases[33]) +w.Write(phrases[21]) w.Write(forum_frags[41]) -w.Write(phrases[34]) +w.Write(phrases[22]) w.Write(forum_frags[42]) if tmpl_forum_vars.CurrentUser.Perms.UploadFiles { w.Write(forum_frags[43]) -w.Write(phrases[35]) +w.Write(phrases[23]) w.Write(forum_frags[44]) } w.Write(forum_frags[45]) -w.Write(phrases[36]) +w.Write(phrases[24]) w.Write(forum_frags[46]) } } w.Write(forum_frags[47]) -w.Write(phrases[37]) +w.Write(phrases[25]) w.Write(forum_frags[48]) if len(tmpl_forum_vars.ItemList) != 0 { for _, item := range tmpl_forum_vars.ItemList { @@ -299,12 +252,12 @@ w.Write([]byte(item.Creator.Name)) w.Write(forum_frags[63]) if item.IsClosed { w.Write(forum_frags[64]) -w.Write(phrases[38]) +w.Write(phrases[26]) w.Write(forum_frags[65]) } if item.Sticky { w.Write(forum_frags[66]) -w.Write(phrases[39]) +w.Write(phrases[27]) w.Write(forum_frags[67]) } w.Write(forum_frags[68]) @@ -339,12 +292,12 @@ w.Write(forum_frags[81]) } } else { w.Write(forum_frags[82]) -w.Write(phrases[40]) +w.Write(phrases[28]) if tmpl_forum_vars.CurrentUser.Perms.CreateTopic { w.Write(forum_frags[83]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) w.Write(forum_frags[84]) -w.Write(phrases[41]) +w.Write(phrases[29]) w.Write(forum_frags[85]) } w.Write(forum_frags[86]) @@ -356,9 +309,9 @@ if tmpl_forum_vars.Page > 1 { w.Write(paginator_frags[1]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page - 1))) w.Write(paginator_frags[2]) -w.Write(phrases[42]) +w.Write(phrases[30]) w.Write(paginator_frags[3]) -w.Write(phrases[43]) +w.Write(phrases[31]) w.Write(paginator_frags[4]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page - 1))) w.Write(paginator_frags[5]) @@ -378,9 +331,9 @@ w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page + 1))) w.Write(paginator_frags[10]) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page + 1))) w.Write(paginator_frags[11]) -w.Write(phrases[44]) +w.Write(phrases[32]) w.Write(paginator_frags[12]) -w.Write(phrases[45]) +w.Write(phrases[33]) w.Write(paginator_frags[13]) } w.Write(paginator_frags[14]) @@ -389,11 +342,11 @@ w.Write(forum_frags[88]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_forum_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[46]) +w.Write(phrases[34]) w.Write(footer_frags[2]) -w.Write(phrases[47]) +w.Write(phrases[35]) w.Write(footer_frags[3]) -w.Write(phrases[48]) +w.Write(phrases[36]) w.Write(footer_frags[4]) if len(tmpl_forum_vars.Header.Themes) != 0 { for _, item := range tmpl_forum_vars.Header.Themes { diff --git a/template_forums.go b/template_forums.go index 0f77bf9e..d64e56d6 100644 --- a/template_forums.go +++ b/template_forums.go @@ -3,8 +3,8 @@ // 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. */ package main -import "io" import "./common" +import "io" var forums_tmpl_phrase_id int @@ -15,18 +15,6 @@ func init() { common.TmplPtrMap["forums"] = &common.Template_forums_handle common.TmplPtrMap["o_forums"] = Template_forums forums_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "forums_head", "forums_no_description", @@ -78,65 +66,30 @@ if !tmpl_forums_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_forums_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_forums_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_forums_vars.Header))) -if tmpl_forums_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_forums_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_forums_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_forums_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_forums_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_forums_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_forums_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_forums_vars.Header))) +w.Write(header_frags[21]) +if tmpl_forums_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_forums_vars.Header.NoticeList) != 0 { for _, item := range tmpl_forums_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(forums_frags[0]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(forums_frags[1]) if len(tmpl_forums_vars.ItemList) != 0 { for _, item := range tmpl_forums_vars.ItemList { @@ -155,7 +108,7 @@ w.Write([]byte(item.Desc)) w.Write(forums_frags[8]) } else { w.Write(forums_frags[9]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(forums_frags[10]) } w.Write(forums_frags[11]) @@ -174,7 +127,7 @@ w.Write(forums_frags[17]) if item.LastTopic.Title != "" { w.Write([]byte(item.LastTopic.Title)) } else { -w.Write(phrases[15]) +w.Write(phrases[3]) } w.Write(forums_frags[18]) if item.LastTopicTime != "" { @@ -186,18 +139,18 @@ w.Write(forums_frags[21]) } } else { w.Write(forums_frags[22]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(forums_frags[23]) } w.Write(forums_frags[24]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_forums_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(footer_frags[2]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(footer_frags[3]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(footer_frags[4]) if len(tmpl_forums_vars.Header.Themes) != 0 { for _, item := range tmpl_forums_vars.Header.Themes { diff --git a/template_guilds_guild_list.go b/template_guilds_guild_list.go index 6160b438..6d379897 100644 --- a/template_guilds_guild_list.go +++ b/template_guilds_guild_list.go @@ -14,18 +14,6 @@ var guilds_guild_list_tmpl_phrase_id int func init() { common.TmplPtrMap["o_guilds_guild_list"] = Template_guilds_guild_list guilds_guild_list_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "footer_powered_by", "footer_made_with_love", @@ -73,63 +61,28 @@ if !tmpl_guilds_guild_list_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_guilds_guild_list_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_guilds_guild_list_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_guilds_guild_list_vars.Header))) -if tmpl_guilds_guild_list_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_guilds_guild_list_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_guilds_guild_list_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_guilds_guild_list_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_guilds_guild_list_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_guilds_guild_list_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_guilds_guild_list_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_guilds_guild_list_vars.Header))) +w.Write(header_frags[21]) +if tmpl_guilds_guild_list_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_guilds_guild_list_vars.Header.NoticeList) != 0 { for _, item := range tmpl_guilds_guild_list_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(guilds_guild_list_frags[0]) if len(tmpl_guilds_guild_list_vars.GuildList) != 0 { for _, item := range tmpl_guilds_guild_list_vars.GuildList { @@ -152,11 +105,11 @@ w.Write(guilds_guild_list_frags[8]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_guilds_guild_list_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(footer_frags[2]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(footer_frags[3]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(footer_frags[4]) if len(tmpl_guilds_guild_list_vars.Header.Themes) != 0 { for _, item := range tmpl_guilds_guild_list_vars.Header.Themes { diff --git a/template_ip_search.go b/template_ip_search.go index 0b4a8214..e1f0e210 100644 --- a/template_ip_search.go +++ b/template_ip_search.go @@ -3,8 +3,8 @@ // 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. */ package main -import "io" import "./common" +import "io" var ip_search_tmpl_phrase_id int @@ -15,18 +15,6 @@ func init() { common.TmplPtrMap["ip_search"] = &common.Template_ip_search_handle common.TmplPtrMap["o_ip_search"] = Template_ip_search ip_search_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "ip_search_head", "ip_search_search_button", @@ -77,65 +65,30 @@ if !tmpl_ip_search_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_ip_search_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_ip_search_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_ip_search_vars.Header))) -if tmpl_ip_search_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_ip_search_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_ip_search_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_ip_search_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_ip_search_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_ip_search_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_ip_search_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_ip_search_vars.Header))) +w.Write(header_frags[21]) +if tmpl_ip_search_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_ip_search_vars.Header.NoticeList) != 0 { for _, item := range tmpl_ip_search_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(ip_search_frags[0]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(ip_search_frags[1]) if tmpl_ip_search_vars.IP != "" { w.Write(ip_search_frags[2]) @@ -143,7 +96,7 @@ w.Write([]byte(tmpl_ip_search_vars.IP)) w.Write(ip_search_frags[3]) } w.Write(ip_search_frags[4]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(ip_search_frags[5]) if tmpl_ip_search_vars.IP != "" { w.Write(ip_search_frags[6]) @@ -163,7 +116,7 @@ w.Write(ip_search_frags[12]) } } else { w.Write(ip_search_frags[13]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(ip_search_frags[14]) } @@ -173,11 +126,11 @@ w.Write(ip_search_frags[16]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_ip_search_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(footer_frags[2]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(footer_frags[3]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(footer_frags[4]) if len(tmpl_ip_search_vars.Header.Themes) != 0 { for _, item := range tmpl_ip_search_vars.Header.Themes { diff --git a/template_list.go b/template_list.go index 493c8826..62fd58ed 100644 --- a/template_list.go +++ b/template_list.go @@ -1,21 +1,20 @@ package main -var paginator_frags = make([][]byte,16) -var register_frags = make([][]byte,9) -var topic_alt_frags = make([][]byte,200) -var profile_comments_row_frags = make([][]byte,51) -var topics_frags = make([][]byte,98) -var error_frags = make([][]byte,4) var guilds_guild_list_frags = make([][]byte,10) -var topic_frags = make([][]byte,199) var forums_frags = make([][]byte,26) +var topics_frags = make([][]byte,98) +var register_frags = make([][]byte,9) +var header_frags = make([][]byte,28) +var topic_frags = make([][]byte,199) +var topic_alt_frags = make([][]byte,200) +var login_frags = make([][]byte,8) +var error_frags = make([][]byte,4) +var footer_frags = make([][]byte,13) +var profile_comments_row_frags = make([][]byte,51) +var paginator_frags = make([][]byte,16) var profile_frags = make([][]byte,50) var forum_frags = make([][]byte,90) -var login_frags = make([][]byte,8) var ip_search_frags = make([][]byte,18) -var menu_frags = make([][]byte,23) -var footer_frags = make([][]byte,13) -var header_frags = make([][]byte,24) // nolint func init() { @@ -55,64 +54,38 @@ header_frags[13] = []byte(`" />`) header_frags[14] = []byte(` - + `) +header_frags[15] = []byte(``) +header_frags[16] = []byte(`
-`) -menu_frags[0] = []byte(`
`) -menu_frags[1] = []byte(`
- -
`) -menu_frags[21] = []byte(`
`) -header_frags[17] = []byte(` -
-
`) -header_frags[20] = []byte(` -
`) -header_frags[21] = []byte(`
`) -header_frags[22] = []byte(` -
+
`) +header_frags[17] = []byte(`
+ +
`) +header_frags[21] = []byte(`
+
+
`) +header_frags[24] = []byte(` +
`) +header_frags[25] = []byte(`
`) +header_frags[26] = []byte(` +
`) topic_frags[0] = []byte(` diff --git a/template_login.go b/template_login.go index 1e58f0e8..c3146dd2 100644 --- a/template_login.go +++ b/template_login.go @@ -15,18 +15,6 @@ func init() { common.TmplPtrMap["login"] = &common.Template_login_handle common.TmplPtrMap["o_login"] = Template_login login_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "login_head", "login_account_name", @@ -80,84 +68,49 @@ if !tmpl_login_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_login_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_login_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_login_vars.Header))) -if tmpl_login_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_login_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_login_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_login_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_login_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_login_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_login_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_login_vars.Header))) +w.Write(header_frags[21]) +if tmpl_login_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_login_vars.Header.NoticeList) != 0 { for _, item := range tmpl_login_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(login_frags[0]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(login_frags[1]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(login_frags[2]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(login_frags[3]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(login_frags[4]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(login_frags[5]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(login_frags[6]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_login_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(footer_frags[2]) -w.Write(phrases[20]) +w.Write(phrases[8]) w.Write(footer_frags[3]) -w.Write(phrases[21]) +w.Write(phrases[9]) w.Write(footer_frags[4]) if len(tmpl_login_vars.Header.Themes) != 0 { for _, item := range tmpl_login_vars.Header.Themes { diff --git a/template_profile.go b/template_profile.go index a2ef0727..d02c3eca 100644 --- a/template_profile.go +++ b/template_profile.go @@ -16,18 +16,6 @@ func init() { common.TmplPtrMap["profile"] = &common.Template_profile_handle common.TmplPtrMap["o_profile"] = Template_profile profile_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "profile_login_for_options", "profile_add_friend", @@ -103,63 +91,28 @@ if !tmpl_profile_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_profile_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_profile_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_profile_vars.Header))) -if tmpl_profile_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_profile_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_profile_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_profile_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_profile_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_profile_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_profile_vars.Header))) +w.Write(header_frags[21]) +if tmpl_profile_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_profile_vars.Header.NoticeList) != 0 { for _, item := range tmpl_profile_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(profile_frags[0]) w.Write([]byte(tmpl_profile_vars.ProfileOwner.Avatar)) w.Write(profile_frags[1]) @@ -181,11 +134,11 @@ w.Write(profile_frags[8]) w.Write(profile_frags[9]) if !tmpl_profile_vars.CurrentUser.Loggedin { w.Write(profile_frags[10]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(profile_frags[11]) } else { w.Write(profile_frags[12]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(profile_frags[13]) if tmpl_profile_vars.CurrentUser.IsSuperMod && !tmpl_profile_vars.ProfileOwner.IsSuperMod { w.Write(profile_frags[14]) @@ -195,11 +148,11 @@ w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID))) w.Write(profile_frags[16]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_frags[17]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(profile_frags[18]) } else { w.Write(profile_frags[19]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(profile_frags[20]) } w.Write(profile_frags[21]) @@ -209,36 +162,36 @@ w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID))) w.Write(profile_frags[23]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_frags[24]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(profile_frags[25]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(profile_frags[26]) } w.Write(profile_frags[27]) if tmpl_profile_vars.CurrentUser.Perms.BanUsers { w.Write(profile_frags[28]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(profile_frags[29]) w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID))) w.Write(profile_frags[30]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_frags[31]) w.Write(profile_frags[32]) -w.Write(phrases[20]) +w.Write(phrases[8]) w.Write(profile_frags[33]) -w.Write(phrases[21]) +w.Write(phrases[9]) w.Write(profile_frags[34]) -w.Write(phrases[22]) +w.Write(phrases[10]) w.Write(profile_frags[35]) -w.Write(phrases[23]) +w.Write(phrases[11]) w.Write(profile_frags[36]) -w.Write(phrases[24]) +w.Write(phrases[12]) w.Write(profile_frags[37]) -w.Write(phrases[25]) +w.Write(phrases[13]) w.Write(profile_frags[38]) } w.Write(profile_frags[39]) -w.Write(phrases[26]) +w.Write(phrases[14]) w.Write(profile_frags[40]) if tmpl_profile_vars.Header.Theme.BgAvatars { if len(tmpl_profile_vars.ItemList) != 0 { @@ -264,17 +217,17 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(profile_comments_row_frags[9]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_comments_row_frags[10]) -w.Write(phrases[27]) +w.Write(phrases[15]) w.Write(profile_comments_row_frags[11]) -w.Write(phrases[28]) +w.Write(phrases[16]) w.Write(profile_comments_row_frags[12]) w.Write([]byte(strconv.Itoa(item.ID))) w.Write(profile_comments_row_frags[13]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_comments_row_frags[14]) -w.Write(phrases[29]) +w.Write(phrases[17]) w.Write(profile_comments_row_frags[15]) -w.Write(phrases[30]) +w.Write(phrases[18]) w.Write(profile_comments_row_frags[16]) } w.Write(profile_comments_row_frags[17]) @@ -282,9 +235,9 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(profile_comments_row_frags[18]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_comments_row_frags[19]) -w.Write(phrases[31]) +w.Write(phrases[19]) w.Write(profile_comments_row_frags[20]) -w.Write(phrases[32]) +w.Write(phrases[20]) w.Write(profile_comments_row_frags[21]) if item.Tag != "" { w.Write(profile_comments_row_frags[22]) @@ -322,17 +275,17 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(profile_comments_row_frags[36]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_comments_row_frags[37]) -w.Write(phrases[33]) +w.Write(phrases[21]) w.Write(profile_comments_row_frags[38]) -w.Write(phrases[34]) +w.Write(phrases[22]) w.Write(profile_comments_row_frags[39]) w.Write([]byte(strconv.Itoa(item.ID))) w.Write(profile_comments_row_frags[40]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_comments_row_frags[41]) -w.Write(phrases[35]) +w.Write(phrases[23]) w.Write(profile_comments_row_frags[42]) -w.Write(phrases[36]) +w.Write(phrases[24]) w.Write(profile_comments_row_frags[43]) } w.Write(profile_comments_row_frags[44]) @@ -340,9 +293,9 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(profile_comments_row_frags[45]) w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_comments_row_frags[46]) -w.Write(phrases[37]) +w.Write(phrases[25]) w.Write(profile_comments_row_frags[47]) -w.Write(phrases[38]) +w.Write(phrases[26]) w.Write(profile_comments_row_frags[48]) w.Write([]byte(item.ContentHtml)) w.Write(profile_comments_row_frags[49]) @@ -356,9 +309,9 @@ w.Write([]byte(tmpl_profile_vars.CurrentUser.Session)) w.Write(profile_frags[43]) w.Write([]byte(strconv.Itoa(tmpl_profile_vars.ProfileOwner.ID))) w.Write(profile_frags[44]) -w.Write(phrases[39]) +w.Write(phrases[27]) w.Write(profile_frags[45]) -w.Write(phrases[40]) +w.Write(phrases[28]) w.Write(profile_frags[46]) } w.Write(profile_frags[47]) @@ -366,11 +319,11 @@ w.Write(profile_frags[48]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_profile_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[41]) +w.Write(phrases[29]) w.Write(footer_frags[2]) -w.Write(phrases[42]) +w.Write(phrases[30]) w.Write(footer_frags[3]) -w.Write(phrases[43]) +w.Write(phrases[31]) w.Write(footer_frags[4]) if len(tmpl_profile_vars.Header.Themes) != 0 { for _, item := range tmpl_profile_vars.Header.Themes { diff --git a/template_register.go b/template_register.go index e7222d0a..1f146088 100644 --- a/template_register.go +++ b/template_register.go @@ -15,18 +15,6 @@ func init() { common.TmplPtrMap["register"] = &common.Template_register_handle common.TmplPtrMap["o_register"] = Template_register register_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "register_head", "register_account_name", @@ -81,86 +69,51 @@ if !tmpl_register_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_register_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_register_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_register_vars.Header))) -if tmpl_register_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_register_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_register_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_register_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_register_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_register_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_register_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_register_vars.Header))) +w.Write(header_frags[21]) +if tmpl_register_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_register_vars.Header.NoticeList) != 0 { for _, item := range tmpl_register_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(register_frags[0]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(register_frags[1]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(register_frags[2]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(register_frags[3]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(register_frags[4]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(register_frags[5]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(register_frags[6]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(register_frags[7]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_register_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[20]) +w.Write(phrases[8]) w.Write(footer_frags[2]) -w.Write(phrases[21]) +w.Write(phrases[9]) w.Write(footer_frags[3]) -w.Write(phrases[22]) +w.Write(phrases[10]) w.Write(footer_frags[4]) if len(tmpl_register_vars.Header.Themes) != 0 { for _, item := range tmpl_register_vars.Header.Themes { diff --git a/template_topic.go b/template_topic.go index 812b99b1..e50551b5 100644 --- a/template_topic.go +++ b/template_topic.go @@ -16,18 +16,6 @@ func init() { common.TmplPtrMap["topic"] = &common.Template_topic_handle common.TmplPtrMap["o_topic"] = Template_topic topic_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "paginator_prev_page_aria", "paginator_less_than", @@ -134,63 +122,28 @@ if !tmpl_topic_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_topic_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_topic_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_topic_vars.Header))) -if tmpl_topic_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_topic_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_topic_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_topic_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_topic_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_topic_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_topic_vars.Header))) +w.Write(header_frags[21]) +if tmpl_topic_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_topic_vars.Header.NoticeList) != 0 { for _, item := range tmpl_topic_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(topic_frags[0]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[1]) @@ -202,13 +155,13 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[4]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page - 1))) w.Write(topic_frags[5]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(topic_frags[6]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[7]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page - 1))) w.Write(topic_frags[8]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(topic_frags[9]) } if tmpl_topic_vars.LastPage != tmpl_topic_vars.Page { @@ -217,18 +170,18 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[11]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page + 1))) w.Write(topic_frags[12]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(topic_frags[13]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[14]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Page + 1))) w.Write(topic_frags[15]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(topic_frags[16]) } w.Write(topic_frags[17]) w.Write(topic_frags[18]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(topic_frags[19]) if tmpl_topic_vars.Topic.Sticky { w.Write(topic_frags[20]) @@ -244,24 +197,24 @@ w.Write([]byte(tmpl_topic_vars.Topic.Title)) w.Write(topic_frags[24]) if tmpl_topic_vars.Topic.IsClosed { w.Write(topic_frags[25]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(topic_frags[26]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(topic_frags[27]) } if tmpl_topic_vars.CurrentUser.Perms.EditTopic { w.Write(topic_frags[28]) w.Write([]byte(tmpl_topic_vars.Topic.Title)) w.Write(topic_frags[29]) -w.Write(phrases[20]) +w.Write(phrases[8]) w.Write(topic_frags[30]) -w.Write(phrases[21]) +w.Write(phrases[9]) w.Write(topic_frags[31]) } w.Write(topic_frags[32]) if tmpl_topic_vars.Poll.ID > 0 { w.Write(topic_frags[33]) -w.Write(phrases[22]) +w.Write(phrases[10]) w.Write(topic_frags[34]) w.Write([]byte(tmpl_topic_vars.Topic.ClassName)) w.Write(topic_frags[35]) @@ -293,20 +246,20 @@ w.Write(topic_frags[46]) w.Write(topic_frags[47]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Poll.ID))) w.Write(topic_frags[48]) -w.Write(phrases[23]) +w.Write(phrases[11]) w.Write(topic_frags[49]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Poll.ID))) w.Write(topic_frags[50]) -w.Write(phrases[24]) +w.Write(phrases[12]) w.Write(topic_frags[51]) -w.Write(phrases[25]) +w.Write(phrases[13]) w.Write(topic_frags[52]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Poll.ID))) w.Write(topic_frags[53]) } w.Write(topic_frags[54]) w.Write(topic_frags[55]) -w.Write(phrases[26]) +w.Write(phrases[14]) w.Write(topic_frags[56]) w.Write([]byte(tmpl_topic_vars.Topic.ClassName)) w.Write(topic_frags[57]) @@ -326,7 +279,7 @@ if tmpl_topic_vars.Topic.LikeCount > 0 { w.Write(topic_frags[64]) } w.Write(topic_frags[65]) -w.Write(phrases[27]) +w.Write(phrases[15]) w.Write(topic_frags[66]) w.Write([]byte(tmpl_topic_vars.Topic.UserLink)) w.Write(topic_frags[67]) @@ -340,15 +293,15 @@ w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[71]) if tmpl_topic_vars.Topic.Liked { w.Write(topic_frags[72]) -w.Write(phrases[28]) +w.Write(phrases[16]) w.Write(topic_frags[73]) -w.Write(phrases[29]) +w.Write(phrases[17]) w.Write(topic_frags[74]) } else { w.Write(topic_frags[75]) -w.Write(phrases[30]) +w.Write(phrases[18]) w.Write(topic_frags[76]) -w.Write(phrases[31]) +w.Write(phrases[19]) w.Write(topic_frags[77]) } w.Write(topic_frags[78]) @@ -363,9 +316,9 @@ if tmpl_topic_vars.CurrentUser.Perms.EditTopic { w.Write(topic_frags[82]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[83]) -w.Write(phrases[32]) +w.Write(phrases[20]) w.Write(topic_frags[84]) -w.Write(phrases[33]) +w.Write(phrases[21]) w.Write(topic_frags[85]) } if tmpl_topic_vars.CurrentUser.Perms.DeleteTopic { @@ -374,9 +327,9 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[87]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[88]) -w.Write(phrases[34]) +w.Write(phrases[22]) w.Write(topic_frags[89]) -w.Write(phrases[35]) +w.Write(phrases[23]) w.Write(topic_frags[90]) } if tmpl_topic_vars.CurrentUser.Perms.CloseTopic { @@ -386,9 +339,9 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[92]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[93]) -w.Write(phrases[36]) +w.Write(phrases[24]) w.Write(topic_frags[94]) -w.Write(phrases[37]) +w.Write(phrases[25]) w.Write(topic_frags[95]) } else { w.Write(topic_frags[96]) @@ -396,9 +349,9 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[97]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[98]) -w.Write(phrases[38]) +w.Write(phrases[26]) w.Write(topic_frags[99]) -w.Write(phrases[39]) +w.Write(phrases[27]) w.Write(topic_frags[100]) } } @@ -409,9 +362,9 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[102]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[103]) -w.Write(phrases[40]) +w.Write(phrases[28]) w.Write(topic_frags[104]) -w.Write(phrases[41]) +w.Write(phrases[29]) w.Write(topic_frags[105]) } else { w.Write(topic_frags[106]) @@ -419,9 +372,9 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[107]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[108]) -w.Write(phrases[42]) +w.Write(phrases[30]) w.Write(topic_frags[109]) -w.Write(phrases[43]) +w.Write(phrases[31]) w.Write(topic_frags[110]) } } @@ -429,7 +382,7 @@ if tmpl_topic_vars.CurrentUser.Perms.ViewIPs { w.Write(topic_frags[111]) w.Write([]byte(tmpl_topic_vars.Topic.IPAddress)) w.Write(topic_frags[112]) -w.Write(phrases[44]) +w.Write(phrases[32]) w.Write(topic_frags[113]) w.Write([]byte(tmpl_topic_vars.Topic.IPAddress)) w.Write(topic_frags[114]) @@ -439,15 +392,15 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[116]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[117]) -w.Write(phrases[45]) +w.Write(phrases[33]) w.Write(topic_frags[118]) -w.Write(phrases[46]) +w.Write(phrases[34]) w.Write(topic_frags[119]) -w.Write(phrases[47]) +w.Write(phrases[35]) w.Write(topic_frags[120]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.LikeCount))) w.Write(topic_frags[121]) -w.Write(phrases[48]) +w.Write(phrases[36]) w.Write(topic_frags[122]) if tmpl_topic_vars.Topic.Tag != "" { w.Write(topic_frags[123]) @@ -455,15 +408,15 @@ w.Write([]byte(tmpl_topic_vars.Topic.Tag)) w.Write(topic_frags[124]) } else { w.Write(topic_frags[125]) -w.Write(phrases[49]) +w.Write(phrases[37]) w.Write(topic_frags[126]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.Level))) w.Write(topic_frags[127]) -w.Write(phrases[50]) +w.Write(phrases[38]) w.Write(topic_frags[128]) } w.Write(topic_frags[129]) -w.Write(phrases[51]) +w.Write(phrases[39]) w.Write(topic_frags[130]) if len(tmpl_topic_vars.ItemList) != 0 { for _, item := range tmpl_topic_vars.ItemList { @@ -504,9 +457,9 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_frags[148]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[149]) -w.Write(phrases[52]) +w.Write(phrases[40]) w.Write(topic_frags[150]) -w.Write(phrases[53]) +w.Write(phrases[41]) w.Write(topic_frags[151]) } else { w.Write(topic_frags[152]) @@ -514,9 +467,9 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_frags[153]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[154]) -w.Write(phrases[54]) +w.Write(phrases[42]) w.Write(topic_frags[155]) -w.Write(phrases[55]) +w.Write(phrases[43]) w.Write(topic_frags[156]) } } @@ -526,9 +479,9 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_frags[158]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[159]) -w.Write(phrases[56]) +w.Write(phrases[44]) w.Write(topic_frags[160]) -w.Write(phrases[57]) +w.Write(phrases[45]) w.Write(topic_frags[161]) } if tmpl_topic_vars.CurrentUser.Perms.DeleteReply { @@ -537,16 +490,16 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_frags[163]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[164]) -w.Write(phrases[58]) +w.Write(phrases[46]) w.Write(topic_frags[165]) -w.Write(phrases[59]) +w.Write(phrases[47]) w.Write(topic_frags[166]) } if tmpl_topic_vars.CurrentUser.Perms.ViewIPs { w.Write(topic_frags[167]) w.Write([]byte(item.IPAddress)) w.Write(topic_frags[168]) -w.Write(phrases[60]) +w.Write(phrases[48]) w.Write(topic_frags[169]) w.Write([]byte(item.IPAddress)) w.Write(topic_frags[170]) @@ -556,13 +509,13 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_frags[172]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[173]) -w.Write(phrases[61]) +w.Write(phrases[49]) w.Write(topic_frags[174]) -w.Write(phrases[62]) +w.Write(phrases[50]) w.Write(topic_frags[175]) w.Write([]byte(strconv.Itoa(item.LikeCount))) w.Write(topic_frags[176]) -w.Write(phrases[63]) +w.Write(phrases[51]) w.Write(topic_frags[177]) if item.Tag != "" { w.Write(topic_frags[178]) @@ -570,11 +523,11 @@ w.Write([]byte(item.Tag)) w.Write(topic_frags[179]) } else { w.Write(topic_frags[180]) -w.Write(phrases[64]) +w.Write(phrases[52]) w.Write(topic_frags[181]) w.Write([]byte(strconv.Itoa(item.Level))) w.Write(topic_frags[182]) -w.Write(phrases[65]) +w.Write(phrases[53]) w.Write(topic_frags[183]) } w.Write(topic_frags[184]) @@ -584,23 +537,23 @@ w.Write(topic_frags[184]) w.Write(topic_frags[185]) if tmpl_topic_vars.CurrentUser.Perms.CreateReply { w.Write(topic_frags[186]) -w.Write(phrases[66]) +w.Write(phrases[54]) w.Write(topic_frags[187]) w.Write([]byte(tmpl_topic_vars.CurrentUser.Session)) w.Write(topic_frags[188]) w.Write([]byte(strconv.Itoa(tmpl_topic_vars.Topic.ID))) w.Write(topic_frags[189]) -w.Write(phrases[67]) +w.Write(phrases[55]) w.Write(topic_frags[190]) -w.Write(phrases[68]) +w.Write(phrases[56]) w.Write(topic_frags[191]) -w.Write(phrases[69]) +w.Write(phrases[57]) w.Write(topic_frags[192]) -w.Write(phrases[70]) +w.Write(phrases[58]) w.Write(topic_frags[193]) if tmpl_topic_vars.CurrentUser.Perms.UploadFiles { w.Write(topic_frags[194]) -w.Write(phrases[71]) +w.Write(phrases[59]) w.Write(topic_frags[195]) } w.Write(topic_frags[196]) @@ -609,11 +562,11 @@ w.Write(topic_frags[197]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_topic_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[72]) +w.Write(phrases[60]) w.Write(footer_frags[2]) -w.Write(phrases[73]) +w.Write(phrases[61]) w.Write(footer_frags[3]) -w.Write(phrases[74]) +w.Write(phrases[62]) w.Write(footer_frags[4]) if len(tmpl_topic_vars.Header.Themes) != 0 { for _, item := range tmpl_topic_vars.Header.Themes { diff --git a/template_topic_alt.go b/template_topic_alt.go index 95cf24fd..dd6f44ca 100644 --- a/template_topic_alt.go +++ b/template_topic_alt.go @@ -3,9 +3,9 @@ // 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. */ package main +import "strconv" import "io" import "./common" -import "strconv" var topic_alt_tmpl_phrase_id int @@ -16,18 +16,6 @@ func init() { common.TmplPtrMap["topic_alt"] = &common.Template_topic_alt_handle common.TmplPtrMap["o_topic_alt"] = Template_topic_alt topic_alt_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "paginator_prev_page_aria", "paginator_less_than", @@ -121,76 +109,41 @@ if !tmpl_topic_alt_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_topic_alt_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_topic_alt_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_topic_alt_vars.Header))) -if tmpl_topic_alt_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_topic_alt_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_topic_alt_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_topic_alt_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_topic_alt_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_topic_alt_vars.Header))) +w.Write(header_frags[21]) +if tmpl_topic_alt_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_topic_alt_vars.Header.NoticeList) != 0 { for _, item := range tmpl_topic_alt_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) if tmpl_topic_alt_vars.Page > 1 { w.Write(topic_alt_frags[0]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[1]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Page - 1))) w.Write(topic_alt_frags[2]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(topic_alt_frags[3]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[4]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Page - 1))) w.Write(topic_alt_frags[5]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(topic_alt_frags[6]) } if tmpl_topic_alt_vars.LastPage != tmpl_topic_alt_vars.Page { @@ -199,18 +152,18 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[8]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Page + 1))) w.Write(topic_alt_frags[9]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(topic_alt_frags[10]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[11]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Page + 1))) w.Write(topic_alt_frags[12]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(topic_alt_frags[13]) } w.Write(topic_alt_frags[14]) w.Write(topic_alt_frags[15]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(topic_alt_frags[16]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[17]) @@ -230,18 +183,18 @@ w.Write([]byte(tmpl_topic_alt_vars.Topic.Title)) w.Write(topic_alt_frags[23]) if tmpl_topic_alt_vars.Topic.IsClosed { w.Write(topic_alt_frags[24]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(topic_alt_frags[25]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(topic_alt_frags[26]) } if tmpl_topic_alt_vars.CurrentUser.Perms.EditTopic { w.Write(topic_alt_frags[27]) w.Write([]byte(tmpl_topic_alt_vars.Topic.Title)) w.Write(topic_alt_frags[28]) -w.Write(phrases[20]) +w.Write(phrases[8]) w.Write(topic_alt_frags[29]) -w.Write(phrases[21]) +w.Write(phrases[9]) w.Write(topic_alt_frags[30]) } w.Write(topic_alt_frags[31]) @@ -253,7 +206,7 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Poll.ID))) w.Write(topic_alt_frags[34]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[35]) -w.Write(phrases[22]) +w.Write(phrases[10]) w.Write(topic_alt_frags[36]) w.Write([]byte(tmpl_topic_alt_vars.Topic.Avatar)) w.Write(topic_alt_frags[37]) @@ -267,7 +220,7 @@ w.Write([]byte(tmpl_topic_alt_vars.Topic.Tag)) w.Write(topic_alt_frags[41]) } else { w.Write(topic_alt_frags[42]) -w.Write(phrases[23]) +w.Write(phrases[11]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.Level))) w.Write(topic_alt_frags[43]) } @@ -294,22 +247,22 @@ w.Write(topic_alt_frags[52]) w.Write(topic_alt_frags[53]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Poll.ID))) w.Write(topic_alt_frags[54]) -w.Write(phrases[24]) +w.Write(phrases[12]) w.Write(topic_alt_frags[55]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Poll.ID))) w.Write(topic_alt_frags[56]) -w.Write(phrases[25]) +w.Write(phrases[13]) w.Write(topic_alt_frags[57]) -w.Write(phrases[26]) +w.Write(phrases[14]) w.Write(topic_alt_frags[58]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Poll.ID))) w.Write(topic_alt_frags[59]) } w.Write(topic_alt_frags[60]) w.Write(topic_alt_frags[61]) -w.Write(phrases[27]) +w.Write(phrases[15]) w.Write(topic_alt_frags[62]) -w.Write(phrases[28]) +w.Write(phrases[16]) w.Write(topic_alt_frags[63]) w.Write([]byte(tmpl_topic_alt_vars.Topic.Avatar)) w.Write(topic_alt_frags[64]) @@ -323,7 +276,7 @@ w.Write([]byte(tmpl_topic_alt_vars.Topic.Tag)) w.Write(topic_alt_frags[68]) } else { w.Write(topic_alt_frags[69]) -w.Write(phrases[29]) +w.Write(phrases[17]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.Level))) w.Write(topic_alt_frags[70]) } @@ -349,14 +302,14 @@ w.Write(topic_alt_frags[79]) w.Write(topic_alt_frags[80]) } w.Write(topic_alt_frags[81]) -w.Write(phrases[30]) +w.Write(phrases[18]) w.Write(topic_alt_frags[82]) } if tmpl_topic_alt_vars.CurrentUser.Perms.EditTopic { w.Write(topic_alt_frags[83]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[84]) -w.Write(phrases[31]) +w.Write(phrases[19]) w.Write(topic_alt_frags[85]) } if tmpl_topic_alt_vars.CurrentUser.Perms.DeleteTopic { @@ -365,7 +318,7 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[87]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[88]) -w.Write(phrases[32]) +w.Write(phrases[20]) w.Write(topic_alt_frags[89]) } if tmpl_topic_alt_vars.CurrentUser.Perms.CloseTopic { @@ -375,7 +328,7 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[91]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[92]) -w.Write(phrases[33]) +w.Write(phrases[21]) w.Write(topic_alt_frags[93]) } else { w.Write(topic_alt_frags[94]) @@ -383,7 +336,7 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[95]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[96]) -w.Write(phrases[34]) +w.Write(phrases[22]) w.Write(topic_alt_frags[97]) } } @@ -394,7 +347,7 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[99]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[100]) -w.Write(phrases[35]) +w.Write(phrases[23]) w.Write(topic_alt_frags[101]) } else { w.Write(topic_alt_frags[102]) @@ -402,7 +355,7 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[103]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[104]) -w.Write(phrases[36]) +w.Write(phrases[24]) w.Write(topic_alt_frags[105]) } } @@ -410,9 +363,9 @@ if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs { w.Write(topic_alt_frags[106]) w.Write([]byte(tmpl_topic_alt_vars.Topic.IPAddress)) w.Write(topic_alt_frags[107]) -w.Write(phrases[37]) +w.Write(phrases[25]) w.Write(topic_alt_frags[108]) -w.Write(phrases[38]) +w.Write(phrases[26]) w.Write(topic_alt_frags[109]) } w.Write(topic_alt_frags[110]) @@ -420,11 +373,11 @@ w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[111]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[112]) -w.Write(phrases[39]) +w.Write(phrases[27]) w.Write(topic_alt_frags[113]) } w.Write(topic_alt_frags[114]) -w.Write(phrases[40]) +w.Write(phrases[28]) w.Write(topic_alt_frags[115]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.LikeCount))) w.Write(topic_alt_frags[116]) @@ -434,7 +387,7 @@ if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs { w.Write(topic_alt_frags[118]) w.Write([]byte(tmpl_topic_alt_vars.Topic.IPAddress)) w.Write(topic_alt_frags[119]) -w.Write(phrases[41]) +w.Write(phrases[29]) w.Write(topic_alt_frags[120]) w.Write([]byte(tmpl_topic_alt_vars.Topic.IPAddress)) w.Write(topic_alt_frags[121]) @@ -448,7 +401,7 @@ if item.ActionType != "" { w.Write(topic_alt_frags[125]) } w.Write(topic_alt_frags[126]) -w.Write(phrases[42]) +w.Write(phrases[30]) w.Write(topic_alt_frags[127]) w.Write([]byte(item.Avatar)) w.Write(topic_alt_frags[128]) @@ -462,7 +415,7 @@ w.Write([]byte(item.Tag)) w.Write(topic_alt_frags[132]) } else { w.Write(topic_alt_frags[133]) -w.Write(phrases[43]) +w.Write(phrases[31]) w.Write([]byte(strconv.Itoa(item.Level))) w.Write(topic_alt_frags[134]) } @@ -498,7 +451,7 @@ w.Write(topic_alt_frags[148]) w.Write(topic_alt_frags[149]) } w.Write(topic_alt_frags[150]) -w.Write(phrases[44]) +w.Write(phrases[32]) w.Write(topic_alt_frags[151]) } if tmpl_topic_alt_vars.CurrentUser.Perms.EditReply { @@ -507,7 +460,7 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_alt_frags[153]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[154]) -w.Write(phrases[45]) +w.Write(phrases[33]) w.Write(topic_alt_frags[155]) } if tmpl_topic_alt_vars.CurrentUser.Perms.DeleteReply { @@ -516,16 +469,16 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_alt_frags[157]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[158]) -w.Write(phrases[46]) +w.Write(phrases[34]) w.Write(topic_alt_frags[159]) } if tmpl_topic_alt_vars.CurrentUser.Perms.ViewIPs { w.Write(topic_alt_frags[160]) w.Write([]byte(item.IPAddress)) w.Write(topic_alt_frags[161]) -w.Write(phrases[47]) +w.Write(phrases[35]) w.Write(topic_alt_frags[162]) -w.Write(phrases[48]) +w.Write(phrases[36]) w.Write(topic_alt_frags[163]) } w.Write(topic_alt_frags[164]) @@ -533,11 +486,11 @@ w.Write([]byte(strconv.Itoa(item.ID))) w.Write(topic_alt_frags[165]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[166]) -w.Write(phrases[49]) +w.Write(phrases[37]) w.Write(topic_alt_frags[167]) } w.Write(topic_alt_frags[168]) -w.Write(phrases[50]) +w.Write(phrases[38]) w.Write(topic_alt_frags[169]) w.Write([]byte(strconv.Itoa(item.LikeCount))) w.Write(topic_alt_frags[170]) @@ -558,7 +511,7 @@ w.Write(topic_alt_frags[176]) w.Write(topic_alt_frags[177]) if tmpl_topic_alt_vars.CurrentUser.Perms.CreateReply { w.Write(topic_alt_frags[178]) -w.Write(phrases[51]) +w.Write(phrases[39]) w.Write(topic_alt_frags[179]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Avatar)) w.Write(topic_alt_frags[180]) @@ -572,28 +525,28 @@ w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Tag)) w.Write(topic_alt_frags[184]) } else { w.Write(topic_alt_frags[185]) -w.Write(phrases[52]) +w.Write(phrases[40]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.CurrentUser.Level))) w.Write(topic_alt_frags[186]) } w.Write(topic_alt_frags[187]) -w.Write(phrases[53]) +w.Write(phrases[41]) w.Write(topic_alt_frags[188]) w.Write([]byte(tmpl_topic_alt_vars.CurrentUser.Session)) w.Write(topic_alt_frags[189]) w.Write([]byte(strconv.Itoa(tmpl_topic_alt_vars.Topic.ID))) w.Write(topic_alt_frags[190]) -w.Write(phrases[54]) +w.Write(phrases[42]) w.Write(topic_alt_frags[191]) -w.Write(phrases[55]) +w.Write(phrases[43]) w.Write(topic_alt_frags[192]) -w.Write(phrases[56]) +w.Write(phrases[44]) w.Write(topic_alt_frags[193]) -w.Write(phrases[57]) +w.Write(phrases[45]) w.Write(topic_alt_frags[194]) if tmpl_topic_alt_vars.CurrentUser.Perms.UploadFiles { w.Write(topic_alt_frags[195]) -w.Write(phrases[58]) +w.Write(phrases[46]) w.Write(topic_alt_frags[196]) } w.Write(topic_alt_frags[197]) @@ -602,11 +555,11 @@ w.Write(topic_alt_frags[198]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_topic_alt_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[59]) +w.Write(phrases[47]) w.Write(footer_frags[2]) -w.Write(phrases[60]) +w.Write(phrases[48]) w.Write(footer_frags[3]) -w.Write(phrases[61]) +w.Write(phrases[49]) w.Write(footer_frags[4]) if len(tmpl_topic_alt_vars.Header.Themes) != 0 { for _, item := range tmpl_topic_alt_vars.Header.Themes { diff --git a/template_topics.go b/template_topics.go index d98317d2..37ef65bd 100644 --- a/template_topics.go +++ b/template_topics.go @@ -3,8 +3,8 @@ // 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. */ package main -import "io" import "./common" +import "io" import "strconv" var topics_tmpl_phrase_id int @@ -16,18 +16,6 @@ func init() { common.TmplPtrMap["topics"] = &common.Template_topics_handle common.TmplPtrMap["o_topics"] = Template_topics topics_tmpl_phrase_id = common.RegisterTmplPhraseNames([]string{ - "menu_account_aria", - "menu_account_tooltip", - "menu_profile_aria", - "menu_profile_tooltip", - "menu_panel_aria", - "menu_panel_tooltip", - "menu_logout_aria", - "menu_logout_tooltip", - "menu_register_aria", - "menu_register_tooltip", - "menu_login_aria", - "menu_login_tooltip", "menu_hamburger_tooltip", "topics_head", "topic_list_create_topic_tooltip", @@ -108,88 +96,53 @@ if !tmpl_topics_vars.CurrentUser.IsSuperMod { w.Write(header_frags[15]) } w.Write(header_frags[16]) -w.Write(menu_frags[0]) w.Write([]byte(common.BuildWidget("leftOfNav",tmpl_topics_vars.Header))) -w.Write(menu_frags[1]) -w.Write([]byte(tmpl_topics_vars.Header.Site.ShortName)) -w.Write(menu_frags[2]) -w.Write([]byte(common.BuildWidget("topMenu",tmpl_topics_vars.Header))) -if tmpl_topics_vars.CurrentUser.Loggedin { -w.Write(menu_frags[3]) -w.Write(phrases[0]) -w.Write(menu_frags[4]) -w.Write(phrases[1]) -w.Write(menu_frags[5]) -w.Write([]byte(tmpl_topics_vars.CurrentUser.Link)) -w.Write(menu_frags[6]) -w.Write(phrases[2]) -w.Write(menu_frags[7]) -w.Write(phrases[3]) -w.Write(menu_frags[8]) -w.Write(phrases[4]) -w.Write(menu_frags[9]) -w.Write(phrases[5]) -w.Write(menu_frags[10]) -w.Write([]byte(tmpl_topics_vars.CurrentUser.Session)) -w.Write(menu_frags[11]) -w.Write(phrases[6]) -w.Write(menu_frags[12]) -w.Write(phrases[7]) -w.Write(menu_frags[13]) -} else { -w.Write(menu_frags[14]) -w.Write(phrases[8]) -w.Write(menu_frags[15]) -w.Write(phrases[9]) -w.Write(menu_frags[16]) -w.Write(phrases[10]) -w.Write(menu_frags[17]) -w.Write(phrases[11]) -w.Write(menu_frags[18]) -} -w.Write(menu_frags[19]) -w.Write(phrases[12]) -w.Write(menu_frags[20]) -w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_topics_vars.Header))) -w.Write(menu_frags[21]) w.Write(header_frags[17]) -if tmpl_topics_vars.Header.Widgets.RightSidebar != "" { +w.Write([]byte(tmpl_topics_vars.Header.Site.ShortName)) w.Write(header_frags[18]) -} +w.Write([]byte(common.BuildWidget("topMenu",tmpl_topics_vars.Header))) w.Write(header_frags[19]) +w.Write(phrases[0]) +w.Write(header_frags[20]) +w.Write([]byte(common.BuildWidget("rightOfNav",tmpl_topics_vars.Header))) +w.Write(header_frags[21]) +if tmpl_topics_vars.Header.Widgets.RightSidebar != "" { +w.Write(header_frags[22]) +} +w.Write(header_frags[23]) if len(tmpl_topics_vars.Header.NoticeList) != 0 { for _, item := range tmpl_topics_vars.Header.NoticeList { -w.Write(header_frags[20]) +w.Write(header_frags[24]) w.Write([]byte(item)) -w.Write(header_frags[21]) +w.Write(header_frags[25]) } } -w.Write(header_frags[22]) +w.Write(header_frags[26]) w.Write(topics_frags[0]) if tmpl_topics_vars.CurrentUser.ID != 0 { w.Write(topics_frags[1]) } w.Write(topics_frags[2]) -w.Write(phrases[13]) +w.Write(phrases[1]) w.Write(topics_frags[3]) if tmpl_topics_vars.CurrentUser.ID != 0 { w.Write(topics_frags[4]) if len(tmpl_topics_vars.ForumList) != 0 { w.Write(topics_frags[5]) -w.Write(phrases[14]) +w.Write(phrases[2]) w.Write(topics_frags[6]) -w.Write(phrases[15]) +w.Write(phrases[3]) w.Write(topics_frags[7]) w.Write(topics_frags[8]) -w.Write(phrases[16]) +w.Write(phrases[4]) w.Write(topics_frags[9]) -w.Write(phrases[17]) +w.Write(phrases[5]) w.Write(topics_frags[10]) } else { w.Write(topics_frags[11]) -w.Write(phrases[18]) +w.Write(phrases[6]) w.Write(topics_frags[12]) -w.Write(phrases[19]) +w.Write(phrases[7]) w.Write(topics_frags[13]) } w.Write(topics_frags[14]) @@ -197,21 +150,21 @@ w.Write(topics_frags[14]) w.Write(topics_frags[15]) if tmpl_topics_vars.CurrentUser.ID != 0 { w.Write(topics_frags[16]) -w.Write(phrases[20]) +w.Write(phrases[8]) w.Write(topics_frags[17]) -w.Write(phrases[21]) +w.Write(phrases[9]) w.Write(topics_frags[18]) -w.Write(phrases[22]) +w.Write(phrases[10]) w.Write(topics_frags[19]) -w.Write(phrases[23]) +w.Write(phrases[11]) w.Write(topics_frags[20]) -w.Write(phrases[24]) +w.Write(phrases[12]) w.Write(topics_frags[21]) if len(tmpl_topics_vars.ForumList) != 0 { w.Write(topics_frags[22]) w.Write([]byte(tmpl_topics_vars.CurrentUser.Session)) w.Write(topics_frags[23]) -w.Write(phrases[25]) +w.Write(phrases[13]) w.Write(topics_frags[24]) if len(tmpl_topics_vars.ForumList) != 0 { for _, item := range tmpl_topics_vars.ForumList { @@ -225,17 +178,17 @@ w.Write(topics_frags[28]) } } w.Write(topics_frags[29]) -w.Write(phrases[26]) +w.Write(phrases[14]) w.Write(topics_frags[30]) -w.Write(phrases[27]) +w.Write(phrases[15]) w.Write(topics_frags[31]) w.Write([]byte(tmpl_topics_vars.CurrentUser.Session)) w.Write(topics_frags[32]) w.Write([]byte(tmpl_topics_vars.CurrentUser.Avatar)) w.Write(topics_frags[33]) -w.Write(phrases[28]) +w.Write(phrases[16]) w.Write(topics_frags[34]) -w.Write(phrases[29]) +w.Write(phrases[17]) w.Write(topics_frags[35]) if len(tmpl_topics_vars.ForumList) != 0 { for _, item := range tmpl_topics_vars.ForumList { @@ -251,28 +204,28 @@ w.Write(topics_frags[40]) } } w.Write(topics_frags[41]) -w.Write(phrases[30]) +w.Write(phrases[18]) w.Write(topics_frags[42]) -w.Write(phrases[31]) +w.Write(phrases[19]) w.Write(topics_frags[43]) -w.Write(phrases[32]) +w.Write(phrases[20]) w.Write(topics_frags[44]) -w.Write(phrases[33]) +w.Write(phrases[21]) w.Write(topics_frags[45]) -w.Write(phrases[34]) +w.Write(phrases[22]) w.Write(topics_frags[46]) if tmpl_topics_vars.CurrentUser.Perms.UploadFiles { w.Write(topics_frags[47]) -w.Write(phrases[35]) +w.Write(phrases[23]) w.Write(topics_frags[48]) } w.Write(topics_frags[49]) -w.Write(phrases[36]) +w.Write(phrases[24]) w.Write(topics_frags[50]) } } w.Write(topics_frags[51]) -w.Write(phrases[37]) +w.Write(phrases[25]) w.Write(topics_frags[52]) if len(tmpl_topics_vars.TopicList) != 0 { for _, item := range tmpl_topics_vars.TopicList { @@ -319,12 +272,12 @@ w.Write([]byte(item.Creator.Name)) w.Write(topics_frags[72]) if item.IsClosed { w.Write(topics_frags[73]) -w.Write(phrases[38]) +w.Write(phrases[26]) w.Write(topics_frags[74]) } if item.Sticky { w.Write(topics_frags[75]) -w.Write(phrases[39]) +w.Write(phrases[27]) w.Write(topics_frags[76]) } w.Write(topics_frags[77]) @@ -359,10 +312,10 @@ w.Write(topics_frags[90]) } } else { w.Write(topics_frags[91]) -w.Write(phrases[40]) +w.Write(phrases[28]) if tmpl_topics_vars.CurrentUser.Perms.CreateTopic { w.Write(topics_frags[92]) -w.Write(phrases[41]) +w.Write(phrases[29]) w.Write(topics_frags[93]) } w.Write(topics_frags[94]) @@ -374,9 +327,9 @@ if tmpl_topics_vars.Page > 1 { w.Write(paginator_frags[1]) w.Write([]byte(strconv.Itoa(tmpl_topics_vars.Page - 1))) w.Write(paginator_frags[2]) -w.Write(phrases[42]) +w.Write(phrases[30]) w.Write(paginator_frags[3]) -w.Write(phrases[43]) +w.Write(phrases[31]) w.Write(paginator_frags[4]) w.Write([]byte(strconv.Itoa(tmpl_topics_vars.Page - 1))) w.Write(paginator_frags[5]) @@ -396,9 +349,9 @@ w.Write([]byte(strconv.Itoa(tmpl_topics_vars.Page + 1))) w.Write(paginator_frags[10]) w.Write([]byte(strconv.Itoa(tmpl_topics_vars.Page + 1))) w.Write(paginator_frags[11]) -w.Write(phrases[44]) +w.Write(phrases[32]) w.Write(paginator_frags[12]) -w.Write(phrases[45]) +w.Write(phrases[33]) w.Write(paginator_frags[13]) } w.Write(paginator_frags[14]) @@ -407,11 +360,11 @@ w.Write(topics_frags[96]) w.Write(footer_frags[0]) w.Write([]byte(common.BuildWidget("footer",tmpl_topics_vars.Header))) w.Write(footer_frags[1]) -w.Write(phrases[46]) +w.Write(phrases[34]) w.Write(footer_frags[2]) -w.Write(phrases[47]) +w.Write(phrases[35]) w.Write(footer_frags[3]) -w.Write(phrases[48]) +w.Write(phrases[36]) w.Write(footer_frags[4]) if len(tmpl_topics_vars.Header.Themes) != 0 { for _, item := range tmpl_topics_vars.Header.Themes { diff --git a/templates/header.html b/templates/header.html index 7a10f12c..243303c1 100644 --- a/templates/header.html +++ b/templates/header.html @@ -20,10 +20,23 @@ {{if .Header.MetaDesc}}{{end}} - + {{if not .CurrentUser.IsSuperMod}}{{end}}
-{{template "menu.html" .}} -
-
{{range .Header.NoticeList}} -
{{.}}
{{end}} -
+
{{dock "leftOfNav" .Header }}
+ +
{{dock "rightOfNav" .Header }}
+
+
{{range .Header.NoticeList}} +
{{.}}
{{end}} +
diff --git a/templates/menu.html b/templates/menu.html deleted file mode 100644 index eea545d3..00000000 --- a/templates/menu.html +++ /dev/null @@ -1,23 +0,0 @@ -
{{dock "leftOfNav" .Header }}
- -
{{dock "rightOfNav" .Header }}
\ No newline at end of file