diff --git a/data.sql b/data.sql index 6bed1d25..c54754e9 100644 --- a/data.sql +++ b/data.sql @@ -189,6 +189,11 @@ EditUserPassword EditUserGroup EditUserGroupSuperMod EditUserGroupAdmin +EditGroup +EditGroupLocalPerms +EditGroupGlobalPerms +EditGroupSuperMod +EditGroupAdmin ManageForums EditSettings ManageThemes @@ -207,8 +212,8 @@ PinTopic CloseTopic */ -INSERT INTO users_groups(`name`,`permissions`,`is_mod`,`is_admin`,`tag`) VALUES ('Administrator','{"BanUsers":true,"ActivateUsers":true,"EditUser":true,"EditUserEmail":true,"EditUserPassword":true,"EditUserGroup":true,"EditUserGroupSuperMod":true,"EditUserGroupAdmin":false,"ManageForums":true,"EditSettings":true,"ManageThemes":true,"ManagePlugins":true,"ViewIPs":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}',1,1,"Admin"); -INSERT INTO users_groups(`name`,`permissions`,`is_mod`,`tag`) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserPassword":false,"EditUserGroup":true,"EditUserGroupSuperMod":false,"EditUserGroupAdmin":false,"ManageForums":false,"EditSettings":false,"ManageThemes":false,"ManagePlugins":false,"ViewIPs":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}',1,"Mod"); +INSERT INTO users_groups(`name`,`permissions`,`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,"ViewIPs":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}',1,1,"Admin"); +INSERT INTO users_groups(`name`,`permissions`,`is_mod`,`tag`) VALUES ('Moderator','{"BanUsers":true,"ActivateUsers":false,"EditUser":true,"EditUserEmail":false,"EditUserGroup":true,"ViewIPs":true,"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"EditTopic":true,"DeleteTopic":true,"CreateReply":true,"EditReply":true,"DeleteReply":true,"PinTopic":true,"CloseTopic":true}',1,"Mod"); INSERT INTO users_groups(`name`,`permissions`) VALUES ('Member','{"ViewTopic":true,"LikeItem":true,"CreateTopic":true,"CreateReply":true}'); INSERT INTO users_groups(`name`,`permissions`,`is_banned`) VALUES ('Banned','{"ViewTopic":true}',1); INSERT INTO users_groups(`name`,`permissions`) VALUES ('Awaiting Activation','{"ViewTopic":true}'); diff --git a/group.go b/group.go index a0782461..9fdf0ca8 100644 --- a/group.go +++ b/group.go @@ -1,5 +1,19 @@ package main +import "sync" + +var group_update_mutex sync.Mutex + +type GroupAdmin struct +{ + ID int + Name string + Rank string + RankEmoji string + CanEdit bool + CanDelete bool +} + type Group struct { ID int @@ -13,3 +27,10 @@ type Group struct Forums []ForumPerms CanSee []int // The IDs of the forums this group can see } + +func group_exists(gid int) bool { + //fmt.Println(gid <= groupCapCount) + //fmt.Println(gid > 0) + //fmt.Println(groups[gid].Name!="") + return (gid <= groupCapCount) && (gid > 0) && groups[gid].Name!="" +} diff --git a/images/group_editor_wip.png b/images/group_editor_wip.png new file mode 100644 index 00000000..b0d4c781 Binary files /dev/null and b/images/group_editor_wip.png differ diff --git a/images/group_list_wip.png b/images/group_list_wip.png new file mode 100644 index 00000000..18651a73 Binary files /dev/null and b/images/group_list_wip.png differ diff --git a/main.go b/main.go index 8bfb6cae..7e518e1e 100644 --- a/main.go +++ b/main.go @@ -228,7 +228,7 @@ func main(){ router.HandleFunc("/user/edit/username/", route_account_own_edit_username) router.HandleFunc("/user/edit/username/submit/", route_account_own_edit_username_submit) router.HandleFunc("/user/edit/email/", route_account_own_edit_email) - router.HandleFunc("/user/edit/email/token/", route_account_own_edit_email_token_submit) + router.HandleFunc("/user/edit/token/", route_account_own_edit_email_token_submit) router.HandleFunc("/user/", route_profile) router.HandleFunc("/profile/reply/create/", route_profile_reply_create) router.HandleFunc("/profile/reply/edit/submit/", route_profile_reply_edit_submit) @@ -259,6 +259,8 @@ func main(){ router.HandleFunc("/panel/users/edit/", route_panel_users_edit) router.HandleFunc("/panel/users/edit/submit/", route_panel_users_edit_submit) router.HandleFunc("/panel/groups/", route_panel_groups) + router.HandleFunc("/panel/groups/edit/", route_panel_groups_edit) + router.HandleFunc("/panel/groups/edit/submit/", route_panel_groups_edit_submit) router.HandleFunc("/api/", route_api) //router.HandleFunc("/exit/", route_exit) diff --git a/mod_routes.go b/mod_routes.go index eb0c6104..c07036e7 100644 --- a/mod_routes.go +++ b/mod_routes.go @@ -1393,13 +1393,231 @@ func route_panel_groups(w http.ResponseWriter, r *http.Request){ var groupList []interface{} for _, group := range groups[1:] { - groupList = append(groupList, group) + var rank string + var rank_emoji string + var can_edit bool + var can_delete bool = false + + if group.Is_Admin { + rank = "Admin" + rank_emoji = "👑" + } else if group.Is_Mod { + rank = "Mod" + rank_emoji = "👮" + } else if group.Is_Banned { + rank = "Banned" + rank_emoji = "⛓️" + } else if group.ID == 6 { + rank = "Guest" + rank_emoji = "👽" + } else { + rank = "Member" + rank_emoji = "👪" + } + + if user.Perms.EditGroup && (!group.Is_Admin || user.Perms.EditGroupAdmin) && (!group.Is_Mod || user.Perms.EditGroupSuperMod) { + can_edit = true + } else { + can_edit = false + } + + groupList = append(groupList, GroupAdmin{group.ID,group.Name,rank,rank_emoji,can_edit,can_delete}) } + //fmt.Printf("%+v\n", groupList) pi := Page{"Group Manager",user,noticeList,groupList,nil} templates.ExecuteTemplate(w,"panel-groups.html",pi) } +func route_panel_groups_edit(w http.ResponseWriter, r *http.Request){ + user, noticeList, ok := SessionCheck(w,r) + if !ok { + return + } + if !user.Is_Super_Mod || !user.Perms.EditGroup { + NoPermissions(w,r,user) + return + } + + gid, err := strconv.Atoi(r.URL.Path[len("/panel/groups/edit/"):]) + if err != nil { + LocalError("The Group ID is not a valid integer.",w,r,user) + return + } + + if !group_exists(gid) { + //fmt.Println("aaaaa monsters") + NotFound(w,r) + return + } + + group := groups[gid] + if group.Is_Admin && !user.Perms.EditGroupAdmin { + LocalError("You need the EditGroupAdmin permission to edit an admin group.",w,r,user) + return + } + if group.Is_Mod && !user.Perms.EditGroupSuperMod { + LocalError("You need the EditGroupSuperMod permission to edit an super-mod group.",w,r,user) + return + } + + var rank string + if group.Is_Admin { + rank = "Admin" + } else if group.Is_Mod { + rank = "Mod" + } else if group.Is_Banned { + rank = "Banned" + } else if group.ID == 6 { + rank = "Guest" + } else { + rank = "Member" + } + + var disable_rank bool + if !user.Perms.EditGroupGlobalPerms || (group.ID == 6) { + disable_rank = true + } + + pi := EditGroupPage{"Group Editor",user,noticeList,group.ID,group.Name,group.Tag,rank,disable_rank,nil} + err = templates.ExecuteTemplate(w,"panel-group-edit.html",pi) + if err != nil { + InternalError(err,w,r) + } +} + +func route_panel_groups_edit_submit(w http.ResponseWriter, r *http.Request){ + user, ok := SimpleSessionCheck(w,r) + if !ok { + return + } + if !user.Is_Super_Mod || !user.Perms.EditGroup { + NoPermissions(w,r,user) + return + } + if r.FormValue("session") != user.Session { + SecurityError(w,r,user) + return + } + + gid, err := strconv.Atoi(r.URL.Path[len("/panel/groups/edit/submit/"):]) + if err != nil { + LocalError("The Group ID is not a valid integer.",w,r,user) + return + } + + if !group_exists(gid) { + //fmt.Println("aaaaa monsters") + NotFound(w,r) + return + } + + group := groups[gid] + if group.Is_Admin && !user.Perms.EditGroupAdmin { + LocalError("You need the EditGroupAdmin permission to edit an admin group.",w,r,user) + return + } + if group.Is_Mod && !user.Perms.EditGroupSuperMod { + LocalError("You need the EditGroupSuperMod permission to edit an super-mod group.",w,r,user) + return + } + + gname := r.FormValue("group-name") + if gname == "" { + LocalError("The group name can't be left blank.",w,r,user) + return + } + gtag := r.FormValue("group-tag") + rank := r.FormValue("group-type") + + var original_rank string + if group.Is_Admin { + original_rank = "Admin" + } else if group.Is_Mod { + original_rank = "Mod" + } else if group.Is_Banned { + original_rank = "Banned" + } else if group.ID == 6 { + original_rank = "Guest" + } else { + original_rank = "Member" + } + + group_update_mutex.Lock() + defer group_update_mutex.Unlock() + if rank != original_rank { + if !user.Perms.EditGroupGlobalPerms { + LocalError("You need the EditGroupGlobalPerms permission to change the group type.",w,r,user) + return + } + + switch(rank) { + case "Admin": + if !user.Perms.EditGroupAdmin { + LocalError("You need the EditGroupAdmin permission to designate this group as an admin group.",w,r,user) + return + } + + _, err = update_group_rank_stmt.Exec(1,1,0,gid) + if err != nil { + InternalError(err,w,r) + return + } + groups[gid].Is_Admin = true + groups[gid].Is_Mod = true + groups[gid].Is_Banned = false + case "Mod": + if !user.Perms.EditGroupSuperMod { + LocalError("You need the EditGroupSuperMod permission to designate this group as an admin group.",w,r,user) + return + } + + _, err = update_group_rank_stmt.Exec(0,1,0,gid) + if err != nil { + InternalError(err,w,r) + return + } + groups[gid].Is_Admin = false + groups[gid].Is_Mod = true + groups[gid].Is_Banned = false + case "Banned": + _, err = update_group_rank_stmt.Exec(0,0,1,gid) + if err != nil { + InternalError(err,w,r) + return + } + groups[gid].Is_Admin = false + groups[gid].Is_Mod = false + groups[gid].Is_Banned = true + case "Guest": + LocalError("You can't designate a group as a guest group.",w,r,user) + return + case "Member": + _, err = update_group_rank_stmt.Exec(0,0,0,gid) + if err != nil { + InternalError(err,w,r) + return + } + groups[gid].Is_Admin = false + groups[gid].Is_Mod = false + groups[gid].Is_Banned = false + default: + LocalError("Invalid group type.",w,r,user) + return + } + } + + _, err = update_group_stmt.Exec(gname,gtag,gid) + if err != nil { + InternalError(err,w,r) + return + } + groups[gid].Name = gname + groups[gid].Tag = gtag + + http.Redirect(w,r,"/panel/groups/edit/" + strconv.Itoa(gid),http.StatusSeeOther) +} + func route_panel_themes(w http.ResponseWriter, r *http.Request){ user, noticeList, ok := SessionCheck(w,r) if !ok { diff --git a/mysql.go b/mysql.go index c04f31ec..4cf87e34 100644 --- a/mysql.go +++ b/mysql.go @@ -83,6 +83,8 @@ var update_setting_stmt *sql.Stmt var add_plugin_stmt *sql.Stmt var update_plugin_stmt *sql.Stmt var update_user_stmt *sql.Stmt +var update_group_rank_stmt *sql.Stmt +var update_group_stmt *sql.Stmt var add_theme_stmt *sql.Stmt var update_theme_stmt *sql.Stmt @@ -552,6 +554,18 @@ func init_database(err error) { log.Fatal(err) } + log.Print("Preparing update_group_rank statement.") + update_group_rank_stmt, err = db.Prepare("update `users_groups` set `is_admin` = ?, `is_mod` = ?, `is_banned` = ? where `gid` = ?") + if err != nil { + log.Fatal(err) + } + + log.Print("Preparing update_group statement.") + update_group_stmt, err = db.Prepare("update `users_groups` set `name` = ?, `tag` = ? where `gid` = ?") + if err != nil { + log.Fatal(err) + } + log.Print("Loading the usergroups.") groups = append(groups, Group{ID:0,Name:"System"}) @@ -591,6 +605,7 @@ func init_database(err error) { if err != nil { log.Fatal(err) } + groupCapCount = i log.Print("Binding the Not Loggedin Group") GuestPerms = groups[6].Perms diff --git a/pages.go b/pages.go index c5b0227f..5b380658 100644 --- a/pages.go +++ b/pages.go @@ -86,6 +86,19 @@ type ThemesPage struct ExtData interface{} } +type EditGroupPage struct +{ + Title string + CurrentUser User + NoticeList []string + ID int + Name string + Tag string + Rank string + DisableRank bool + ExtData interface{} +} + type PageSimple struct { Title string diff --git a/permissions.go b/permissions.go index eb17e3ef..e5513e8b 100644 --- a/permissions.go +++ b/permissions.go @@ -26,6 +26,11 @@ type Perms struct EditUserGroup bool EditUserGroupSuperMod bool EditUserGroupAdmin bool + EditGroup bool + EditGroupLocalPerms bool + EditGroupGlobalPerms bool + EditGroupSuperMod bool + EditGroupAdmin bool ManageForums bool // This could be local, albeit limited for per-forum managers EditSettings bool ManageThemes bool @@ -94,6 +99,11 @@ func init() { EditUserGroup: true, EditUserGroupSuperMod: true, EditUserGroupAdmin: true, + EditGroup: true, + EditGroupLocalPerms: true, + EditGroupGlobalPerms: true, + EditGroupSuperMod: true, + EditGroupAdmin: true, ManageForums: true, EditSettings: true, ManageThemes: true, diff --git a/routes.go b/routes.go index 7bc9e5e7..490f23fc 100644 --- a/routes.go +++ b/routes.go @@ -1403,21 +1403,23 @@ func route_account_own_edit_email_token_submit(w http.ResponseWriter, r *http.Re LocalError("You need to login to edit your account.",w,r,user) return } - token := r.URL.Path[len("/user/edit/email/token/"):] + token := r.URL.Path[len("/user/edit/token/"):] email := Email{UserID: user.ID} targetEmail := Email{UserID: user.ID} var emailList []interface{} rows, err := db.Query("select email, validated, token from emails where uid = ?", user.ID) if err != nil { - log.Fatal(err) + InternalError(err,w,r) + return } defer rows.Close() for rows.Next() { err := rows.Scan(&email.Email, &email.Validated, &email.Token) if err != nil { - log.Fatal(err) + InternalError(err,w,r) + return } if email.Email == user.Email { @@ -1430,7 +1432,8 @@ func route_account_own_edit_email_token_submit(w http.ResponseWriter, r *http.Re } err = rows.Err() if err != nil { - log.Fatal(err) + InternalError(err,w,r) + return } if len(emailList) == 0 { diff --git a/templates/account-menu.html b/templates/account-menu.html index 0a8e88dc..0595ca9f 100644 --- a/templates/account-menu.html +++ b/templates/account-menu.html @@ -1,10 +1,14 @@ -
-
My Account
-
Change Avatar
-
Change Username
-
Change Password
-
Change Email
-
Coming Soon
-
Coming Soon
-
Coming Soon
+
+ +
\ No newline at end of file diff --git a/templates/account-own-edit-avatar.html b/templates/account-own-edit-avatar.html index be2a049c..b7c8539f 100644 --- a/templates/account-own-edit-avatar.html +++ b/templates/account-own-edit-avatar.html @@ -1,22 +1,24 @@ {{template "header.html" . }} {{template "account-menu.html" . }} -
- -
-{{ if .CurrentUser.Avatar }} -
-
-
-{{end}} -
-
- -
-
-
-
+
+ + {{if .CurrentUser.Avatar}} +
+
+
+ {{end}} +
+
+ +
+
+
+
+
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/account-own-edit-email.html b/templates/account-own-edit-email.html index 6d522d72..19050656 100644 --- a/templates/account-own-edit-email.html +++ b/templates/account-own-edit-email.html @@ -1,17 +1,19 @@ {{template "header.html" . }} {{template "account-menu.html" . }} -
- -
-
- {{range .ItemList}} -
- {{.Email}} - - {{if .Primary}}Primary{{else}}Secondary{{end}} - {{if .Validated}}Verified{{else}}Resend Verification Email{{end}} - +
+
+ +
+
+ {{range .ItemList}} +
+ {{.Email}} + + {{if .Primary}}Primary{{else}}Secondary{{end}} + {{if .Validated}}Verified{{else}}Resend Verification Email{{end}} + +
+ {{end}}
- {{end}}
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/account-own-edit-username.html b/templates/account-own-edit-username.html index 878190b6..a98d3b8b 100644 --- a/templates/account-own-edit-username.html +++ b/templates/account-own-edit-username.html @@ -1,21 +1,23 @@ {{template "header.html" . }} {{template "account-menu.html" . }} - -
-
-
- -
{{.CurrentUser.Name}}
-
-
- -
-
-
-
-
-
+
+ +
+
+
+ +
{{.CurrentUser.Name}}
+
+
+ +
+
+
+
+
+
+
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/account-own-edit.html b/templates/account-own-edit.html index 1d2894ce..7f84170b 100644 --- a/templates/account-own-edit.html +++ b/templates/account-own-edit.html @@ -1,25 +1,27 @@ {{template "header.html" . }} {{template "account-menu.html" . }} - -
-
- -
- -
-
- -
-
-
-
+
+ +
+
+ +
+ +
+
+ +
+
+
+
+
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-dashboard.html b/templates/panel-dashboard.html index b769447b..89c6bc22 100644 --- a/templates/panel-dashboard.html +++ b/templates/panel-dashboard.html @@ -1,9 +1,11 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} - -
-
Coming Soon...
+
+
+ +
+
+
Coming Soon...
+
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-forums.html b/templates/panel-forums.html index 191cb770..e22e56e8 100644 --- a/templates/panel-forums.html +++ b/templates/panel-forums.html @@ -4,55 +4,59 @@ 'forum-active': ['Hide','Show'], 'forum-preset': ['all','announce','members','staff','admins','archive','custom']}; -
- -
-
- {{range .ItemList}} -
- {{.Name}} - - 🕵️ - {{if .PresetEmoji}}{{.PresetEmoji}} - {{else if .PresetLang}}{{.PresetLang}}{{else}}{{end}} - {{if gt .ID 0}}Edit - {{end}} - {{if gt .ID 1}}Delete{{end}} - +
+
+
- {{end}} -

