From 3821e626cec5be65e724faf5b3aa893fa090932a Mon Sep 17 00:00:00 2001 From: Azareal Date: Sun, 11 Mar 2018 09:33:49 +0000 Subject: [PATCH] Added support for phrases in CSS files. Add support for phrases in template files. Revamped every template to make them use phrases. Revamped every CSS file to make them use phrases. Tweaked the contributing document. We now use LogError instead of log.Fatal() in a few places to capture more stack traces. Fixed the suffixes on the topic and post count pages, as they were saying views instead of posts / topics. Split the paginator into it's own template. Refactored the theme logic to defer loading the static files to a later stage. Greatly improved the accessibility with a number of ARIA attributes in places where there were none. Removed the edit-topic and page templates. Renamed the panel-adminlogs template to panel_adminlogs. Non-existent phrases used by transpiled templates should now be logged. Fixed a bug where alertbox was plopped down multiple times on one page. The phrase placeholders are more informative now. Added the CurrentLanguagePackName and GetLanguagePackByName API functions. Notices are now shown when you delete, update, or create a forum. --- CONTRIBUTING.md | 8 +- common/alerts.go | 9 +- common/files.go | 2 +- common/phrases.go | 43 +- common/template_init.go | 2 +- common/themes.go | 59 +- langs/english.json | 453 +++++- main.go | 9 + panel_routes.go | 26 +- template_error.go | 101 +- template_forum.go | 410 +++-- template_forums.go | 160 +- template_guilds_guild_list.go | 104 +- template_ip_search.go | 126 +- template_list.go | 1444 ++++++++++------- template_login.go | 111 +- template_profile.go | 308 +++- template_register.go | 115 +- template_topic.go | 681 +++++--- template_topic_alt.go | 656 +++++--- template_topics.go | 442 +++-- templates/account_menu.html | 12 +- templates/account_own_edit.html | 10 +- templates/account_own_edit_avatar.html | 6 +- templates/account_own_edit_email.html | 6 +- templates/account_own_edit_username.html | 8 +- templates/are_you_sure.html | 4 +- templates/create_topic.html | 17 +- templates/edit-topic.html | 29 - templates/footer.html | 4 +- templates/forum.html | 57 +- templates/forums.html | 8 +- templates/header.html | 6 +- templates/ip_search.html | 2 +- templates/login.html | 8 +- templates/menu.html | 22 +- templates/page.html | 1 - templates/paginator.html | 10 + templates/panel-forum-edit-perms.html | 8 +- templates/panel-forum-edit.html | 44 +- templates/panel-group-edit.html | 22 +- templates/panel-inner-menu.html | 53 +- templates/panel-user-edit.html | 14 +- ...el-adminlogs.html => panel_adminlogs.html} | 18 +- templates/panel_analytics_agent_views.html | 14 +- templates/panel_analytics_agents.html | 18 +- templates/panel_analytics_forum_views.html | 14 +- templates/panel_analytics_forums.html | 18 +- templates/panel_analytics_lang_views.html | 14 +- templates/panel_analytics_langs.html | 18 +- templates/panel_analytics_posts.html | 24 +- templates/panel_analytics_referrer_views.html | 14 +- templates/panel_analytics_referrers.html | 18 +- templates/panel_analytics_route_views.html | 20 +- templates/panel_analytics_routes.html | 18 +- templates/panel_analytics_system_views.html | 14 +- templates/panel_analytics_systems.html | 18 +- templates/panel_analytics_topics.html | 22 +- templates/panel_analytics_views.html | 22 +- templates/panel_backups.html | 6 +- templates/panel_dashboard.html | 2 +- templates/panel_debug.html | 8 +- templates/panel_forums.html | 46 +- templates/panel_groups.html | 26 +- templates/panel_modlogs.html | 16 +- templates/panel_plugins.html | 12 +- templates/panel_setting.html | 12 +- templates/panel_settings.html | 2 +- templates/panel_themes.html | 16 +- templates/panel_users.html | 16 +- templates/panel_word_filters.html | 22 +- templates/profile.html | 30 +- templates/profile_comments_row.html | 12 +- templates/topic.html | 70 +- templates/topic_alt.html | 82 +- templates/topics.html | 61 +- themes/cosora/public/main.css | 48 +- themes/cosora/public/panel.css | 12 +- themes/shadow/public/main.css | 52 +- themes/shadow/public/panel.css | 4 +- themes/tempra-conflux/public/main.css | 40 +- themes/tempra-conflux/public/panel.css | 40 +- themes/tempra-simple/public/main.css | 22 +- themes/tempra-simple/public/panel.css | 16 +- 84 files changed, 4293 insertions(+), 2284 deletions(-) delete mode 100644 templates/edit-topic.html delete mode 100644 templates/page.html create mode 100644 templates/paginator.html rename templates/{panel-adminlogs.html => panel_adminlogs.html} (55%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 557b2584..a28c4ece 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,8 @@ We're not accepting contributions right now, although you're welcome to poke me All code must be unit tested where ever possible with the exception of JavaScript which is untestable with our current technologies, tread with caution there. +Use tabs not spaces for indentation. + # Golang Use the standard linter and listen to what it tells you to do. @@ -28,4 +30,8 @@ To keep consistency with Go code, variables must be camelCase. # JSON -To keep consistency with Go code, map keys must be camelCase. \ No newline at end of file +To keep consistency with Go code, map keys must be camelCase. + +# Phrases + +Try to keep the name of the phrase close to the actual phrase in english to make it easier for localisers to reason about which phrase is which. diff --git a/common/alerts.go b/common/alerts.go index 3b8d0e8c..2bb83c21 100644 --- a/common/alerts.go +++ b/common/alerts.go @@ -9,7 +9,6 @@ package common import ( "database/sql" "errors" - "log" "strconv" "strings" @@ -210,7 +209,7 @@ func NotifyWatchers(asid int64) error { func notifyWatchers(asid int64) { rows, err := alertStmts.getWatchers.Query(asid) if err != nil && err != ErrNoRows { - log.Fatal(err.Error()) + LogError(err) return } defer rows.Close() @@ -220,14 +219,14 @@ func notifyWatchers(asid int64) { for rows.Next() { err := rows.Scan(&uid) if err != nil { - log.Fatal(err.Error()) + LogError(err) return } uids = append(uids, uid) } err = rows.Err() if err != nil { - log.Fatal(err.Error()) + LogError(err) return } @@ -235,7 +234,7 @@ func notifyWatchers(asid int64) { var event, elementType string err = alertStmts.getActivityEntry.QueryRow(asid).Scan(&actorID, &targetUserID, &event, &elementType, &elementID) if err != nil && err != ErrNoRows { - log.Fatal(err.Error()) + LogError(err) return } diff --git a/common/files.go b/common/files.go index a8a37a5f..07f96037 100644 --- a/common/files.go +++ b/common/files.go @@ -30,7 +30,7 @@ type SFile struct { } type CSSData struct { - ComingSoon string + Phrases map[string]string } func (list SFileList) Init() error { diff --git a/common/phrases.go b/common/phrases.go index 9caa4348..a8530801 100644 --- a/common/phrases.go +++ b/common/phrases.go @@ -48,6 +48,7 @@ type LanguagePack struct { Errors map[string]map[string]string // map[category]map[name]value PageTitles map[string]string TmplPhrases map[string]string + CSSPhrases map[string]string TmplIndicesToPhrases [][][]byte // [tmplID][index]phrase } @@ -84,7 +85,11 @@ func InitPhrases() error { for tmplID, phraseNames := range langTmplIndicesToNames { var phraseSet = make([][]byte, len(phraseNames)) for index, phraseName := range phraseNames { - phraseSet[index] = []byte(langPack.TmplPhrases[phraseName]) + phrase, ok := langPack.TmplPhrases[phraseName] + if !ok { + log.Print("Couldn't find template phrase '" + phraseName + "'") + } + phraseSet[index] = []byte(phrase) } langPack.TmplIndicesToPhrases[tmplID] = phraseSet } @@ -131,7 +136,7 @@ func GetPhrase(name string) (string, bool) { func GetGlobalPermPhrase(name string) string { res, ok := currentLangPack.Load().(*LanguagePack).GlobalPerms[name] if !ok { - return getPhrasePlaceholder() + return getPhrasePlaceholder("perms", name) } return res } @@ -139,7 +144,7 @@ func GetGlobalPermPhrase(name string) string { func GetLocalPermPhrase(name string) string { res, ok := currentLangPack.Load().(*LanguagePack).LocalPerms[name] if !ok { - return getPhrasePlaceholder() + return getPhrasePlaceholder("perms", name) } return res } @@ -147,7 +152,7 @@ func GetLocalPermPhrase(name string) string { func GetSettingLabel(name string) string { res, ok := currentLangPack.Load().(*LanguagePack).SettingLabels[name] if !ok { - return getPhrasePlaceholder() + return getPhrasePlaceholder("settings", name) } return res } @@ -163,7 +168,7 @@ func GetAllPermPresets() map[string]string { func GetAccountPhrase(name string) string { res, ok := currentLangPack.Load().(*LanguagePack).Accounts[name] if !ok { - return getPhrasePlaceholder() + return getPhrasePlaceholder("account", name) } return res } @@ -187,7 +192,7 @@ func GetOSPhrase(name string) (string, bool) { func GetHumanLangPhrase(name string) (string, bool) { res, ok := currentLangPack.Load().(*LanguagePack).HumanLanguages[name] if !ok { - return "", false + return getPhrasePlaceholder("humanlang", name), false } return res, true } @@ -196,7 +201,7 @@ func GetHumanLangPhrase(name string) (string, bool) { func GetErrorPhrase(category string, name string) string { res, ok := currentLangPack.Load().(*LanguagePack).Errors[category][name] if !ok { - return getPhrasePlaceholder() + return getPhrasePlaceholder("error", name) } return res } @@ -204,7 +209,7 @@ func GetErrorPhrase(category string, name string) string { func GetTitlePhrase(name string) string { res, ok := currentLangPack.Load().(*LanguagePack).PageTitles[name] if !ok { - return getPhrasePlaceholder() + return getPhrasePlaceholder("title", name) } return res } @@ -212,13 +217,17 @@ func GetTitlePhrase(name string) string { func GetTmplPhrase(name string) string { res, ok := currentLangPack.Load().(*LanguagePack).TmplPhrases[name] if !ok { - return getPhrasePlaceholder() + return getPhrasePlaceholder("tmpl", name) } return res } -func getPhrasePlaceholder() string { - return "{name}" +func GetCSSPhrases() map[string]string { + return currentLangPack.Load().(*LanguagePack).CSSPhrases +} + +func getPhrasePlaceholder(prefix string, suffix string) string { + return "{lang." + prefix + "[" + suffix + "]}" } // ? - Use runtime reflection for updating phrases? @@ -244,6 +253,18 @@ func ChangeLanguagePack(name string) (exists bool) { return true } +func CurrentLanguagePackName() (name string) { + return currentLangPack.Load().(*LanguagePack).Name +} + +func GetLanguagePackByName(name string) (pack *LanguagePack, ok bool) { + packInt, ok := langPacks.Load(name) + if !ok { + return nil, false + } + return packInt.(*LanguagePack), true +} + // Template Transpiler Stuff func RegisterTmplPhraseNames(phraseNames []string) (tmplID int) { diff --git a/common/template_init.go b/common/template_init.go index 0d98e59f..8f32e660 100644 --- a/common/template_init.go +++ b/common/template_init.go @@ -353,7 +353,7 @@ func InitTemplates() error { if !ok { panic("phraseNameInt is not a string") } - return GetTmplPhrase(phraseName) + return GetTmplPhrase(phraseName) // TODO: Log non-existent phrases? } // The interpreted templates... diff --git a/common/themes.go b/common/themes.go index c7c537e3..4cf34d83 100644 --- a/common/themes.go +++ b/common/themes.go @@ -129,6 +129,16 @@ func (themes ThemeList) LoadActiveStatus() error { return rows.Err() } +func (themes ThemeList) LoadStaticFiles() error { + for _, theme := range themes { + err := theme.LoadStaticFiles() + if err != nil { + return err + } + } + return nil +} + func InitThemes() error { themeFiles, err := ioutil.ReadDir("./themes") if err != nil { @@ -185,10 +195,6 @@ func InitThemes() error { } } - err = theme.LoadStaticFiles() - if err != nil { - return err - } Themes[theme.Name] = theme } return nil @@ -204,6 +210,7 @@ func (theme *Theme) LoadStaticFiles() error { } func (theme *Theme) AddThemeStaticFiles() error { + phraseMap := GetCSSPhrases() // TODO: Use a function instead of a closure to make this more testable? What about a function call inside the closure to take the theme variable into account? return filepath.Walk("./themes/"+theme.Name+"/public", func(path string, f os.FileInfo, err error) error { DebugLog("Attempting to add static file '" + path + "' for default theme '" + theme.Name + "'") @@ -225,7 +232,7 @@ func (theme *Theme) AddThemeStaticFiles() error { var b bytes.Buffer var pieces = strings.Split(path, "/") var filename = pieces[len(pieces)-1] - err = theme.ResourceTemplates.ExecuteTemplate(&b, filename, CSSData{ComingSoon: "We don't have any data to pass you yet!"}) + err = theme.ResourceTemplates.ExecuteTemplate(&b, filename, CSSData{Phrases: phraseMap}) if err != nil { return err } @@ -245,10 +252,10 @@ func (theme *Theme) MapTemplates() { if theme.Templates != nil { for _, themeTmpl := range theme.Templates { if themeTmpl.Name == "" { - log.Fatal("Invalid destination template name") + LogError(errors.New("Invalid destination template name")) } if themeTmpl.Source == "" { - log.Fatal("Invalid source template name") + LogError(errors.New("Invalid source template name")) } // `go generate` is one possibility for letting plugins inject custom page structs, but it would simply add another step of compilation. It might be simpler than the current build process from the perspective of the administrator? @@ -259,7 +266,7 @@ func (theme *Theme) MapTemplates() { } sourceTmplPtr, ok := TmplPtrMap[themeTmpl.Source] if !ok { - log.Fatal("The source template doesn't exist!") + LogError(errors.New("The source template doesn't exist!")) } switch dTmplPtr := destTmplPtr.(type) { @@ -270,7 +277,7 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case *func(TopicsPage, http.ResponseWriter): switch sTmplPtr := sourceTmplPtr.(type) { @@ -279,7 +286,7 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case *func(ForumPage, http.ResponseWriter): switch sTmplPtr := sourceTmplPtr.(type) { @@ -288,7 +295,7 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case *func(ForumsPage, http.ResponseWriter): switch sTmplPtr := sourceTmplPtr.(type) { @@ -297,7 +304,7 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case *func(ProfilePage, http.ResponseWriter): switch sTmplPtr := sourceTmplPtr.(type) { @@ -306,7 +313,7 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case *func(CreateTopicPage, http.ResponseWriter): switch sTmplPtr := sourceTmplPtr.(type) { @@ -315,7 +322,7 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case *func(IPSearchPage, http.ResponseWriter): switch sTmplPtr := sourceTmplPtr.(type) { @@ -324,7 +331,7 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case *func(Page, http.ResponseWriter): switch sTmplPtr := sourceTmplPtr.(type) { @@ -333,10 +340,10 @@ func (theme *Theme) MapTemplates() { overridenTemplates[themeTmpl.Name] = true *dTmplPtr = *sTmplPtr default: - log.Fatal("The source and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } default: - log.Fatal("Unknown destination template type!") + LogError(errors.New("Unknown destination template type!")) } } } @@ -367,59 +374,59 @@ func ResetTemplateOverrides() { case *func(TopicPage, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case func(TopicsPage, http.ResponseWriter): switch dPtr := destTmplPtr.(type) { case *func(TopicsPage, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case func(ForumPage, http.ResponseWriter): switch dPtr := destTmplPtr.(type) { case *func(ForumPage, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case func(ForumsPage, http.ResponseWriter): switch dPtr := destTmplPtr.(type) { case *func(ForumsPage, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case func(ProfilePage, http.ResponseWriter): switch dPtr := destTmplPtr.(type) { case *func(ProfilePage, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case func(CreateTopicPage, http.ResponseWriter): switch dPtr := destTmplPtr.(type) { case *func(CreateTopicPage, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case func(IPSearchPage, http.ResponseWriter): switch dPtr := destTmplPtr.(type) { case *func(IPSearchPage, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } case func(Page, http.ResponseWriter): switch dPtr := destTmplPtr.(type) { case *func(Page, http.ResponseWriter): *dPtr = oPtr default: - log.Fatal("The origin and destination templates are incompatible") + LogError(errors.New("The source and destination templates are incompatible")) } default: - log.Fatal("Unknown destination template type!") + LogError(errors.New("Unknown destination template type!")) } log.Print("The template override was reset") } diff --git a/langs/english.json b/langs/english.json index b305603e..28840cf0 100644 --- a/langs/english.json +++ b/langs/english.json @@ -228,6 +228,26 @@ }, "TmplPhrases": { + "menu_forums_tooltip":"Forum List", + "menu_forums_aria":"The Forum list", + "menu_topics_tooltip":"Topic List", + "menu_topics_aria":"The topic list", + "menu_alert_counter_aria":"The number of alerts", + "menu_alert_list_aria":"The alert list", + "menu_account_tooltip":"Account Manager", + "menu_account_aria":"The account manager", + "menu_profile_tooltip":"Your profile", + "menu_profile_aria":"Your profile", + "menu_panel_tooltip":"Control Panel", + "menu_panel_aria":"The Control Panel", + "menu_logout_tooltip":"Logout", + "menu_logout_aria":"Log out of your account", + "menu_register_tooltip":"Register", + "menu_register_aria":"Create a new account", + "menu_login_tooltip":"Login", + "menu_login_aria":"Login to your account", + "menu_hamburger_tooltip":"Menu", + "login_head":"Login", "login_account_name":"Account Name", "login_account_password":"Password", @@ -241,9 +261,440 @@ "register_account_confirm_password":"Confirm Password", "register_submit_button":"Create Account", + "account_menu_head":"My Account", + "account_menu_avatar":"Avatar", + "account_menu_username":"Username", + "account_menu_password":"Password", + "account_menu_email":"Email", + "account_menu_notifications":"Notifications", + + "account_avatar_head":"Edit Avatar", + "account_avatar_upload_label":"Upload Avatar", + "account_avatar_update_button":"Update", + + "account_email_head":"Emails", + "account_email_primary":"Primary", + "account_email_secondary":"Secondary", + "account_email_verified":"Verified", + "account_email_resend_email":"Resend Verification Email", + + "account_username_head":"Edit Username", + "account_username_current_username":"Current Username", + "account_username_new_username":"New Username", + "account_username_update_button":"Update", + + "account_password_head":"Edit Password", + "account_password_current_password":"Current Password", + "account_password_new_password":"New Password", + "account_password_confirm_password":"Confirm Password", + "account_password_update_button":"Update", + + "areyousure_head":"Are you sure?", + "areyousure_continue":"Continue", + + "create_topic_head":"Create Topic", + "create_topic_board":"Board", + "create_topic_name":"Topic Name", + "create_topic_content":"Content", + "create_topic_placeholder":"Insert content here", + "create_topic_create_topic_button":"Create Topic", + "create_topic_add_file_button":"Add File", + + "quick_topic_aria":"Quick Topic Form", + "quick_topic_avatar_tooltip":"Your Avatar", + "quick_topic_avatar_alt":"Your Avatar", + "quick_topic_whatsup":"What's up?", + "quick_topic_placeholder":"Insert post here", + "quick_topic_add_poll_option":"Add new poll option", + "quick_topic_create_topic_button":"Create Topic", + "quick_topic_add_poll_button":"Add Poll", + "quick_topic_add_file_button":"Add File", + "quick_topic_cancel_button":"Cancel", + + "topic_list_create_topic_tooltip":"Create Topic", + "topic_list_create_topic_aria":"Create a topic", + "topic_list_moderate_tooltip":"Moderate", + "topic_list_moderate_aria":"Moderate Posts", + "topic_list_what_to_do":"What do you want to do with these 18 topics?", + "topic_list_moderate_delete":"Delete them", + "topic_list_moderate_lock":"Lock them", + "topic_list_moderate_move":"Move them", + "topic_list_moderate_run":"Run", + "topic_list_move_head":"Move these topics to?", + "topic_list_move_button":"Move Topics", + "status_closed_tooltip":"Status: Closed", + "status_pinned_tooltip":"Status: Pinned", + + "topics_head":"All Topics", + "topics_locked_tooltip":"You don't have the permissions needed to create a topic", + "topics_locked_aria":"You don't have the permissions needed to make a topic anywhere", + "topics_list_aria":"A list containing topics from every forum", + "topics_no_topics":"There aren't any topics yet.", + "topics_start_one":"Start one?", + + "forum_locked_tooltip":"You don't have the permissions needed to create a topic", + "forum_locked_aria":"You don't have the permissions needed to make a topic in this forum", + "forum_list_aria":"A list containing topics for the specified forum", + "forum_no_topics":"There aren't any topics in this forum yet.", + "forum_start_one":"Start one?", + + "forums_head":"Forums", + "forums_no_description":"No description", + "forums_none":"None", + "forums_no_forums":"You don't have access to any forums.", + + "topic_opening_post_aria":"The opening post for this topic", + "topic_status_closed_aria":"This topic has been locked", + "topic_title_input_aria":"Topic Title Input", + "topic_update_button":"Update", + "topic_userinfo_aria":"The information on the poster", + "topic_poll_aria":"The main poll for this topic", + "topic_poll_vote":"Vote", + "topic_poll_results":"Results", + "topic_poll_cancel":"Cancel", + "topic_post_controls_aria":"Controls and Author Information", + "topic_unlike_tooltip":"Unlike", + "topic_unlike_aria":"Unlike this topic", + "topic_like_tooltip":"Like", + "topic_like_aria":"Like this topic", + "topic_edit_tooltip":"Edit Topic", + "topic_edit_aria":"Edit this topic", + "topic_delete_tooltip":"Delete Topic", + "topic_delete_aria":"Delete this topic", + "topic_unlock_tooltip":"Unlock Topic", + "topic_unlock_aria":"Unlock this topic", + "topic_lock_tooltip":"Lock Topic", + "topic_lock_aria":"Lock this topic", + "topic_unpin_tooltip":"Unpin Topic", + "topic_unpin_aria":"Unpin this topic", + "topic_pin_tooltip":"Pin Topic", + "topic_pin_aria":"Pin this topic", + "topic_ip_tooltip":"View IP", + "topic_ip_full_tooltip":"IP Address", + "topic_ip_full_aria":"This user's IP Address", + "topic_flag_tooltip":"Flag this topic", + "topic_flag_aria":"Flag this topic", + "topic_report_tooltip":"Report this topic", + "topic_report_aria":"Report this topic", + "topic_like_count_aria":"The number of likes on this topic", + "topic_like_count_tooltip":"Like Count", + "topic_level_aria":"The poster's level", + "topic_level_tooltip":"Level", + "topic_current_page_aria":"The current page for this topic", + "topic_post_like_tooltip":"Like this", + "topic_post_like_aria":"Like this post", + "topic_post_unlike_tooltip":"Unlike this", + "topic_post_unlike_aria":"Unlike this post", + "topic_post_edit_tooltip":"Edit Reply", + "topic_post_edit_aria":"Edit this post", + "topic_post_delete_tooltip":"Delete Reply", + "topic_post_delete_aria":"Delete this post", + "topic_post_ip_tooltip":"View IP", + "topic_post_flag_tooltip":"Flag this reply", + "topic_post_flag_aria":"Flag this reply", + "topic_post_like_count_tooltip":"Like Count", + "topic_post_level_aria":"The poster's level", + "topic_post_level_tooltip":"Level", + "topic_reply_aria":"The quick reply form", + "topic_reply_content":"Insert reply here", + "topic_reply_content_alt":"What do you think?", + "topic_reply_add_poll_option":"Add new poll option", + "topic_reply_button":"Create Reply", + "topic_reply_add_poll_button":"Add Poll", + "topic_reply_add_file_button":"Add File", + + "topic_level_prefix":"Level ", + "topic_your_information":"Your information", + + "paginator_less_than":"<", + "paginator_greater_than":">", + "paginator_prev_page":"Prev", + "paginator_prev_page_aria":"Go to the previous page", + "paginator_next_page":"Next", + "paginator_next_page_aria":"Go to the next page", + + "profile_login_for_options":"Login for options", + "profile_add_friend":"Add Friend", + "profile_unban":"Unban", + "profile_ban":"Ban", + "profile_report_user_tooltip":"Report User", + "profile_report_user_aria":"Report User", + "profile_ban_user_head":"Ban User", + "profile_ban_user_notice":"If all the fields are left blank, the ban will be permanent.", + "profile_ban_user_days":"Days", + "profile_ban_user_weeks":"Weeks", + "profile_ban_user_months":"Months", + "profile_ban_user_reason":"Reason", + "profile_ban_user_button":"Ban User", + "profile_comments_head":"Comments", + "profile_comments_edit_tooltip":"Edit Item", + "profile_comments_edit_aria":"Edit Item", + "profile_comments_delete_tooltip":"Delete Item", + "profile_comments_delete_aria":"Delete Item", + "profile_comments_report_tooltip":"Report Item", + "profile_comments_report_aria":"Report Item", + "profile_comments_form_content":"Insert comment here", + "profile_comments_form_button":"Create Reply", + "ip_search_head":"IP Search", + "ip_search_search_button":"Search", "ip_search_no_users":"No users found.", - "error_head":"An error has occured" + "error_head":"An error has occured", + "footer_thingymawhatsit":"Can you please keep the powered by notice? ;)", + "footer_powered_by":"Powered by Gosora", + "footer_made_with_love":"Made with love by Azareal", + "footer_theme_selector_aria":"Change the site's appearance", + + "option_yes":"Yes", + "option_no":"No", + + "panel_menu_head":"Control Panel", + "panel_menu_users":"Users", + "panel_menu_groups":"Groups", + "panel_menu_forums":"Forums", + "panel_menu_settings":"Settings", + "panel_menu_word_filters":"Word Filters", + "panel_menu_themes":"Themes", + "panel_menu_events":"Events", + "panel_menu_statistics":"Statistics", + "panel_menu_statistics_posts":"Posts", + "panel_menu_statistics_topics":"Topics", + "panel_menu_statistics_forums":"Forums", + "panel_menu_statistics_routes":"Routes", + "panel_menu_statistics_agents":"Agents", + "panel_menu_statistics_systems":"Systems", + "panel_menu_statistics_languages":"Languages", + "panel_menu_statistics_referrers":"Referrers", + "panel_menu_reports":"Reports", + "panel_menu_logs":"Logs", + "panel_menu_logs_moderators":"Moderators", + "panel_menu_logs_administrators":"Administrators", + "panel_menu_system":"System", + "panel_menu_plugins":"Plugins", + "panel_menu_backups":"Backups", + "panel_menu_debug":"Debug", + + "panel_dashboard_head":"Dashboard", + + "panel_users_head":"Users", + "panel_users_profile":"Profile", + "panel_users_unban":"Unban", + "panel_users_ban":"Ban", + "panel_users_activate":"Activate", + + "panel_user_head":"User Editor", + "panel_user_name":"Name", + "panel_user_name_placeholder":"Jane Doe", + "panel_user_password":"Password", + "panel_user_email":"Email", + "panel_user_group":"Group", + "panel_user_update_button":"Update User", + + "panel_forums_head":"Forums", + "panel_forums_hidden":"Hidden", + "panel_forums_edit_button_tooltip":"Edit Forum", + "panel_forums_edit_button_aria":"Edit Forum", + "panel_forums_update_button":"Update", + "panel_forums_delete_button_tooltip":"Delete Forum", + "panel_forums_delete_button_aria":"Delete Forum", + "panel_forums_full_edit_button":"Full Edit", + "panel_forums_create_head":"Add Forum", + "panel_forums_create_name_label":"Name", + "panel_forums_create_name":"Super Secret Forum", + "panel_forums_create_description_label":"Description", + "panel_forums_create_description":"Where all the super secret stuff happens", + "panel_forums_active_label":"Active", + "panel_forums_preset_label":"Preset", + "panel_preset_everyone":"Everyone", + "panel_preset_announcements":"Announcements", + "panel_preset_member_only":"Member Only", + "panel_preset_staff_only":"Staff Only", + "panel_preset_admin_only":"Admin Only", + "panel_preset_archive":"Archive", + "panel_preset_custom":"Custom", + "panel_forums_create_button":"Add Forum", + + "panel_forum_head_suffix":" Forum", + "panel_forum_name":"Name", + "panel_forum_name_placeholder":"General Forum", + "panel_forum_description":"Description", + "panel_forum_description_placeholder":"Where the general stuff happens", + "panel_forum_active":"Active", + "panel_forum_preset":"Preset", + "panel_forum_update_button":"Update Forum", + "panel_forum_permissions_head":"Forum Permissions", + "panel_forum_edit_button":"Edit", + "panel_forum_short_update_button":"Update", + "panel_forum_full_edit_button":"Full Edit", + + "panel_groups_head":"Groups", + "panel_groups_rank_prefix":"Rank ", + "panel_groups_edit_group_button_aria":"Edit Group", + "panel_groups_create_head":"Create Group", + "panel_groups_create_name":"Name", + "panel_groups_create_name_placeholder":"Administrator", + "panel_groups_create_type":"Type", + "panel_groups_create_tag":"Tag", + "panel_groups_create_create_group_button":"Add Group", + + "panel_group_menu_head":"Group Editor", + "panel_group_menu_general":"General", + "panel_group_menu_promotions":"Promotions", + "panel_group_menu_permissions":"Permissions", + "panel_group_head_suffix":" Group", + "panel_group_name":"Name", + "panel_group_name_placeholder":"Random Group", + "panel_group_type":"Type", + "panel_group_tag":"Tag", + "panel_group_tag_placeholder":"VIP", + "panel_group_update_button":"Update Group", + + "panel_word_filters_head":"Word Filters", + "panel_word_filters_edit_button_aria":"Edit Word Filter", + "panel_word_filters_update_button":"Update", + "panel_word_filters_delete_button_aria":"Delete Word Filter", + "panel_word_filters_no_filters":"You don't have any word filters yet.", + "panel_word_filters_create_head":"Add Filter", + "panel_word_filters_create_find":"Find", + "panel_word_filters_create_find_placeholder":"fuck", + "panel_word_filters_create_replacement":"Replacement", + "panel_word_filters_create_replacement_placeholder":"fudge", + "panel_word_filters_create_create_word_filter_button":"Add Filter", + + "panel_statistics_views_head_suffix":" Views", + "panel_statistics_user_agents_head":"User Agents", + "panel_statistics_forums_head":"Forums", + "panel_statistics_languages_head":"Languages", + "panel_statistics_post_counts_head":"Post Counts", + "panel_statistics_referrers_head":"Referrers", + "panel_statistics_routes_head":"Routes", + "panel_statistics_operating_systems_head":"Operating Systems", + "panel_statistics_topic_counts_head":"Topic Counts", + "panel_statistics_requests_head":"Requests", + + "panel_statistics_time_range_one_month":"1 month", + "panel_statistics_time_range_one_week":"1 week", + "panel_statistics_time_range_two_days":"2 days", + "panel_statistics_time_range_one_day":"1 day", + "panel_statistics_time_range_twelve_hours":"12 hours", + "panel_statistics_time_range_six_hours":"6 hours", + + "panel_statistics_post_counts_chart_aria":"Post Chart", + "panel_statistics_topic_counts_chart_aria":"Topic Chart", + "panel_statistics_requests_chart_aria":"Requests Chart", + "panel_statistics_details_head":"Details", + "panel_statistics_post_counts_table_aria":"Post Table, this has the same information as the post chart", + "panel_statistics_topic_counts_table_aria":"Topic Table, this has the same information as the topic chart", + "panel_statistics_route_views_table_aria":"View Table, this has the same information as the view chart", + "panel_statistics_requests_table_aria":"View Table, this has the same information as the view chart", + "panel_statistics_views_suffix":" views", + "panel_statistics_posts_suffix":" posts", + "panel_statistics_topics_suffix":" topics", + + "panel_statistics_user_agents_no_user_agents":"No user agents could be found in the selected time range", + "panel_statistics_forums_no_forums":"No forum view counts could be found in the selected time range", + "panel_statistics_languages_no_languages":"No language could be found in the selected time range", + "panel_statistics_post_counts_no_post_counts":"No posts could be found in the selected time range", + "panel_statistics_referrers_no_referrers":"No referrers could be found in the selected time range", + "panel_statistics_routes_no_routes":"No route view counts could be found in the selected time range", + "panel_statistics_operating_systems_no_operating_systems":"No operating systems could be found in the selected time range", + + "panel_logs_menu_head":"Logs", + "panel_logs_menu_moderation":"Moderation Logs", + "panel_logs_menu_administration":"Administration Logs", + "panel_logs_moderation_head":"Moderation Logs", + "panel_logs_administration_head":"Administration Logs", + + "panel_plugins_head":"Plugins", + "panel_plugins_author_prefix":"Author: ", + "panel_plugins_settings":"Settings", + "panel_plugins_deactivate":"Deactivate", + "panel_plugins_activate":"Activate", + "panel_plugins_install":"Install", + + "panel_themes_primary_themes":"Primary Themes", + "panel_themes_variant_themes":"Variant Themes", + "panel_themes_author_prefix":"Author: ", + "panel_themes_mobile_friendly_tooltip":"Mobile Friendly", + "panel_themes_mobile_friendly_aria":"Mobile Friendly", + "panel_themes_default":"Default", + "panel_themes_make_default":"Make Default", + + "panel_settings_head":"Settings", + "panel_setting_head":"Edit Setting", + "panel_setting_name":"Setting Name", + "panel_setting_value":"Setting Value", + "panel_setting_update_button":"Update Setting", + + "panel_backups_head":"Backups", + "panel_backups_download":"Download", + "panel_backups_no_backups":"There aren't any backups available at this time.", + "panel_debug_head":"Debug", + "panel_debug_uptime_label":"Uptime", + "panel_debug_open_database_connections_label":"Open DB Conns", + "panel_debug_adapter_label":"Adapter" + }, + + "CSSPhrases": { + "pipe":"|", + + "menu_forums":"Forums", + "menu_topics":"Topics", + "menu_alerts":"Alerts", + "menu_account":"Account", + "menu_profile":"Profile", + "menu_panel":"Panel", + "menu_logout":"Logout", + "menu_login":"Login", + "menu_register":"Register", + + "topics_click_topics_to_select":"Click the topics to select them", + "topics_new_topic":"New Topic", + "forum_locked":"Locked", + "topics_replies_suffix":" replies", + "forums_topics_suffix":" topics", + "topics_gap_likes_suffix":" likes", + "topics_likes_suffix":"likes", + "topics_last":"Last", + "topics_starter":"Starter", + "topic_like_count_suffix":" likes", + "topic_plus":"+", + "topic_plus_one":"+1", + "topic_gap_up":" up", + "topic_level":"Level", + "topic_edit_button_text":"Edit", + "topic_delete_button_text":"Delete", + "topic_ip_button_text":"IP", + "topic_lock_button_text":"Lock", + "topic_unlock_button_text":"Unlock", + "topic_pin_button_text":"Pin", + "topic_unpin_button_text":"Unpin", + "topic_report_button_text":"Report", + "topic_flag_button_text":"Flag", + + "panel_rank_admins":"Admins", + "panel_rank_mods":"Mods", + "panel_rank_banned":"Banned", + "panel_rank_guests":"Guests", + "panel_rank_members":"Members", + + "panel_preset_announcements":"Announcements", + "panel_preset_member_only":"Member Only", + "panel_preset_staff_only":"Staff Only", + "panel_preset_admin_only":"Admin Only", + "panel_preset_archive":"Archive", + "panel_preset_public":"Public", + "panel_active_hidden":"Hidden", + + "panel_perms_no_access":"No Access", + "panel_perms_read_only":"Read Only", + "panel_perms_can_post":"Can Post", + "panel_perms_can_moderate":"Can Moderate", + "panel_perms_custom":"Custom", + "panel_perms_default":"Default", + + "panel_edit_button_text":"Edit", + "panel_delete_button_text":"Delete" } } \ No newline at end of file diff --git a/main.go b/main.go index 3e9b145e..5b036ba8 100644 --- a/main.go +++ b/main.go @@ -54,25 +54,34 @@ func afterDBInit() (err error) { } log.Print("Loading the static files.") + err = common.Themes.LoadStaticFiles() + if err != nil { + return err + } err = common.StaticFiles.Init() if err != nil { return err } + log.Print("Initialising the widgets") err = common.InitWidgets() if err != nil { return err } + log.Print("Initialising the authentication system") common.Auth, err = common.NewDefaultAuth() if err != nil { return err } + log.Print("Loading the word filters") err = common.LoadWordFilters() if err != nil { return err } + + log.Print("Initialising the stores") common.ModLogs, err = common.NewModLogStore() if err != nil { return err diff --git a/panel_routes.go b/panel_routes.go index c1f2d2bd..ebba603b 100644 --- a/panel_routes.go +++ b/panel_routes.go @@ -196,6 +196,15 @@ func routePanelForums(w http.ResponseWriter, r *http.Request, user common.User) forumList = append(forumList, fadmin) } } + + if r.FormValue("created") == "1" { + headerVars.NoticeList = append(headerVars.NoticeList, "The forum was successfully created") + } else if r.FormValue("deleted") == "1" { + headerVars.NoticeList = append(headerVars.NoticeList, "The forum was successfully deleted") + } else if r.FormValue("updated") == "1" { + headerVars.NoticeList = append(headerVars.NoticeList, "The forum was successfully updated") + } + pi := common.PanelPage{common.GetTitlePhrase("panel_forums"), user, headerVars, stats, "forums", forumList, nil} return panelRenderTemplate("panel_forums", w, r, user, &pi) } @@ -220,7 +229,7 @@ func routePanelForumsCreateSubmit(w http.ResponseWriter, r *http.Request, user c return common.InternalError(err, w, r) } - http.Redirect(w, r, "/panel/forums/", http.StatusSeeOther) + http.Redirect(w, r, "/panel/forums/?created=1", http.StatusSeeOther) return nil } @@ -282,7 +291,7 @@ func routePanelForumsDeleteSubmit(w http.ResponseWriter, r *http.Request, user c return common.InternalError(err, w, r) } - http.Redirect(w, r, "/panel/forums/", http.StatusSeeOther) + http.Redirect(w, r, "/panel/forums/?deleted=1", http.StatusSeeOther) return nil } @@ -325,6 +334,10 @@ func routePanelForumsEdit(w http.ResponseWriter, r *http.Request, user common.Us gplist = append(gplist, common.GroupForumPermPreset{group, common.ForumPermsToGroupForumPreset(group.Forums[fid])}) } + if r.FormValue("updated") == "1" { + headerVars.NoticeList = append(headerVars.NoticeList, "The forum was successfully updated") + } + pi := common.PanelEditForumPage{common.GetTitlePhrase("panel_edit_forum"), user, headerVars, stats, "forums", forum.ID, forum.Name, forum.Desc, forum.Active, forum.Preset, gplist} if common.RunPreRenderHook("pre_render_panel_edit_forum", w, r, &user, &pi) { return nil @@ -375,6 +388,7 @@ func routePanelForumsEditSubmit(w http.ResponseWriter, r *http.Request, user com if err != nil { return common.InternalErrorJSQ(err, w, r, isJs) } + // ? Should we redirect to the forum editor instead? return panelSuccessRedirect("/panel/forums/", w, r, isJs) } @@ -411,7 +425,7 @@ func routePanelForumsEditPermsSubmit(w http.ResponseWriter, r *http.Request, use return common.LocalErrorJSQ(err.Error(), w, r, user, isJs) } - return panelSuccessRedirect("/panel/forums/edit/"+strconv.Itoa(fid), w, r, isJs) + return panelSuccessRedirect("/panel/forums/edit/"+strconv.Itoa(fid)+"?updated=1", w, r, isJs) } // A helper function for the Advanced portion of the Forum Perms Editor @@ -486,6 +500,10 @@ func routePanelForumsEditPermsAdvance(w http.ResponseWriter, r *http.Request, us addNameLangToggle("CloseTopic", forumPerms.CloseTopic) addNameLangToggle("MoveTopic", forumPerms.MoveTopic) + if r.FormValue("updated") == "1" { + headerVars.NoticeList = append(headerVars.NoticeList, "The forum permissions were successfully updated") + } + pi := common.PanelEditForumGroupPage{common.GetTitlePhrase("panel_edit_forum"), user, headerVars, stats, "forums", forum.ID, gid, forum.Name, forum.Desc, forum.Active, forum.Preset, formattedPermList} if common.RunPreRenderHook("pre_render_panel_edit_forum", w, r, &user, &pi) { return nil @@ -550,7 +568,7 @@ func routePanelForumsEditPermsAdvanceSubmit(w http.ResponseWriter, r *http.Reque return common.LocalErrorJSQ(err.Error(), w, r, user, isJs) } - return panelSuccessRedirect("/panel/forums/edit/perms/"+strconv.Itoa(fid)+"-"+strconv.Itoa(gid), w, r, isJs) + return panelSuccessRedirect("/panel/forums/edit/perms/"+strconv.Itoa(fid)+"-"+strconv.Itoa(gid)+"?updated=1", w, r, isJs) } type AnalyticsTimeRange struct { diff --git a/template_error.go b/template_error.go index 98466405..0185e6b2 100644 --- a/template_error.go +++ b/template_error.go @@ -15,7 +15,29 @@ func init() { common.TmplPtrMap["error"] = &common.Template_error_handle common.TmplPtrMap["o_error"] = Template_error error_Tmpl_Phrase_ID = common.RegisterTmplPhraseNames([]string{ + "menu_forums_aria", + "menu_forums_tooltip", + "menu_topics_aria", + "menu_topics_tooltip", + "menu_alert_counter_aria", + "menu_alert_list_aria", + "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", + "footer_made_with_love", + "footer_theme_selector_aria", }) } @@ -63,16 +85,54 @@ w.Write(menu_0) w.Write(menu_1) w.Write([]byte(tmpl_error_vars.Header.Site.ShortName)) w.Write(menu_2) -if tmpl_error_vars.CurrentUser.Loggedin { +w.Write(phrases[0]) w.Write(menu_3) -w.Write([]byte(tmpl_error_vars.CurrentUser.Link)) +w.Write(phrases[1]) w.Write(menu_4) -w.Write([]byte(tmpl_error_vars.CurrentUser.Session)) +w.Write(phrases[2]) w.Write(menu_5) -} else { +w.Write(phrases[3]) w.Write(menu_6) -} +w.Write(phrases[4]) w.Write(menu_7) +w.Write(phrases[5]) +w.Write(menu_8) +if tmpl_error_vars.CurrentUser.Loggedin { +w.Write(menu_9) +w.Write(phrases[6]) +w.Write(menu_10) +w.Write(phrases[7]) +w.Write(menu_11) +w.Write([]byte(tmpl_error_vars.CurrentUser.Link)) +w.Write(menu_12) +w.Write(phrases[8]) +w.Write(menu_13) +w.Write(phrases[9]) +w.Write(menu_14) +w.Write(phrases[10]) +w.Write(menu_15) +w.Write(phrases[11]) +w.Write(menu_16) +w.Write([]byte(tmpl_error_vars.CurrentUser.Session)) +w.Write(menu_17) +w.Write(phrases[12]) +w.Write(menu_18) +w.Write(phrases[13]) +w.Write(menu_19) +} else { +w.Write(menu_20) +w.Write(phrases[14]) +w.Write(menu_21) +w.Write(phrases[15]) +w.Write(menu_22) +w.Write(phrases[16]) +w.Write(menu_23) +w.Write(phrases[17]) +w.Write(menu_24) +} +w.Write(menu_25) +w.Write(phrases[18]) +w.Write(menu_26) w.Write(header_17) if tmpl_error_vars.Header.Widgets.RightSidebar != "" { w.Write(header_18) @@ -85,31 +145,38 @@ w.Write([]byte(item)) w.Write(header_21) } } +w.Write(header_22) w.Write(error_0) -w.Write(phrases[0]) +w.Write(phrases[19]) w.Write(error_1) w.Write([]byte(tmpl_error_vars.Something.(string))) w.Write(error_2) w.Write(footer_0) w.Write([]byte(common.BuildWidget("footer",tmpl_error_vars.Header))) w.Write(footer_1) +w.Write(phrases[20]) +w.Write(footer_2) +w.Write(phrases[21]) +w.Write(footer_3) +w.Write(phrases[22]) +w.Write(footer_4) if len(tmpl_error_vars.Header.Themes) != 0 { for _, item := range tmpl_error_vars.Header.Themes { if !item.HideFromThemes { -w.Write(footer_2) -w.Write([]byte(item.Name)) -w.Write(footer_3) -if tmpl_error_vars.Header.Theme.Name == item.Name { -w.Write(footer_4) -} w.Write(footer_5) -w.Write([]byte(item.FriendlyName)) +w.Write([]byte(item.Name)) w.Write(footer_6) -} -} -} +if tmpl_error_vars.Header.Theme.Name == item.Name { w.Write(footer_7) -w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_error_vars.Header))) +} w.Write(footer_8) +w.Write([]byte(item.FriendlyName)) +w.Write(footer_9) +} +} +} +w.Write(footer_10) +w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_error_vars.Header))) +w.Write(footer_11) return nil } diff --git a/template_forum.go b/template_forum.go index bdb4a4a3..8f28b518 100644 --- a/template_forum.go +++ b/template_forum.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 "net/http" import "./common" +import "strconv" var forum_Tmpl_Phrase_ID int @@ -15,10 +15,68 @@ func init() { common.Ctemplates = append(common.Ctemplates,"forum") common.TmplPtrMap["forum"] = &common.Template_forum_handle common.TmplPtrMap["o_forum"] = Template_forum + forum_Tmpl_Phrase_ID = common.RegisterTmplPhraseNames([]string{ + "menu_forums_aria", + "menu_forums_tooltip", + "menu_topics_aria", + "menu_topics_tooltip", + "menu_alert_counter_aria", + "menu_alert_list_aria", + "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", + "paginator_next_page_aria", + "paginator_greater_than", + "topic_list_create_topic_tooltip", + "topic_list_create_topic_aria", + "topic_list_moderate_tooltip", + "topic_list_moderate_aria", + "forum_locked_tooltip", + "forum_locked_aria", + "topic_list_what_to_do", + "topic_list_moderate_delete", + "topic_list_moderate_lock", + "topic_list_moderate_move", + "topic_list_moderate_run", + "quick_topic_aria", + "quick_topic_avatar_alt", + "quick_topic_avatar_tooltip", + "quick_topic_whatsup", + "quick_topic_content_placeholder", + "quick_topic_create_topic_button", + "quick_topic_add_poll_button", + "quick_topic_add_file_button", + "quick_topic_cancel_button", + "forum_list_aria", + "status_closed_tooltip", + "status_pinned_tooltip", + "forum_no_topics", + "forum_start_one", + "paginator_prev_page_aria", + "paginator_prev_page", + "paginator_next_page_aria", + "paginator_next_page", + "footer_powered_by", + "footer_made_with_love", + "footer_theme_selector_aria", + }) } // nolint func Template_forum(tmpl_forum_vars common.ForumPage, w http.ResponseWriter) error { + var phrases = common.GetTmplPhrasesBytes(forum_Tmpl_Phrase_ID) w.Write(header_0) w.Write([]byte(tmpl_forum_vars.Title)) w.Write(header_1) @@ -60,16 +118,54 @@ w.Write(menu_0) w.Write(menu_1) w.Write([]byte(tmpl_forum_vars.Header.Site.ShortName)) w.Write(menu_2) -if tmpl_forum_vars.CurrentUser.Loggedin { +w.Write(phrases[0]) w.Write(menu_3) -w.Write([]byte(tmpl_forum_vars.CurrentUser.Link)) +w.Write(phrases[1]) w.Write(menu_4) -w.Write([]byte(tmpl_forum_vars.CurrentUser.Session)) +w.Write(phrases[2]) w.Write(menu_5) -} else { +w.Write(phrases[3]) w.Write(menu_6) -} +w.Write(phrases[4]) w.Write(menu_7) +w.Write(phrases[5]) +w.Write(menu_8) +if tmpl_forum_vars.CurrentUser.Loggedin { +w.Write(menu_9) +w.Write(phrases[6]) +w.Write(menu_10) +w.Write(phrases[7]) +w.Write(menu_11) +w.Write([]byte(tmpl_forum_vars.CurrentUser.Link)) +w.Write(menu_12) +w.Write(phrases[8]) +w.Write(menu_13) +w.Write(phrases[9]) +w.Write(menu_14) +w.Write(phrases[10]) +w.Write(menu_15) +w.Write(phrases[11]) +w.Write(menu_16) +w.Write([]byte(tmpl_forum_vars.CurrentUser.Session)) +w.Write(menu_17) +w.Write(phrases[12]) +w.Write(menu_18) +w.Write(phrases[13]) +w.Write(menu_19) +} else { +w.Write(menu_20) +w.Write(phrases[14]) +w.Write(menu_21) +w.Write(phrases[15]) +w.Write(menu_22) +w.Write(phrases[16]) +w.Write(menu_23) +w.Write(phrases[17]) +w.Write(menu_24) +} +w.Write(menu_25) +w.Write(phrases[18]) +w.Write(menu_26) w.Write(header_17) if tmpl_forum_vars.Header.Widgets.RightSidebar != "" { w.Write(header_18) @@ -82,176 +178,248 @@ w.Write([]byte(item)) w.Write(header_21) } } +w.Write(header_22) if tmpl_forum_vars.Page > 1 { w.Write(forum_0) -w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) +w.Write(phrases[19]) w.Write(forum_1) -w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page - 1))) +w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) w.Write(forum_2) +w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page - 1))) +w.Write(forum_3) +w.Write(phrases[20]) +w.Write(forum_4) } if tmpl_forum_vars.LastPage != tmpl_forum_vars.Page { -w.Write(forum_3) -w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) -w.Write(forum_4) -w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page + 1))) w.Write(forum_5) -} +w.Write(phrases[21]) w.Write(forum_6) -if tmpl_forum_vars.CurrentUser.ID != 0 { +w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) w.Write(forum_7) -} +w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page + 1))) w.Write(forum_8) -w.Write([]byte(tmpl_forum_vars.Title)) +w.Write(phrases[22]) w.Write(forum_9) -if tmpl_forum_vars.CurrentUser.ID != 0 { +} w.Write(forum_10) -if tmpl_forum_vars.CurrentUser.Perms.CreateTopic { -w.Write(forum_11) -w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) -w.Write(forum_12) -w.Write(forum_13) -} else { -w.Write(forum_14) -} -w.Write(forum_15) -} -w.Write(forum_16) if tmpl_forum_vars.CurrentUser.ID != 0 { -w.Write(forum_17) +w.Write(forum_11) +} +w.Write(forum_12) +w.Write([]byte(tmpl_forum_vars.Title)) +w.Write(forum_13) +if tmpl_forum_vars.CurrentUser.ID != 0 { +w.Write(forum_14) if tmpl_forum_vars.CurrentUser.Perms.CreateTopic { -w.Write(forum_18) -w.Write([]byte(tmpl_forum_vars.CurrentUser.Avatar)) -w.Write(forum_19) +w.Write(forum_15) +w.Write(phrases[23]) +w.Write(forum_16) +w.Write(phrases[24]) +w.Write(forum_17) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) +w.Write(forum_18) +w.Write(forum_19) +w.Write(phrases[25]) w.Write(forum_20) -if tmpl_forum_vars.CurrentUser.Perms.UploadFiles { +w.Write(phrases[26]) w.Write(forum_21) -} +} else { w.Write(forum_22) -} -} +w.Write(phrases[27]) w.Write(forum_23) +w.Write(phrases[28]) +w.Write(forum_24) +} +w.Write(forum_25) +} +w.Write(forum_26) +if tmpl_forum_vars.CurrentUser.ID != 0 { +w.Write(forum_27) +w.Write(phrases[29]) +w.Write(forum_28) +w.Write(phrases[30]) +w.Write(forum_29) +w.Write(phrases[31]) +w.Write(forum_30) +w.Write(phrases[32]) +w.Write(forum_31) +w.Write(phrases[33]) +w.Write(forum_32) +if tmpl_forum_vars.CurrentUser.Perms.CreateTopic { +w.Write(forum_33) +w.Write(phrases[34]) +w.Write(forum_34) +w.Write([]byte(tmpl_forum_vars.CurrentUser.Avatar)) +w.Write(forum_35) +w.Write(phrases[35]) +w.Write(forum_36) +w.Write(phrases[36]) +w.Write(forum_37) +w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) +w.Write(forum_38) +w.Write(phrases[37]) +w.Write(forum_39) +w.Write(phrases[38]) +w.Write(forum_40) +w.Write(phrases[39]) +w.Write(forum_41) +w.Write(phrases[40]) +w.Write(forum_42) +if tmpl_forum_vars.CurrentUser.Perms.UploadFiles { +w.Write(forum_43) +w.Write(phrases[41]) +w.Write(forum_44) +} +w.Write(forum_45) +w.Write(phrases[42]) +w.Write(forum_46) +} +} +w.Write(forum_47) +w.Write(phrases[43]) +w.Write(forum_48) if len(tmpl_forum_vars.ItemList) != 0 { for _, item := range tmpl_forum_vars.ItemList { -w.Write(forum_24) -w.Write([]byte(strconv.Itoa(item.ID))) -w.Write(forum_25) -if item.Sticky { -w.Write(forum_26) -} else { -if item.IsClosed { -w.Write(forum_27) -} -} -w.Write(forum_28) -w.Write([]byte(item.Creator.Link)) -w.Write(forum_29) -w.Write([]byte(item.Creator.Avatar)) -w.Write(forum_30) -w.Write([]byte(item.Creator.Name)) -w.Write(forum_31) -w.Write([]byte(item.Creator.Name)) -w.Write(forum_32) -w.Write([]byte(item.Link)) -w.Write(forum_33) -w.Write([]byte(item.Title)) -w.Write(forum_34) -w.Write([]byte(item.Creator.Link)) -w.Write(forum_35) -w.Write([]byte(item.Creator.Name)) -w.Write(forum_36) -if item.IsClosed { -w.Write(forum_37) -} -if item.Sticky { -w.Write(forum_38) -} -w.Write(forum_39) -w.Write([]byte(strconv.Itoa(item.PostCount))) -w.Write(forum_40) -w.Write([]byte(strconv.Itoa(item.LikeCount))) -w.Write(forum_41) -if item.Sticky { -w.Write(forum_42) -} else { -if item.IsClosed { -w.Write(forum_43) -} -} -w.Write(forum_44) -w.Write([]byte(item.LastUser.Link)) -w.Write(forum_45) -w.Write([]byte(item.LastUser.Avatar)) -w.Write(forum_46) -w.Write([]byte(item.LastUser.Name)) -w.Write(forum_47) -w.Write([]byte(item.LastUser.Name)) -w.Write(forum_48) -w.Write([]byte(item.LastUser.Link)) w.Write(forum_49) -w.Write([]byte(item.LastUser.Name)) +w.Write([]byte(strconv.Itoa(item.ID))) w.Write(forum_50) -w.Write([]byte(item.RelativeLastReplyAt)) +if item.Sticky { w.Write(forum_51) +} else { +if item.IsClosed { +w.Write(forum_52) +} +} +w.Write(forum_53) +w.Write([]byte(item.Creator.Link)) +w.Write(forum_54) +w.Write([]byte(item.Creator.Avatar)) +w.Write(forum_55) +w.Write([]byte(item.Creator.Name)) +w.Write(forum_56) +w.Write([]byte(item.Creator.Name)) +w.Write(forum_57) +w.Write([]byte(item.Link)) +w.Write(forum_58) +w.Write([]byte(item.Title)) +w.Write(forum_59) +w.Write([]byte(item.Creator.Link)) +w.Write(forum_60) +w.Write([]byte(item.Creator.Name)) +w.Write(forum_61) +if item.IsClosed { +w.Write(forum_62) +w.Write(phrases[44]) +w.Write(forum_63) +} +if item.Sticky { +w.Write(forum_64) +w.Write(phrases[45]) +w.Write(forum_65) +} +w.Write(forum_66) +w.Write([]byte(strconv.Itoa(item.PostCount))) +w.Write(forum_67) +w.Write([]byte(strconv.Itoa(item.LikeCount))) +w.Write(forum_68) +if item.Sticky { +w.Write(forum_69) +} else { +if item.IsClosed { +w.Write(forum_70) +} +} +w.Write(forum_71) +w.Write([]byte(item.LastUser.Link)) +w.Write(forum_72) +w.Write([]byte(item.LastUser.Avatar)) +w.Write(forum_73) +w.Write([]byte(item.LastUser.Name)) +w.Write(forum_74) +w.Write([]byte(item.LastUser.Name)) +w.Write(forum_75) +w.Write([]byte(item.LastUser.Link)) +w.Write(forum_76) +w.Write([]byte(item.LastUser.Name)) +w.Write(forum_77) +w.Write([]byte(item.RelativeLastReplyAt)) +w.Write(forum_78) } } else { -w.Write(forum_52) +w.Write(forum_79) +w.Write(phrases[46]) if tmpl_forum_vars.CurrentUser.Perms.CreateTopic { -w.Write(forum_53) +w.Write(forum_80) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Forum.ID))) -w.Write(forum_54) +w.Write(forum_81) +w.Write(phrases[47]) +w.Write(forum_82) } -w.Write(forum_55) +w.Write(forum_83) } -w.Write(forum_56) +w.Write(forum_84) if tmpl_forum_vars.LastPage > 1 { -w.Write(forum_57) +w.Write(paginator_0) if tmpl_forum_vars.Page > 1 { -w.Write(forum_58) +w.Write(paginator_1) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page - 1))) -w.Write(forum_59) +w.Write(paginator_2) +w.Write(phrases[48]) +w.Write(paginator_3) +w.Write(phrases[49]) +w.Write(paginator_4) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page - 1))) -w.Write(forum_60) +w.Write(paginator_5) } if len(tmpl_forum_vars.PageList) != 0 { for _, item := range tmpl_forum_vars.PageList { -w.Write(forum_61) +w.Write(paginator_6) w.Write([]byte(strconv.Itoa(item))) -w.Write(forum_62) +w.Write(paginator_7) w.Write([]byte(strconv.Itoa(item))) -w.Write(forum_63) +w.Write(paginator_8) } } if tmpl_forum_vars.LastPage != tmpl_forum_vars.Page { -w.Write(forum_64) +w.Write(paginator_9) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page + 1))) -w.Write(forum_65) +w.Write(paginator_10) w.Write([]byte(strconv.Itoa(tmpl_forum_vars.Page + 1))) -w.Write(forum_66) +w.Write(paginator_11) +w.Write(phrases[50]) +w.Write(paginator_12) +w.Write(phrases[51]) +w.Write(paginator_13) } -w.Write(forum_67) +w.Write(paginator_14) } -w.Write(forum_68) +w.Write(forum_85) w.Write(footer_0) w.Write([]byte(common.BuildWidget("footer",tmpl_forum_vars.Header))) w.Write(footer_1) +w.Write(phrases[52]) +w.Write(footer_2) +w.Write(phrases[53]) +w.Write(footer_3) +w.Write(phrases[54]) +w.Write(footer_4) if len(tmpl_forum_vars.Header.Themes) != 0 { for _, item := range tmpl_forum_vars.Header.Themes { if !item.HideFromThemes { -w.Write(footer_2) -w.Write([]byte(item.Name)) -w.Write(footer_3) -if tmpl_forum_vars.Header.Theme.Name == item.Name { -w.Write(footer_4) -} w.Write(footer_5) -w.Write([]byte(item.FriendlyName)) +w.Write([]byte(item.Name)) w.Write(footer_6) -} -} -} +if tmpl_forum_vars.Header.Theme.Name == item.Name { w.Write(footer_7) -w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_forum_vars.Header))) +} w.Write(footer_8) +w.Write([]byte(item.FriendlyName)) +w.Write(footer_9) +} +} +} +w.Write(footer_10) +w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_forum_vars.Header))) +w.Write(footer_11) return nil } diff --git a/template_forums.go b/template_forums.go index 316125a1..01dbf7f3 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 "./common" import "net/http" +import "./common" var forums_Tmpl_Phrase_ID int @@ -14,10 +14,39 @@ func init() { common.Ctemplates = append(common.Ctemplates,"forums") common.TmplPtrMap["forums"] = &common.Template_forums_handle common.TmplPtrMap["o_forums"] = Template_forums + forums_Tmpl_Phrase_ID = common.RegisterTmplPhraseNames([]string{ + "menu_forums_aria", + "menu_forums_tooltip", + "menu_topics_aria", + "menu_topics_tooltip", + "menu_alert_counter_aria", + "menu_alert_list_aria", + "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", + "forums_none", + "forums_no_forums", + "footer_powered_by", + "footer_made_with_love", + "footer_theme_selector_aria", + }) } // nolint func Template_forums(tmpl_forums_vars common.ForumsPage, w http.ResponseWriter) error { + var phrases = common.GetTmplPhrasesBytes(forums_Tmpl_Phrase_ID) w.Write(header_0) w.Write([]byte(tmpl_forums_vars.Title)) w.Write(header_1) @@ -59,16 +88,54 @@ w.Write(menu_0) w.Write(menu_1) w.Write([]byte(tmpl_forums_vars.Header.Site.ShortName)) w.Write(menu_2) -if tmpl_forums_vars.CurrentUser.Loggedin { +w.Write(phrases[0]) w.Write(menu_3) -w.Write([]byte(tmpl_forums_vars.CurrentUser.Link)) +w.Write(phrases[1]) w.Write(menu_4) -w.Write([]byte(tmpl_forums_vars.CurrentUser.Session)) +w.Write(phrases[2]) w.Write(menu_5) -} else { +w.Write(phrases[3]) w.Write(menu_6) -} +w.Write(phrases[4]) w.Write(menu_7) +w.Write(phrases[5]) +w.Write(menu_8) +if tmpl_forums_vars.CurrentUser.Loggedin { +w.Write(menu_9) +w.Write(phrases[6]) +w.Write(menu_10) +w.Write(phrases[7]) +w.Write(menu_11) +w.Write([]byte(tmpl_forums_vars.CurrentUser.Link)) +w.Write(menu_12) +w.Write(phrases[8]) +w.Write(menu_13) +w.Write(phrases[9]) +w.Write(menu_14) +w.Write(phrases[10]) +w.Write(menu_15) +w.Write(phrases[11]) +w.Write(menu_16) +w.Write([]byte(tmpl_forums_vars.CurrentUser.Session)) +w.Write(menu_17) +w.Write(phrases[12]) +w.Write(menu_18) +w.Write(phrases[13]) +w.Write(menu_19) +} else { +w.Write(menu_20) +w.Write(phrases[14]) +w.Write(menu_21) +w.Write(phrases[15]) +w.Write(menu_22) +w.Write(phrases[16]) +w.Write(menu_23) +w.Write(phrases[17]) +w.Write(menu_24) +} +w.Write(menu_25) +w.Write(phrases[18]) +w.Write(menu_26) w.Write(header_17) if tmpl_forums_vars.Header.Widgets.RightSidebar != "" { w.Write(header_18) @@ -81,75 +148,88 @@ w.Write([]byte(item)) w.Write(header_21) } } +w.Write(header_22) w.Write(forums_0) +w.Write(phrases[19]) +w.Write(forums_1) if len(tmpl_forums_vars.ItemList) != 0 { for _, item := range tmpl_forums_vars.ItemList { -w.Write(forums_1) -if item.Desc != "" || item.LastTopic.Title != "" { w.Write(forums_2) -} +if item.Desc != "" || item.LastTopic.Title != "" { w.Write(forums_3) -w.Write([]byte(item.Link)) +} w.Write(forums_4) -w.Write([]byte(item.Name)) +w.Write([]byte(item.Link)) w.Write(forums_5) -if item.Desc != "" { +w.Write([]byte(item.Name)) w.Write(forums_6) -w.Write([]byte(item.Desc)) +if item.Desc != "" { w.Write(forums_7) -} else { +w.Write([]byte(item.Desc)) w.Write(forums_8) -} +} else { w.Write(forums_9) -if item.LastReplyer.Avatar != "" { +w.Write(phrases[20]) w.Write(forums_10) -w.Write([]byte(item.LastReplyer.Avatar)) -w.Write(forums_11) -w.Write([]byte(item.LastReplyer.Name)) -w.Write(forums_12) -w.Write([]byte(item.LastReplyer.Name)) -w.Write(forums_13) } +w.Write(forums_11) +if item.LastReplyer.Avatar != "" { +w.Write(forums_12) +w.Write([]byte(item.LastReplyer.Avatar)) +w.Write(forums_13) +w.Write([]byte(item.LastReplyer.Name)) w.Write(forums_14) -w.Write([]byte(item.LastTopic.Link)) +w.Write([]byte(item.LastReplyer.Name)) w.Write(forums_15) +} +w.Write(forums_16) +w.Write([]byte(item.LastTopic.Link)) +w.Write(forums_17) if item.LastTopic.Title != "" { w.Write([]byte(item.LastTopic.Title)) } else { -w.Write(forums_16) +w.Write(phrases[21]) } -w.Write(forums_17) -if item.LastTopicTime != "" { w.Write(forums_18) -w.Write([]byte(item.LastTopicTime)) +if item.LastTopicTime != "" { w.Write(forums_19) -} +w.Write([]byte(item.LastTopicTime)) w.Write(forums_20) } -} else { w.Write(forums_21) } +} else { w.Write(forums_22) +w.Write(phrases[22]) +w.Write(forums_23) +} +w.Write(forums_24) w.Write(footer_0) w.Write([]byte(common.BuildWidget("footer",tmpl_forums_vars.Header))) w.Write(footer_1) +w.Write(phrases[23]) +w.Write(footer_2) +w.Write(phrases[24]) +w.Write(footer_3) +w.Write(phrases[25]) +w.Write(footer_4) if len(tmpl_forums_vars.Header.Themes) != 0 { for _, item := range tmpl_forums_vars.Header.Themes { if !item.HideFromThemes { -w.Write(footer_2) -w.Write([]byte(item.Name)) -w.Write(footer_3) -if tmpl_forums_vars.Header.Theme.Name == item.Name { -w.Write(footer_4) -} w.Write(footer_5) -w.Write([]byte(item.FriendlyName)) +w.Write([]byte(item.Name)) w.Write(footer_6) -} -} -} +if tmpl_forums_vars.Header.Theme.Name == item.Name { w.Write(footer_7) -w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_forums_vars.Header))) +} w.Write(footer_8) +w.Write([]byte(item.FriendlyName)) +w.Write(footer_9) +} +} +} +w.Write(footer_10) +w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_forums_vars.Header))) +w.Write(footer_11) return nil } diff --git a/template_guilds_guild_list.go b/template_guilds_guild_list.go index ace970c1..6e7964bd 100644 --- a/template_guilds_guild_list.go +++ b/template_guilds_guild_list.go @@ -3,20 +3,45 @@ // 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 "./common" import "./extend/guilds/lib" import "strconv" import "net/http" +import "./common" var guilds_guild_list_Tmpl_Phrase_ID int // nolint func init() { common.TmplPtrMap["o_guilds_guild_list"] = Template_guilds_guild_list + guilds_guild_list_Tmpl_Phrase_ID = common.RegisterTmplPhraseNames([]string{ + "menu_forums_aria", + "menu_forums_tooltip", + "menu_topics_aria", + "menu_topics_tooltip", + "menu_alert_counter_aria", + "menu_alert_list_aria", + "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", + "footer_theme_selector_aria", + }) } // nolint func Template_guilds_guild_list(tmpl_guilds_guild_list_vars guilds.ListPage, w http.ResponseWriter) error { + var phrases = common.GetTmplPhrasesBytes(guilds_guild_list_Tmpl_Phrase_ID) w.Write(header_0) w.Write([]byte(tmpl_guilds_guild_list_vars.Title)) w.Write(header_1) @@ -58,16 +83,54 @@ w.Write(menu_0) w.Write(menu_1) w.Write([]byte(tmpl_guilds_guild_list_vars.Header.Site.ShortName)) w.Write(menu_2) -if tmpl_guilds_guild_list_vars.CurrentUser.Loggedin { +w.Write(phrases[0]) w.Write(menu_3) -w.Write([]byte(tmpl_guilds_guild_list_vars.CurrentUser.Link)) +w.Write(phrases[1]) w.Write(menu_4) -w.Write([]byte(tmpl_guilds_guild_list_vars.CurrentUser.Session)) +w.Write(phrases[2]) w.Write(menu_5) -} else { +w.Write(phrases[3]) w.Write(menu_6) -} +w.Write(phrases[4]) w.Write(menu_7) +w.Write(phrases[5]) +w.Write(menu_8) +if tmpl_guilds_guild_list_vars.CurrentUser.Loggedin { +w.Write(menu_9) +w.Write(phrases[6]) +w.Write(menu_10) +w.Write(phrases[7]) +w.Write(menu_11) +w.Write([]byte(tmpl_guilds_guild_list_vars.CurrentUser.Link)) +w.Write(menu_12) +w.Write(phrases[8]) +w.Write(menu_13) +w.Write(phrases[9]) +w.Write(menu_14) +w.Write(phrases[10]) +w.Write(menu_15) +w.Write(phrases[11]) +w.Write(menu_16) +w.Write([]byte(tmpl_guilds_guild_list_vars.CurrentUser.Session)) +w.Write(menu_17) +w.Write(phrases[12]) +w.Write(menu_18) +w.Write(phrases[13]) +w.Write(menu_19) +} else { +w.Write(menu_20) +w.Write(phrases[14]) +w.Write(menu_21) +w.Write(phrases[15]) +w.Write(menu_22) +w.Write(phrases[16]) +w.Write(menu_23) +w.Write(phrases[17]) +w.Write(menu_24) +} +w.Write(menu_25) +w.Write(phrases[18]) +w.Write(menu_26) w.Write(header_17) if tmpl_guilds_guild_list_vars.Header.Widgets.RightSidebar != "" { w.Write(header_18) @@ -80,6 +143,7 @@ w.Write([]byte(item)) w.Write(header_21) } } +w.Write(header_22) w.Write(guilds_guild_list_0) if len(tmpl_guilds_guild_list_vars.GuildList) != 0 { for _, item := range tmpl_guilds_guild_list_vars.GuildList { @@ -102,23 +166,29 @@ w.Write(guilds_guild_list_8) w.Write(footer_0) w.Write([]byte(common.BuildWidget("footer",tmpl_guilds_guild_list_vars.Header))) w.Write(footer_1) +w.Write(phrases[19]) +w.Write(footer_2) +w.Write(phrases[20]) +w.Write(footer_3) +w.Write(phrases[21]) +w.Write(footer_4) if len(tmpl_guilds_guild_list_vars.Header.Themes) != 0 { for _, item := range tmpl_guilds_guild_list_vars.Header.Themes { if !item.HideFromThemes { -w.Write(footer_2) -w.Write([]byte(item.Name)) -w.Write(footer_3) -if tmpl_guilds_guild_list_vars.Header.Theme.Name == item.Name { -w.Write(footer_4) -} w.Write(footer_5) -w.Write([]byte(item.FriendlyName)) +w.Write([]byte(item.Name)) w.Write(footer_6) -} -} -} +if tmpl_guilds_guild_list_vars.Header.Theme.Name == item.Name { w.Write(footer_7) -w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_guilds_guild_list_vars.Header))) +} w.Write(footer_8) +w.Write([]byte(item.FriendlyName)) +w.Write(footer_9) +} +} +} +w.Write(footer_10) +w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_guilds_guild_list_vars.Header))) +w.Write(footer_11) return nil } diff --git a/template_ip_search.go b/template_ip_search.go index 18200f33..5fc1ab9f 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 "net/http" import "./common" +import "net/http" var ip_search_Tmpl_Phrase_ID int @@ -15,8 +15,31 @@ 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_forums_aria", + "menu_forums_tooltip", + "menu_topics_aria", + "menu_topics_tooltip", + "menu_alert_counter_aria", + "menu_alert_list_aria", + "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", "ip_search_no_users", + "footer_powered_by", + "footer_made_with_love", + "footer_theme_selector_aria", }) } @@ -64,16 +87,54 @@ w.Write(menu_0) w.Write(menu_1) w.Write([]byte(tmpl_ip_search_vars.Header.Site.ShortName)) w.Write(menu_2) -if tmpl_ip_search_vars.CurrentUser.Loggedin { +w.Write(phrases[0]) w.Write(menu_3) -w.Write([]byte(tmpl_ip_search_vars.CurrentUser.Link)) +w.Write(phrases[1]) w.Write(menu_4) -w.Write([]byte(tmpl_ip_search_vars.CurrentUser.Session)) +w.Write(phrases[2]) w.Write(menu_5) -} else { +w.Write(phrases[3]) w.Write(menu_6) -} +w.Write(phrases[4]) w.Write(menu_7) +w.Write(phrases[5]) +w.Write(menu_8) +if tmpl_ip_search_vars.CurrentUser.Loggedin { +w.Write(menu_9) +w.Write(phrases[6]) +w.Write(menu_10) +w.Write(phrases[7]) +w.Write(menu_11) +w.Write([]byte(tmpl_ip_search_vars.CurrentUser.Link)) +w.Write(menu_12) +w.Write(phrases[8]) +w.Write(menu_13) +w.Write(phrases[9]) +w.Write(menu_14) +w.Write(phrases[10]) +w.Write(menu_15) +w.Write(phrases[11]) +w.Write(menu_16) +w.Write([]byte(tmpl_ip_search_vars.CurrentUser.Session)) +w.Write(menu_17) +w.Write(phrases[12]) +w.Write(menu_18) +w.Write(phrases[13]) +w.Write(menu_19) +} else { +w.Write(menu_20) +w.Write(phrases[14]) +w.Write(menu_21) +w.Write(phrases[15]) +w.Write(menu_22) +w.Write(phrases[16]) +w.Write(menu_23) +w.Write(phrases[17]) +w.Write(menu_24) +} +w.Write(menu_25) +w.Write(phrases[18]) +w.Write(menu_26) w.Write(header_17) if tmpl_ip_search_vars.Header.Widgets.RightSidebar != "" { w.Write(header_18) @@ -86,8 +147,9 @@ w.Write([]byte(item)) w.Write(header_21) } } +w.Write(header_22) w.Write(ip_search_0) -w.Write(phrases[0]) +w.Write(phrases[19]) w.Write(ip_search_1) if tmpl_ip_search_vars.IP != "" { w.Write(ip_search_2) @@ -95,51 +157,59 @@ w.Write([]byte(tmpl_ip_search_vars.IP)) w.Write(ip_search_3) } w.Write(ip_search_4) -if tmpl_ip_search_vars.IP != "" { +w.Write(phrases[20]) w.Write(ip_search_5) +if tmpl_ip_search_vars.IP != "" { +w.Write(ip_search_6) if len(tmpl_ip_search_vars.ItemList) != 0 { for _, item := range tmpl_ip_search_vars.ItemList { -w.Write(ip_search_6) -w.Write([]byte(item.Avatar)) w.Write(ip_search_7) w.Write([]byte(item.Avatar)) w.Write(ip_search_8) -w.Write([]byte(item.Name)) +w.Write([]byte(item.Avatar)) w.Write(ip_search_9) -w.Write([]byte(item.Link)) -w.Write(ip_search_10) w.Write([]byte(item.Name)) +w.Write(ip_search_10) +w.Write([]byte(item.Link)) w.Write(ip_search_11) +w.Write([]byte(item.Name)) +w.Write(ip_search_12) } } else { -w.Write(ip_search_12) -w.Write(phrases[1]) w.Write(ip_search_13) -} - +w.Write(phrases[21]) w.Write(ip_search_14) } + w.Write(ip_search_15) +} +w.Write(ip_search_16) w.Write(footer_0) w.Write([]byte(common.BuildWidget("footer",tmpl_ip_search_vars.Header))) w.Write(footer_1) +w.Write(phrases[22]) +w.Write(footer_2) +w.Write(phrases[23]) +w.Write(footer_3) +w.Write(phrases[24]) +w.Write(footer_4) if len(tmpl_ip_search_vars.Header.Themes) != 0 { for _, item := range tmpl_ip_search_vars.Header.Themes { if !item.HideFromThemes { -w.Write(footer_2) -w.Write([]byte(item.Name)) -w.Write(footer_3) -if tmpl_ip_search_vars.Header.Theme.Name == item.Name { -w.Write(footer_4) -} w.Write(footer_5) -w.Write([]byte(item.FriendlyName)) +w.Write([]byte(item.Name)) w.Write(footer_6) -} -} -} +if tmpl_ip_search_vars.Header.Theme.Name == item.Name { w.Write(footer_7) -w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_ip_search_vars.Header))) +} w.Write(footer_8) +w.Write([]byte(item.FriendlyName)) +w.Write(footer_9) +} +} +} +w.Write(footer_10) +w.Write([]byte(common.BuildWidget("rightSidebar",tmpl_ip_search_vars.Header))) +w.Write(footer_11) return nil } diff --git a/template_list.go b/template_list.go index 1bdf94ac..2c936c75 100644 --- a/template_list.go +++ b/template_list.go @@ -49,29 +49,48 @@ var menu_0 = []byte(`