diff --git a/README.md b/README.md index 8d6a10fe..932d7bbb 100644 --- a/README.md +++ b/README.md @@ -128,12 +128,16 @@ go get -u gopkg.in/sourcemap.v1 go get -u github.com/robertkrimen/otto +go get -u github.com/esimov/caire + go get -u github.com/lib/pq go get -u github.com/denisenkom/go-mssqldb go get -u github.com/fsnotify/fsnotify +go get -u github.com/pkg/errors + rm -f template_*.go rm -f gen_*.go @@ -247,8 +251,12 @@ A few of these like Rez aren't currently in use, but are things we think we'll n * github.com/bamiaux/rez An image resizer (e.g. for spitting out thumbnails) + * github.com/esimov/caire The other image resizer, slower but may be useful for covering cases Rez does not. A third faster one we might point to at some point is probably Discord's Lilliput, however it requires a C Compiler and we don't want to add that as a dependency at this time. + * github.com/fsnotify/fsnotify A library for watching events on the file system. +* github.com/pkg/errors Some helpers to make it easier for us to track down bugs. + * More items to come here, our dependencies are going through a lot of changes, and I'll be documenting those soon ;) # Bundled Plugins diff --git a/common/auth.go b/common/auth.go index bedda08b..1457326d 100644 --- a/common/auth.go +++ b/common/auth.go @@ -56,6 +56,7 @@ var GeneratePasswordFuncs = map[string]func(string) (string, string, error){ //"argon2": Argon2GeneratePassword, } +// TODO: Redirect 2b to bcrypt too? var HashPrefixes = map[string]string{ "$2a$": "bcrypt", //"argon2$": "argon2", diff --git a/common/errors.go b/common/errors.go index 7fcefa53..a6b795f4 100644 --- a/common/errors.go +++ b/common/errors.go @@ -67,17 +67,21 @@ func HandledRouteError() RouteError { } // LogError logs internal handler errors which can't be handled with InternalError() as a wrapper for log.Fatal(), we might do more with it in the future. -func LogError(err error) { - LogWarning(err) +// TODO: Clean-up extra as a way of passing additional context +func LogError(err error, extra ...string) { + LogWarning(err, extra...) log.Fatal("") } -func LogWarning(err error) { +func LogWarning(err error, extra ...string) { var errmsg string + for _, extraBit := range extra { + errmsg += extraBit + "\n" + } if err == nil { - errmsg = "Unknown error" + errmsg += "Unknown error" } else { - errmsg = err.Error() + errmsg += err.Error() } stack := debug.Stack() log.Print(errmsg+"\n", string(stack)) diff --git a/common/template_init.go b/common/template_init.go index f18eb4e0..2c1df3d6 100644 --- a/common/template_init.go +++ b/common/template_init.go @@ -498,6 +498,15 @@ func InitTemplates() error { return "" } + fmap["dyntmpl"] = func(nameInt interface{}, pageInt interface{}, headerInt interface{}) interface{} { + header := headerInt.(*Header) + err := RunThemeTemplate(header.Theme.Name, nameInt.(string), pageInt, header.Writer) + if err != nil { + return err + } + return "" + } + // The interpreted templates... DebugLog("Loading the template files...") Templates.Funcs(fmap) diff --git a/common/templates/templates.go b/common/templates/templates.go index 913d27c2..362a05f2 100644 --- a/common/templates/templates.go +++ b/common/templates/templates.go @@ -718,6 +718,9 @@ ArgLoop: case "scope": literal = true break ArgLoop + case "dyntmpl": + literal = true + break ArgLoop default: c.detail("Variable!") if len(node.Args) > (pos + 1) { diff --git a/dev-update-linux b/dev-update-linux index d41a57f6..6e0f68c0 100644 --- a/dev-update-linux +++ b/dev-update-linux @@ -28,6 +28,12 @@ go get -u github.com/robertkrimen/otto echo "Updating the Rez Image Resizer" go get -u github.com/bamiaux/rez +echo "Updating Caire" +go get -u github.com/esimov/caire + +echo "Updating some error helpers" +go get -u github.com/pkg/errors + echo "Updating fsnotify" go get -u github.com/fsnotify/fsnotify diff --git a/dev-update.bat b/dev-update.bat index d0429d91..b27805ae 100644 --- a/dev-update.bat +++ b/dev-update.bat @@ -85,6 +85,20 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Updating Caire +go get -u github.com/esimov/caire +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Updating some error helpers +go get -u github.com/pkg/errors +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + echo Updating fsnotify go get -u github.com/fsnotify/fsnotify if %errorlevel% neq 0 ( diff --git a/docs/templates.md b/docs/templates.md index 70400ccb..f0095c4f 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -1,7 +1,11 @@ # Templates -Gosora uses a subset of [Go Templates](https://golang.org/pkg/text/template/) which are run on both the server side and client side with custom transpiler to wring out the most performance. Some more obscure features may not be available, although I am adding them in here and there. +Gosora uses a subset of [Go Templates](https://golang.org/pkg/text/template/) which are run on both the server side and client side with custom transpiler to wring out the most performance. Some more obscure features may not be available (e.g. local variables), but I am adding them in here and there. The base templates are stored in `/templates/` and you can shadow them by placing modified duplicates in `/templates/overrides/`. The default themes all share the same set of templates present there. +# Non-standard Extensions + +We also have a few non-standard extensions only available on certain pages or areas, but these shouldn't be relied on in favour of more general mechanisms. + More to come soon. \ No newline at end of file diff --git a/experimental/new-update.bat b/experimental/new-update.bat index 833cd0aa..6814804e 100644 --- a/experimental/new-update.bat +++ b/experimental/new-update.bat @@ -85,6 +85,20 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Updating Caire +go get -u github.com/esimov/caire +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Updating some error helpers +go get -u github.com/pkg/errors +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + echo Updating fsnotify go get -u github.com/fsnotify/fsnotify if %errorlevel% neq 0 ( diff --git a/gen_router.go b/gen_router.go index f44292f2..6c8c356b 100644 --- a/gen_router.go +++ b/gen_router.go @@ -1,4 +1,4 @@ -// Code generated by. DO NOT EDIT. +// Code generated by Gosora's Router Generator. DO NOT EDIT. /* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */ package main diff --git a/install-linux b/install-linux index d1541cf7..d26ffba7 100644 --- a/install-linux +++ b/install-linux @@ -28,6 +28,12 @@ go get -u github.com/robertkrimen/otto echo "Installing the Rez Image Resizer" go get -u github.com/bamiaux/rez +echo "Installing Caire" +go get -u github.com/esimov/caire + +echo "Installing some error helpers" +go get -u github.com/pkg/errors + echo "Installing fsnotify" go get -u github.com/fsnotify/fsnotify diff --git a/install.bat b/install.bat index 55a961a2..3bb0b136 100644 --- a/install.bat +++ b/install.bat @@ -85,6 +85,20 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Installing Caire +go get -u github.com/esimov/caire +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Installing some error helpers +go get -u github.com/pkg/errors +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + echo Installing fsnotify go get -u github.com/fsnotify/fsnotify if %errorlevel% neq 0 ( diff --git a/langs/english.json b/langs/english.json index 2ddd2a69..716490de 100644 --- a/langs/english.json +++ b/langs/english.json @@ -46,10 +46,11 @@ "SettingPhrases": { "activation_type":"Activation Type", - "activation_type_label": "Activate All,Email Activation,Admin Approval", + "activation_type_label": "Activate All,Email Activation,Staff Approval", "bigpost_min_words":"Big Post Minimum Words", "megapost_min_words":"Mega Post Minimum Words", - "meta_desc":"Meta Description" + "meta_desc":"Meta Description", + "rapid_loading":"Rapid Loaded?" }, "PermPresets": { @@ -571,6 +572,8 @@ "panel_menu_settings":"Settings", "panel_menu_word_filters":"Word Filters", "panel_menu_themes":"Themes", + "panel_menu_menus":"Menus", + "panel_menu_widgets":"Widgets", "panel_menu_events":"Events", "panel_menu_statistics":"Statistics", "panel_menu_statistics_posts":"Posts", @@ -658,6 +661,7 @@ "panel_group_tag":"Tag", "panel_group_tag_placeholder":"VIP", "panel_group_update_button":"Update Group", + "panel_group_extended_permissions":"Extended Permissions", "panel_word_filters_head":"Word Filters", "panel_word_filters_edit_button_aria":"Edit Word Filter", diff --git a/main.go b/main.go index 66c9ae20..6c2c9868 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,7 @@ import ( "./query_gen/lib" "./routes" "github.com/fsnotify/fsnotify" + "github.com/pkg/errors" ) var version = common.Version{Major: 0, Minor: 1, Patch: 0, Tag: "dev"} @@ -37,55 +38,57 @@ type Globs struct { stmts *Stmts } +// Experimenting with a new error package here to try to reduce the amount of debugging we have to do +// TODO: Dynamically register these items to avoid maintaining as much code here? func afterDBInit() (err error) { acc := qgen.Builder.Accumulator() common.Rstore, err = common.NewSQLReplyStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.Prstore, err = common.NewSQLProfileReplyStore(acc) if err != nil { - return err + return errors.WithStack(err) } err = common.InitTemplates() if err != nil { - return err + return errors.WithStack(err) } err = common.InitPhrases() if err != nil { - return err + return errors.WithStack(err) } log.Print("Loading the static files.") err = common.Themes.LoadStaticFiles() if err != nil { - return err + return errors.WithStack(err) } err = common.StaticFiles.Init() if err != nil { - return err + return errors.WithStack(err) } err = common.StaticFiles.JSTmplInit() if err != nil { - return err + return errors.WithStack(err) } log.Print("Initialising the widgets") err = common.InitWidgets() if err != nil { - return err + return errors.WithStack(err) } log.Print("Initialising the menu item list") common.Menus = common.NewDefaultMenuStore() err = common.Menus.Load(1) // 1 = the default menu if err != nil { - return err + return errors.WithStack(err) } menuHold, err := common.Menus.Get(1) if err != nil { - return err + return errors.WithStack(err) } fmt.Printf("menuHold: %+v\n", menuHold) var b bytes.Buffer @@ -95,105 +98,105 @@ func afterDBInit() (err error) { log.Print("Initialising the authentication system") common.Auth, err = common.NewDefaultAuth() if err != nil { - return err + return errors.WithStack(err) } log.Print("Loading the word filters") err = common.LoadWordFilters() if err != nil { - return err + return errors.WithStack(err) } log.Print("Initialising the stores") common.MFAstore, err = common.NewSQLMFAStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.Pages, err = common.NewDefaultPageStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.Reports, err = common.NewDefaultReportStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.Emails, err = common.NewDefaultEmailStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.RegLogs, err = common.NewRegLogStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.ModLogs, err = common.NewModLogStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.AdminLogs, err = common.NewAdminLogStore(acc) if err != nil { - return err + return errors.WithStack(err) } common.IPSearch, err = common.NewDefaultIPSearcher() if err != nil { - return err + return errors.WithStack(err) } common.Subscriptions, err = common.NewDefaultSubscriptionStore() if err != nil { - return err + return errors.WithStack(err) } common.Attachments, err = common.NewDefaultAttachmentStore() if err != nil { - return err + return errors.WithStack(err) } common.Polls, err = common.NewDefaultPollStore(common.NewMemoryPollCache(100)) // TODO: Max number of polls held in cache, make this a config item if err != nil { - return err + return errors.WithStack(err) } common.TopicList, err = common.NewDefaultTopicList() if err != nil { - return err + return errors.WithStack(err) } log.Print("Initialising the view counters") counters.GlobalViewCounter, err = counters.NewGlobalViewCounter(acc) if err != nil { - return err + return errors.WithStack(err) } counters.AgentViewCounter, err = counters.NewDefaultAgentViewCounter() if err != nil { - return err + return errors.WithStack(err) } counters.OSViewCounter, err = counters.NewDefaultOSViewCounter() if err != nil { - return err + return errors.WithStack(err) } counters.LangViewCounter, err = counters.NewDefaultLangViewCounter() if err != nil { - return err + return errors.WithStack(err) } counters.RouteViewCounter, err = counters.NewDefaultRouteViewCounter() if err != nil { - return err + return errors.WithStack(err) } counters.PostCounter, err = counters.NewPostCounter() if err != nil { - return err + return errors.WithStack(err) } counters.TopicCounter, err = counters.NewTopicCounter() if err != nil { - return err + return errors.WithStack(err) } counters.TopicViewCounter, err = counters.NewDefaultTopicViewCounter() if err != nil { - return err + return errors.WithStack(err) } counters.ForumViewCounter, err = counters.NewDefaultForumViewCounter() if err != nil { - return err + return errors.WithStack(err) } counters.ReferrerTracker, err = counters.NewDefaultReferrerTracker() if err != nil { - return err + return errors.WithStack(err) } return nil @@ -267,7 +270,7 @@ func main() { err = afterDBInit() if err != nil { - log.Fatal(err) + log.Fatalf("%+v", err) } err = common.VerifyConfig() @@ -361,7 +364,7 @@ func main() { var runHook = func(name string) { err := common.RunTaskHook(name) if err != nil { - common.LogError(err) + common.LogError(err, "Failed at task '"+name+"'") } } for { diff --git a/patcher/patches.go b/patcher/patches.go index 1c35ba59..d6dea396 100644 --- a/patcher/patches.go +++ b/patcher/patches.go @@ -14,6 +14,7 @@ func init() { addPatch(3, patch3) addPatch(4, patch4) addPatch(5, patch5) + addPatch(6, patch6) } func patch0(scanner *bufio.Scanner) (err error) { @@ -509,3 +510,12 @@ func patch5(scanner *bufio.Scanner) error { return nil } + +func patch6(scanner *bufio.Scanner) error { + err := execStmt(qgen.Builder.SimpleInsert("settings", "name, content, type", "'rapid_loading','1','bool'")) + if err != nil { + return err + } + + return nil +} diff --git a/query_gen/main.go b/query_gen/main.go index b98d1235..17810e8c 100644 --- a/query_gen/main.go +++ b/query_gen/main.go @@ -115,6 +115,7 @@ func seedTables(adapter qgen.Adapter) error { qgen.Install.SimpleInsert("settings", "name, content, type", "'bigpost_min_words','250','int'") qgen.Install.SimpleInsert("settings", "name, content, type", "'megapost_min_words','1000','int'") qgen.Install.SimpleInsert("settings", "name, content, type", "'meta_desc','','html-attribute'") + qgen.Install.SimpleInsert("settings", "name, content, type", "'rapid_loading','1','bool'") qgen.Install.SimpleInsert("themes", "uname, default", "'cosora',1") qgen.Install.SimpleInsert("emails", "email, uid, validated", "'admin@localhost',1,1") // ? - Use a different default email or let the admin input it during installation? diff --git a/router_gen/main.go b/router_gen/main.go index 7a4bda15..37d3f4ea 100644 --- a/router_gen/main.go +++ b/router_gen/main.go @@ -216,7 +216,7 @@ func main() { tmplVars.AllAgentMap[agent] = id } - var fileData = `// Code generated by. DO NOT EDIT. + var fileData = `// Code generated by Gosora's Router Generator. DO NOT EDIT. /* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */ package main diff --git a/schema/mssql/inserts.sql b/schema/mssql/inserts.sql index 770be7d2..df788f27 100644 --- a/schema/mssql/inserts.sql +++ b/schema/mssql/inserts.sql @@ -3,6 +3,7 @@ INSERT INTO [settings] ([name],[content],[type],[constraints]) VALUES ('activati INSERT INTO [settings] ([name],[content],[type]) VALUES ('bigpost_min_words','250','int'); INSERT INTO [settings] ([name],[content],[type]) VALUES ('megapost_min_words','1000','int'); INSERT INTO [settings] ([name],[content],[type]) VALUES ('meta_desc','','html-attribute'); +INSERT INTO [settings] ([name],[content],[type]) VALUES ('rapid_loading','1','bool'); INSERT INTO [themes] ([uname],[default]) VALUES ('cosora',1); INSERT INTO [emails] ([email],[uid],[validated]) VALUES ('admin@localhost',1,1); INSERT INTO [users_groups] ([name],[permissions],[plugin_perms],[is_mod],[is_admin],[tag]) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,1,'Admin'); diff --git a/schema/mysql/inserts.sql b/schema/mysql/inserts.sql index e099d716..1436d023 100644 --- a/schema/mysql/inserts.sql +++ b/schema/mysql/inserts.sql @@ -3,6 +3,7 @@ INSERT INTO `settings`(`name`,`content`,`type`,`constraints`) VALUES ('activatio INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('bigpost_min_words','250','int'); INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('megapost_min_words','1000','int'); INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('meta_desc','','html-attribute'); +INSERT INTO `settings`(`name`,`content`,`type`) VALUES ('rapid_loading','1','bool'); INSERT INTO `themes`(`uname`,`default`) VALUES ('cosora',1); INSERT INTO `emails`(`email`,`uid`,`validated`) VALUES ('admin@localhost',1,1); INSERT INTO `users_groups`(`name`,`permissions`,`plugin_perms`,`is_mod`,`is_admin`,`tag`) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,1,'Admin'); diff --git a/schema/pgsql/inserts.sql b/schema/pgsql/inserts.sql index 73395d01..408b6ae7 100644 --- a/schema/pgsql/inserts.sql +++ b/schema/pgsql/inserts.sql @@ -3,6 +3,7 @@ INSERT INTO "settings"("name","content","type","constraints") VALUES ('activatio INSERT INTO "settings"("name","content","type") VALUES ('bigpost_min_words','250','int'); INSERT INTO "settings"("name","content","type") VALUES ('megapost_min_words','1000','int'); INSERT INTO "settings"("name","content","type") VALUES ('meta_desc','','html-attribute'); +INSERT INTO "settings"("name","content","type") VALUES ('rapid_loading','1','bool'); INSERT INTO "themes"("uname","default") VALUES ('cosora',1); INSERT INTO "emails"("email","uid","validated") VALUES ('admin@localhost',1,1); INSERT INTO "users_groups"("name","permissions","plugin_perms","is_mod","is_admin","tag") VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"EditGroup":true,"EditGroupLocalPerms":true,"EditGroupGlobalPerms":true,"EditGroupSuperMod":true,"EditGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewAdminLogs":true,"ViewIPs":true,"UploadFiles":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true,"MoveTopic":true}','{}',1,1,'Admin'); diff --git a/schema/schema.json b/schema/schema.json index 6a00a98c..1169c29d 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,5 +1,5 @@ { - "DBVersion":"6", + "DBVersion":"7", "DynamicFileVersion":"0", "MinGoVersion":"1.10", "MinVersion":"" diff --git a/templates/account_own_edit_email.html b/templates/account_own_edit_email.html index f8c7bb4f..4f18e09d 100644 --- a/templates/account_own_edit_email.html +++ b/templates/account_own_edit_email.html @@ -1,5 +1,5 @@ {{template "header.html" . }} -
+
{{template "account_menu.html" . }}
diff --git a/templates/account_test.html b/templates/account_test.html new file mode 100644 index 00000000..fdf0200f --- /dev/null +++ b/templates/account_test.html @@ -0,0 +1,8 @@ +{{template "header.html" . }} + +{{template "footer.html" . }} diff --git a/templates/login.html b/templates/login.html index dad71a47..f7f26c43 100644 --- a/templates/login.html +++ b/templates/login.html @@ -13,7 +13,7 @@
- - {{end}} diff --git a/templates/panel_groups.html b/templates/panel_groups.html index 1552cbd5..89229ee9 100644 --- a/templates/panel_groups.html +++ b/templates/panel_groups.html @@ -47,7 +47,7 @@
-
+
diff --git a/templates/panel_inner_menu.html b/templates/panel_inner_menu.html index 14db0fe7..bbb06b71 100644 --- a/templates/panel_inner_menu.html +++ b/templates/panel_inner_menu.html @@ -25,8 +25,8 @@ {{lang "panel_menu_themes"}} ({{.Stats.Themes}})
{{if eq .Zone "themes"}} - - + + {{end}} {{end}}
diff --git a/templates/panel_setting.html b/templates/panel_setting.html index dfec539b..29d1d53d 100644 --- a/templates/panel_setting.html +++ b/templates/panel_setting.html @@ -6,7 +6,7 @@

{{.Setting.FriendlyName}}

-
+
{{if eq .Setting.Type "list"}}
@@ -35,7 +35,7 @@
{{end}} -
+
diff --git a/templates/register.html b/templates/register.html index 570dd068..de2ae176 100644 --- a/templates/register.html +++ b/templates/register.html @@ -28,7 +28,7 @@
-
+
diff --git a/themes/cosora/public/main.css b/themes/cosora/public/main.css index 1b0e4def..49ca774e 100644 --- a/themes/cosora/public/main.css +++ b/themes/cosora/public/main.css @@ -948,7 +948,7 @@ textarea { .postImage { width: 100%; - max-width: 150px; + max-width: 240px; } .post_item { display: flex; diff --git a/themes/cosora/public/panel.css b/themes/cosora/public/panel.css index 13ced7bc..2462e8b2 100644 --- a/themes/cosora/public/panel.css +++ b/themes/cosora/public/panel.css @@ -157,6 +157,9 @@ width: 100%; height: 80px; } +#panel_setting .formlabel { + display: none; +} #panel_page_list textarea, #panel_page_edit textarea { margin-top: 8px; } diff --git a/themes/nox/public/account.css b/themes/nox/public/account.css index f1a758a4..2a05901d 100644 --- a/themes/nox/public/account.css +++ b/themes/nox/public/account.css @@ -2,12 +2,105 @@ display: none; } +/* start panel css copy, try to de-dupe this */ +#back { + padding: 0px; +} + +.rowmenu { + margin-left: 12px; +} +.colstack_left { + width: 25%; + padding-top: 12px; + padding-right: 24px; + padding-bottom: 24px; + padding-left: 24px; +} +.colstack_left .colstack_head { + font-size: 19px; + margin-bottom: 4px; +} +.colstack_left .colstack_head:not(:first-child) { + margin-top: 8px; +} +.colstack_left .colstack_head a { + color: rgb(231, 231, 231); +} +.rowmenu { + margin-bottom: 2px; + font-size: 17px; +} +.rowmenu a { + color: rgb(170, 170, 170); +} + +.colstack_right { + background-color: #444444; + width: 75%; + padding-top: 12px; + padding-right: 24px; + padding-bottom: 24px; + padding-left: 24px; +} +.colstack_right .colstack_head { + margin-bottom: 4px; +} +.colstack_right .colstack_head h1 { + font-size: 21px; + color: #BBBBBB; +} +.colstack_right .colstack_item.the_form { + background-color: #555555; +} +.colstack_right .colstack_item:not(.colstack_head):not(.rowhead) .rowitem { + background-color: #555555; +} + +input, select, textarea { + background: rgb(107,107,107); + color: rgb(217,217,217); +} +input:focus, select:focus, textarea:focus { + outline: 1px solid rgb(137,137,137); +} + +/* ? - The background properties need to be redeclared for the new image or it won't work properly */ +input { + background-image: url(./fa-svg/pencil-alt-light.svg); + background-size: 12px; + background-repeat: no-repeat; + background-position: right 10px bottom 9px; + background-position-x: right 10px; +} +input::placeholder, textarea::placeholder { + color: rgb(167,167,167); + opacity: 1; /* Firefox fix */ +} +button, .formbutton { + background: rgb(100,100,200); +} + +#themeSelector select { + background: rgb(90,90,90); + color: rgb(200,200,200); +} +.footer .widget, #poweredByHolder { + background-color: #393939; +} + +/* end panel css copy */ + +.account_soon, .dash_security { + font-size: 14px; +} + #account_dashboard .colstack_right .coldyn_block { display: flex; } #dash_left { border-radius: 3px; - background-color: #444444; + background-color: #555555; padding: 12px; height: 180px; width: 240px; @@ -58,7 +151,7 @@ } #dash_right .rowitem { border-radius: 3px; - background-color: #444444; + background-color: #555555; padding: 16px; } #dash_right .rowitem:not(:last-child) { diff --git a/themes/nox/public/main.css b/themes/nox/public/main.css index 10a1836b..0783e411 100644 --- a/themes/nox/public/main.css +++ b/themes/nox/public/main.css @@ -15,7 +15,7 @@ body { font-family: "Segoe UI"; } a { - color: white; + color: #eeeeee; text-decoration: none; } @@ -157,7 +157,7 @@ h1, h2, h3, h4, h5 { margin-bottom: 8px; } .rowhead h1, .opthead h1, .colstack_head h1 { - font-size: 23px; + font-size: 22px; } .sidebar .rowhead { margin-left: 18px; @@ -176,7 +176,7 @@ h2 { } .topic_create_form { - display: flex !important; + display: flex; } .quick_reply_form, .topic_reply_form, .topic_create_form { background-color: #444444; @@ -232,6 +232,32 @@ h2 { display: none; } +.topic_list_title_block { + display: flex; + margin-left: 8px; +} +.topic_list_title { + margin-left: 2px; +} +.topic_list_title_block .optbox { + display: flex; + margin-left: auto; + font-size: 17px; + margin-top: 3.5px; + margin-right: 16px; + margin-right: 18px; +} +.topic_list_title_block .opt a { + color: #afafaf; + margin-left: 8px; +} +.topic_list_title_block .create_topic_opt a:before { + content: "Create Topic"; +} +.topic_list_title_block .mod_opt a:before { + content: "Moderate"; +} + .topic_row:not(:last-child) { margin-bottom: 8px; } @@ -242,8 +268,8 @@ h2 { } .topic_left, .topic_right, .topic_middle { padding: 16px; - padding-bottom: 12px; - padding-top: 15px; + padding-bottom: 10px; + padding-top: 16px; display: flex; width: 33%; } @@ -254,7 +280,11 @@ h2 { margin-right: auto; } .topic_left.topic_sticky { - border-left: 3px solid gold; + border-left: 3px solid rgb(215, 155, 0); + border-radius: 3px; +} +.topic_left.topic_closed { + border-left: 3px solid grey; border-radius: 3px; } .new_item .topic_left { @@ -265,8 +295,7 @@ h2 { border-radius: 24px; height: 38px; width: 38px; - margin-right: 8px; - margin-top: 1px; + margin-right: 10px; } .topic_inner_left { display: flex; @@ -289,6 +318,7 @@ h2 { .topic_right_inside .lastName, .topic_left .rowtopic { font-size: 15px !important; line-height: 22px; + margin-top: -2px; } .topic_right_inside .lastReplyAt, .topic_left .starter { font-size: 14px; @@ -312,6 +342,7 @@ h2 { .topic_middle_inside { margin-left: auto; margin-right: auto; + margin-top: -3px; width: 80px; } .topic_status_e { @@ -354,6 +385,18 @@ button, .formbutton { text-align: center; padding: 6px; } +.formlabel { + margin-bottom: 4px; +} +/*.formlabel + .formitem { + margin-left: 4px; +}*/ +.formrow { + margin-bottom: 6px; +} +.form_button_row { + margin-top: 10px; +} .pageset { display: flex; @@ -405,24 +448,29 @@ button, .formbutton { display: flex; } +.postImage { + width: 100%; + max-width: 320px; +} .post_item { display: flex; margin-bottom: 12px; } .userinfo { margin-right: 12px; - padding: 16px; + padding: 24px; + padding-bottom: 16px; background-color: #444444; border-radius: 3px; - width: 120px; + width: 150px; display: flex; flex-direction: column; } .avatar_item { - border-radius: 24px; - height: 48px; - width: 48px; - background-size: 56px; + border-radius: 36px; + height: 58px; + width: 58px; + background-size: 78px; margin-left: auto; margin-right: auto; } @@ -431,7 +479,7 @@ button, .formbutton { margin-right: auto; white-space: nowrap; display: block; - font-size: 17px; + font-size: 18px; margin-top: 8px; line-height: 16px; } @@ -449,6 +497,50 @@ button, .formbutton { background-color: #444444; border-radius: 3px; width: 100%; + display: flex; + flex-direction: column; + color: #bbbbbb; +} +.post_item .button_container { + display: flex; + margin-top: auto; +} +.post_item .action_button { + margin-right: 5px; + font-size: 15px; + color: #dddddd; +} +.post_item .action_button_right { + margin-left: auto; + display: flex; +} + +.add_like:before, .remove_like:before { + content: "{{index .Phrases "topic.plus_one"}}"; +} +.button_container .open_edit:after, .edit_item:after{ + content: "{{index .Phrases "topic.edit_button_text"}}"; +} +.delete_item:after { + content: "{{index .Phrases "topic.delete_button_text"}}"; +} +.ip_item_button:after { + content: "{{index .Phrases "topic.ip_button_text"}}"; +} +.lock_item:after { + content: "{{index .Phrases "topic.lock_button_text"}}"; +} +.unlock_item:after { + content: "{{index .Phrases "topic.unlock_button_text"}}"; +} +.pin_item:after { + content: "{{index .Phrases "topic.pin_button_text"}}"; +} +.unpin_item:after { + content: "{{index .Phrases "topic.unpin_button_text"}}"; +} +.report_item:after { + content: "{{index .Phrases "topic.report_button_text"}}"; } .topic_reply_container { diff --git a/themes/nox/public/panel.css b/themes/nox/public/panel.css index ade45348..5ea446c8 100644 --- a/themes/nox/public/panel.css +++ b/themes/nox/public/panel.css @@ -10,6 +10,13 @@ .footer .widget, #poweredByHolder { background-color: #393939; } +.rowmenu { + margin-left: 12px; +} +.submenu a:before { + content: "-"; + margin-right: 8px; +} .colstack_left { width: 25%; @@ -35,6 +42,9 @@ .rowmenu a { color: rgb(170, 170, 170); } +.menu_stats { + margin-left: 4px; +} .colstack_right { background-color: #444444; @@ -57,6 +67,9 @@ .colstack_right .colstack_item:not(.colstack_head):not(.rowhead) .rowitem { background-color: #555555; } +.rowitem { + display: flex; +} .colstack_grid { display: grid; @@ -70,6 +83,10 @@ padding: 12px; } +.to_right { + margin-left: auto; +} + .rowlist.bgavatars .rowitem { background-image: none !important; } @@ -78,7 +95,7 @@ height: 48px; } -input, select, button, .formbutton, textarea { +input, select, textarea { background: rgb(107,107,107); color: rgb(217,217,217); } @@ -101,6 +118,9 @@ button, .formbutton { /*background: rgb(110,110,210); color: rgb(250,250,250);*/ } +button, .formbutton { + background: rgb(100,100,200); +} #themeSelector select { background: rgb(90,90,90); color: rgb(200,200,200); @@ -124,3 +144,11 @@ button, .formbutton { .colstack_graph_holder .ct-grid { stroke: rgb(125,125,125); } + +#panel_setting .formlabel { + display: none; +} +#panel_setting textarea { + width: 100%; + height: 80px; +} \ No newline at end of file diff --git a/update-deps-linux b/update-deps-linux index 9ebca826..0470001e 100644 --- a/update-deps-linux +++ b/update-deps-linux @@ -28,5 +28,11 @@ go get -u github.com/robertkrimen/otto echo "Updating the Rez Image Resizer" go get -u github.com/bamiaux/rez +echo "Updating Caire" +go get -u github.com/esimov/caire + +echo "Updating some error helpers" +go get -u github.com/pkg/errors + echo "Updating fsnotify" go get -u github.com/fsnotify/fsnotify \ No newline at end of file diff --git a/update-deps.bat b/update-deps.bat index 3575b1d6..d3d1a3fb 100644 --- a/update-deps.bat +++ b/update-deps.bat @@ -82,6 +82,20 @@ if %errorlevel% neq 0 ( exit /b %errorlevel% ) +echo Updating Caire +go get -u github.com/esimov/caire +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + +echo Updating some error helpers +go get -u github.com/pkg/errors +if %errorlevel% neq 0 ( + pause + exit /b %errorlevel% +) + echo Updating fsnotify go get -u github.com/fsnotify/fsnotify if %errorlevel% neq 0 (