- -
-
-
- -
+
+ {{range .ItemList}} +
+ {{.Name}} + + 🕵️ + + {{if .PresetEmoji}}{{.PresetEmoji}} + {{else if .PresetLang}}{{.PresetLang}}{{else}}{{end}} + + {{if gt .ID 0}}Edit + {{end}} + {{if gt .ID 1}}Delete{{end}} +
-
- -
-
-
- -
-
-
-
-
- + {{end}} +
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+
+
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-group-edit.html b/templates/panel-group-edit.html new file mode 100644 index 00000000..6d63b8a1 --- /dev/null +++ b/templates/panel-group-edit.html @@ -0,0 +1,46 @@ +{{template "header.html" . }} +
+ + +{{template "panel-inner-menu.html" . }} +
+
+ +
+
+
+ +
+
+ {{if .CurrentUser.Perms.EditUserGroup}} +
+ +
+ +
+
{{end}} +
+ +
+
+
+
+
+
+
+
+{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-groups.html b/templates/panel-groups.html index a75dae36..48304b48 100644 --- a/templates/panel-groups.html +++ b/templates/panel-groups.html @@ -1,13 +1,21 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} -
- -
-
- {{range .ItemList}} -
- {{.Name}} +
+
+ +
+
+ {{range .ItemList}} +
+ {{.Name}} + + {{if .RankEmoji}}{{.RankEmoji}} + {{else}}{{.Rank}}{{end}} + + {{if .CanEdit}}Edit{{end}} + +
+ {{end}}
- {{end}}
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-inner-menu.html b/templates/panel-inner-menu.html new file mode 100644 index 00000000..50264dfc --- /dev/null +++ b/templates/panel-inner-menu.html @@ -0,0 +1,12 @@ + +
+ + + {{if .CurrentUser.Perms.ManageForums}}{{end}} + {{if .CurrentUser.Perms.EditSettings}}{{end}} + {{if .CurrentUser.Perms.ManageThemes}}{{end}} + {{if .CurrentUser.Perms.ManagePlugins}}{{end}} + +
\ No newline at end of file diff --git a/templates/panel-menu.html b/templates/panel-menu.html index 27e7a294..75b274e8 100644 --- a/templates/panel-menu.html +++ b/templates/panel-menu.html @@ -1,10 +1 @@ -
- - - - {{if .CurrentUser.Perms.ManageForums}}{{end}} - {{if .CurrentUser.Perms.EditSettings}}{{end}} - {{if .CurrentUser.Perms.ManageThemes}}{{end}} - {{if .CurrentUser.Perms.ManagePlugins}}{{end}} - -
\ No newline at end of file +
{{template "panel-inner-menu.html" . }}
\ No newline at end of file diff --git a/templates/panel-plugins.html b/templates/panel-plugins.html index c38e021a..7cfa3a72 100644 --- a/templates/panel-plugins.html +++ b/templates/panel-plugins.html @@ -1,19 +1,21 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} -
- -
-
- {{range .ItemList}} -
- {{.Name}}
- Author: {{.Author}} - - {{if .Settings}}Settings{{end}} - {{if .Active}}Deactivate - {{else}}Activate{{end}} - +
+
+ +
+
+ {{range .ItemList}} +
+ {{.Name}}
+ Author: {{.Author}} + + {{if .Settings}}Settings{{end}} + {{if .Active}}Deactivate + {{else}}Activate{{end}} + +
+ {{end}}
- {{end}}
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-setting.html b/templates/panel-setting.html index 75f7404c..e0581cc3 100644 --- a/templates/panel-setting.html +++ b/templates/panel-setting.html @@ -1,35 +1,37 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} - -
-
-
- -
{{.Something.Name}}
-
- {{if eq .Something.Type "list"}} -
- -
- +
+ +
+ +
+ +
{{.Something.Name}}
-
- {{else if eq .Something.Type "bool"}} - - {{else}}{{end}} -
-
-
- + {{if eq .Something.Type "list"}} +
+ +
+ +
+
+ {{else if eq .Something.Type "bool"}} + + {{else}}{{end}} +
+
+
+ +
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-settings.html b/templates/panel-settings.html index fa35f7c3..19d9373a 100644 --- a/templates/panel-settings.html +++ b/templates/panel-settings.html @@ -1,14 +1,16 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} - -
- {{ range $key, $value := .Something }} -
- {{$key}} - {{$value}} +
+
+ +
+
+ {{range $key, $value := .Something}} + + {{end}}
- {{end}}
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-themes.html b/templates/panel-themes.html index 7e0c1a6a..1ec079a7 100644 --- a/templates/panel-themes.html +++ b/templates/panel-themes.html @@ -1,40 +1,42 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} - -
- {{range .PrimaryThemes}} -
- - {{.FriendlyName}}
- Author: {{.Creator}} -
- - {{if .MobileFriendly}}📱{{end}} - {{if .Tag}}{{.Tag}}{{end}} - {{if .Active}}Default{{else}}Make Default{{end}} - +
+ - {{end}} -
- -
- {{range .VariantThemes}} -
- - {{.FriendlyName}}
- Author: {{.Creator}} -
- - {{if .MobileFriendly}}📱{{end}} - {{if .Tag}}{{.Tag}}{{end}} - {{if .Active}}Default{{else}}Make Default{{end}} - +
+ {{range .PrimaryThemes}} +
+ + {{.FriendlyName}}
+ Author: {{.Creator}} +
+ + {{if .MobileFriendly}}📱{{end}} + {{if .Tag}}{{.Tag}}{{end}} + {{if .Active}}Default{{else}}Make Default{{end}} + +
+ {{end}} +
+ +
+ {{range .VariantThemes}} +
+ + {{.FriendlyName}}
+ Author: {{.Creator}} +
+ + {{if .MobileFriendly}}📱{{end}} + {{if .Tag}}{{.Tag}}{{end}} + {{if .Active}}Default{{else}}Make Default{{end}} + +
+ {{end}}
- {{end}}
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-user-edit.html b/templates/panel-user-edit.html index 938d6f0b..88c27b5c 100644 --- a/templates/panel-user-edit.html +++ b/templates/panel-user-edit.html @@ -1,34 +1,36 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} - -
-
-
- -
+
+ - {{if .CurrentUser.Perms.EditUserPassword}}
- -
-
{{end}} - {{if .CurrentUser.Perms.EditUserEmail}}
- -
-
{{end}} - {{if .CurrentUser.Perms.EditUserGroup}} -
- -
- +
+ +
+ +
-
{{end}} -
-
+ {{if .CurrentUser.Perms.EditUserPassword}}
+ +
+
{{end}} + {{if .CurrentUser.Perms.EditUserEmail}}
+ +
+
{{end}} + {{if .CurrentUser.Perms.EditUserGroup}} +
+ +
+ +
+
{{end}} +
+
+
+
-
{{template "footer.html" . }} \ No newline at end of file diff --git a/templates/panel-users.html b/templates/panel-users.html index e9814bd6..8f43a405 100644 --- a/templates/panel-users.html +++ b/templates/panel-users.html @@ -1,19 +1,21 @@ {{template "header.html" . }} {{template "panel-menu.html" . }} -
- -
-
- {{range .ItemList}} -
- {{.Name}} - Profile - {{if .Tag}}{{.Tag}}{{end}} - - {{if .Is_Banned}}Unban{{else if not .Is_Super_Mod}}Ban{{end}} - {{if not .Active}}Activate{{end}} - +
+
+ +
+
+ {{range .ItemList}} +
+ {{.Name}} + Profile + {{if .Tag}}{{.Tag}}{{end}} + + {{if .Is_Banned}}Unban{{else if not .Is_Super_Mod}}Ban{{end}} + {{if not .Active}}Activate{{end}} + +
+ {{end}}
- {{end}}
{{template "footer.html" . }} \ No newline at end of file diff --git a/themes/cosmo-conflux/public/main.css b/themes/cosmo-conflux/public/main.css index 32ac803f..c5f26670 100644 --- a/themes/cosmo-conflux/public/main.css +++ b/themes/cosmo-conflux/public/main.css @@ -191,7 +191,7 @@ hr { color: silver; border: 1px solid silver; } -o-transition: color 1s; } -.rowblock, .colblock_left, .colblock_right { +.rowblock, .colblock_left, .colblock_right, .colstack_item { background: rgba(240,240,240,1); border-spacing: 0; border-collapse: collapse; @@ -208,13 +208,8 @@ hr { color: silver; border: 1px solid silver; } border-left: 1px solid black; border-right: 1px solid black; } -.rowitem:not(:last-child) -{ - border-bottom: 1px dotted #ccc; -} -.rowblock:first-of-type { - margin-top: 8px; -} +.rowitem:not(:last-child) { border-bottom: 1px dotted #ccc; } +.rowblock:first-of-type { margin-top: 8px; } .rowhead, .colhead { background: #ce2424; @@ -261,20 +256,39 @@ hr { color: silver; border: 1px solid silver; } overflow: hidden; word-wrap: break-word; } -.colblock_left:empty +.colblock_left:empty { display: none; } +.colblock_right:empty { display: none; } +.colblock_left:first-of-type { margin-top: 8px; } +.colblock_right:first-of-type { margin-top: 8px; } + +/* The new method of doing columns layouts, colblock is now deprecated */ +.colstack_left { - display: none; + float: left; + width: 30%; + margin-right: 8px; + margin-top: 12px; } -.colblock_right:empty +.colstack_right { - display: none; + float: left; + width: 65%; + width: calc(70% - 15px); + margin-top: 12px; } -.colblock_left:first-of-type { - margin-top: 8px; -} -.colblock_right:first-of-type { - margin-top: 8px; +.colstack_item +{ + padding: 0px; + padding-top: 0px; + width: 100%; + margin-bottom: 8px; + overflow: hidden; + word-wrap: break-word; } +.colstack_head { margin-bottom: 0px; } +.colstack_left:empty { display: none; } +.colstack_right:empty { display: none; } + .colitem { padding-left: 8px; @@ -294,10 +308,7 @@ hr { color: silver; border: 1px solid silver; } text-decoration: none; color: black; } -.colitem a:hover -{ - color: silver; -} +.colitem a:hover { color: silver; } .col_left { width: 30%; @@ -317,16 +328,11 @@ hr { color: silver; border: 1px solid silver; } /*Clearfix*/ .formrow:before, .formrow:after { - content: " "; - display: table; -} -.formrow:after { - clear: both; -} -.formrow:not(:last-child) -{ - border-bottom: 1px dotted #ccc; + content: " "; + display: table; } +.formrow:after { clear: both; } +.formrow:not(:last-child) { border-bottom: 1px dotted #ccc; } .formitem { @@ -337,18 +343,9 @@ hr { color: silver; border: 1px solid silver; } padding-bottom: 8px; font-weight: bold; } -.formitem:first-child -{ - font-weight: bold; -} -.formitem:not(:last-child) -{ - border-right: 1px dotted #ccc; -} -.formitem.invisible_border -{ - border: none; -} +.formitem:first-child { font-weight: bold; } +.formitem:not(:last-child) { border-right: 1px dotted #ccc; } +.formitem.invisible_border { border: none; } /* Mostly for textareas */ .formitem:only-child { width: 100%; } @@ -583,6 +580,22 @@ blockquote p height: 20px; } +.tag-mini +{ + text-transform: none; + margin-left: 0px; + padding-left: 3px; + padding-right: 3px; + padding-top: 1.5px; + padding-bottom: 0px; + color: #505050; /* 80,80,80 */ + background-color: #FFFFFF; + border-style: dotted; + border-color: #505050; /* 232,232,232. All three RGB colours being the same seems to create a shade of gray */ + border-width: 1px; + font-size: 10px; +} + .action_button { display: block; float: left; diff --git a/themes/cosmo/public/main.css b/themes/cosmo/public/main.css index 4e849991..57b715ed 100644 --- a/themes/cosmo/public/main.css +++ b/themes/cosmo/public/main.css @@ -180,7 +180,7 @@ hr { color: silver; border: 1px solid silver; } -o-transition: color 1s; } -.rowblock, .colblock_left, .colblock_right { +.rowblock, .colblock_left, .colblock_right, .colstack_item { background: rgba(240,240,240,1); border-spacing: 0; border-collapse: collapse; @@ -249,20 +249,40 @@ hr { color: silver; border: 1px solid silver; } overflow: hidden; word-wrap: break-word; } -.colblock_left:empty -{ - display: none; -} +.colblock_left:empty { display: none; } .colblock_right:empty +{ display: none; } +.colblock_left:first-of-type { margin-top: 8px; } +.colblock_right:first-of-type { margin-top: 8px; } + +/* The new method of doing columns layouts, colblock is now deprecated */ +.colstack_left { - display: none; + float: left; + width: 30%; + margin-right: 8px; + margin-top: 12px; } -.colblock_left:first-of-type { - margin-top: 8px; +.colstack_right +{ + float: left; + width: 65%; + width: calc(70% - 15px); + margin-top: 12px; } -.colblock_right:first-of-type { - margin-top: 8px; +.colstack_item +{ + padding: 0px; + padding-top: 0px; + width: 100%; + margin-bottom: 8px; + overflow: hidden; + word-wrap: break-word; } +.colstack_head { margin-bottom: 0px; } +.colstack_left:empty { display: none; } +.colstack_right:empty { display: none; } + .colitem { padding-left: 8px; diff --git a/themes/tempra-conflux/public/main.css b/themes/tempra-conflux/public/main.css index 84058ea4..80db6346 100644 --- a/themes/tempra-conflux/public/main.css +++ b/themes/tempra-conflux/public/main.css @@ -155,10 +155,7 @@ li a padding: 0px; padding-top: 0px; } -.rowblock:empty -{ - display: none; -} +.rowblock:empty { display: none; } .colblock_left { @@ -178,14 +175,35 @@ li a overflow: hidden; word-wrap: break-word; } -.colblock_left:empty +.colblock_left:empty { display: none; } +.colblock_right:empty { display: none; } + +/* The new method of doing columns layouts, colblock is now deprecated */ +.colstack_left { - display: none; + float: left; + width: 30%; + margin-right: 8px; } -.colblock_right:empty +.colstack_right { - display: none; + float: left; + width: 65%; + width: calc(70% - 15px); } +.colstack_item +{ + border: 1px solid #ccc; + padding: 0px; + padding-top: 0px; + width: 100%; + margin-bottom: 8px; + overflow: hidden; + word-wrap: break-word; +} +.colstack_head { margin-bottom: 0px; } +.colstack_left:empty { display: none; } +.colstack_right:empty { display: none; } .rowitem { @@ -244,10 +262,7 @@ li a text-decoration: none; color: black; } -.colitem a:hover -{ - color: silver; -} +.colitem a:hover { color: silver; } .formrow { diff --git a/themes/tempra-cursive/public/main.css b/themes/tempra-cursive/public/main.css index e2b64348..eae4c190 100644 --- a/themes/tempra-cursive/public/main.css +++ b/themes/tempra-cursive/public/main.css @@ -167,6 +167,33 @@ li a .colblock_left:empty { display: none; } .colblock_right:empty { display: none; } +/* The new method of doing columns layouts, colblock is now deprecated */ +.colstack_left +{ + float: left; + width: 30%; + margin-right: 8px; +} +.colstack_right +{ + float: left; + width: 65%; + width: calc(70% - 15px); +} +.colstack_item +{ + border: 1px solid #ccc; + padding: 0px; + padding-top: 0px; + width: 100%; + margin-bottom: 8px; + overflow: hidden; + word-wrap: break-word; +} +.colstack_head { margin-bottom: 0px; } +.colstack_left:empty { display: none; } +.colstack_right:empty { display: none; } + .rowhead { font-family: cursive; } .rowitem { diff --git a/themes/tempra-simple/public/main.css b/themes/tempra-simple/public/main.css index 9085d15e..b20191ee 100644 --- a/themes/tempra-simple/public/main.css +++ b/themes/tempra-simple/public/main.css @@ -167,6 +167,33 @@ li a .colblock_left:empty { display: none; } .colblock_right:empty { display: none; } +/* The new method of doing columns layouts, colblock is now deprecated */ +.colstack_left +{ + float: left; + width: 30%; + margin-right: 8px; +} +.colstack_right +{ + float: left; + width: 65%; + width: calc(70% - 15px); +} +.colstack_item +{ + border: 1px solid #ccc; + padding: 0px; + padding-top: 0px; + width: 100%; + margin-bottom: 8px; + overflow: hidden; + word-wrap: break-word; +} +.colstack_head { margin-bottom: 0px; } +.colstack_left:empty { display: none; } +.colstack_right:empty { display: none; } + .rowitem { width: 100%;