From 0fa9a3fca10b0d625742bfef1e3afc9273694423 Mon Sep 17 00:00:00 2001 From: Azareal Date: Fri, 6 Dec 2019 09:57:44 +1000 Subject: [PATCH] Revamp reglog UI to handle spambots better. Shorten some reglog phrase names. Shorten some modlog phrase names. Add account_privacy phrase. Tweak account_blocked phrase. Add account_menu_privacy phrase. Add account_privacy_head phrase. Add account_privacy_profile_comments phrase. Add account_privacy_button phrase. --- langs/english.json | 48 +++++++++++++++------------ routes/panel/logs.go | 14 ++++---- templates/panel_modlogs.html | 8 ++--- templates/panel_reglogs.html | 24 +++++--------- themes/cosora/public/panel.css | 12 +++++++ themes/nox/public/panel.css | 20 +++++++---- themes/nox/theme.json | 2 +- themes/shadow/public/panel.css | 7 ++++ themes/tempra_simple/public/panel.css | 7 ++++ 9 files changed, 85 insertions(+), 57 deletions(-) diff --git a/langs/english.json b/langs/english.json index 9b92fdea..38d32132 100644 --- a/langs/english.json +++ b/langs/english.json @@ -140,11 +140,12 @@ "profile": "%s's Profile", "account":"My Account", "account_password":"Edit Password", + "account_privacy":"Privacy", "account_mfa":"Manage 2FA", "account_mfa_setup":"Setup 2FA", "account_email":"Email Manager", "account_logins":"Logins", - "account_blocked":"Blocked", + "account_blocked":"Blocks", "account_penalties":"Penalties", "account_level_list":"Level Progress", "convos":"Conversations", @@ -503,6 +504,7 @@ "account_menu_security":"Security", "account_menu_notifications":"Notifications", "account_menu_logins":"Logins", + "account_menu_privacy":"Privacy", "account_menu_blocked":"Blocked", "account_menu_penalties":"Penalties", "account_menu_messages":"Messages", @@ -533,6 +535,10 @@ "account_password_confirm_password":"Confirm Password", "account_password_update_button":"Update", + "account_privacy_head":"Privacy", + "account_privacy_profile_comments":"Enable Profile Comments", + "account_privacy_button":"Update", + "account_mfa_head":"Manage 2FA", "account_mfa_disable_explanation":"You can disable two-factor authentication on your account and go back to logging in normal with just your password by clicking on the following button.", "account_mfa_disable_button":"Disable 2FA", @@ -1001,27 +1007,27 @@ "panel_statistics_memory_no_memory":"No memory chunks could be found in the selected time range", "panel_logs_menu_head":"Logs", - "panel_logs_registration_head":"Registrations", - "panel_logs_registration_attempt":"Attempt", - "panel_logs_registration_email":"email", - "panel_logs_registration_reason":"reason", - "panel_logs_registration_no_logs":"There aren't any registrations logged.", + "panel_logs_reg_head":"Registrations", + "panel_logs_reg_attempt":"Attempt: ", + "panel_logs_reg_email":"email: ", + "panel_logs_reg_reason":"reason: ", + "panel_logs_reg_no_logs":"There aren't any registrations logged.", - "panel_logs_moderation_head":"Mod Action Logs", - "panel_logs_moderation_action_topic_stick":"%s was pinned by %s", - "panel_logs_moderation_action_topic_unstick":"%s was unpinned by %s", - "panel_logs_moderation_action_topic_lock":"%s was locked by %s", - "panel_logs_moderation_action_topic_unlock":"%s was reopened by %s", - "panel_logs_moderation_action_topic_delete":"Topic #%d was deleted by %s", - "panel_logs_moderation_action_topic_move":"%s was moved by %s", - "panel_logs_moderation_action_topic_move_dest":"%s was moved to %s by %s", - "panel_logs_moderation_action_topic_unknown":"Unknown action '%s' on elementType '%s' by %s", - "panel_logs_moderation_action_reply_delete":"A reply in %s was deleted by %s", - "panel_logs_moderation_action_user_ban":"%s was banned by %s", - "panel_logs_moderation_action_user_unban":"%s was unbanned by %s", - "panel_logs_moderation_action_user_activate":"%s was activated by %s", - "panel_logs_moderation_action_unknown":"Unknown action '%s' on elementType '%s' by %s", - "panel_logs_moderation_no_logs":"There aren't any events logged.", + "panel_logs_mod_head":"Mod Action Logs", + "panel_logs_mod_action_topic_stick":"%s was pinned by %s", + "panel_logs_mod_action_topic_unstick":"%s was unpinned by %s", + "panel_logs_mod_action_topic_lock":"%s was locked by %s", + "panel_logs_mod_action_topic_unlock":"%s was reopened by %s", + "panel_logs_mod_action_topic_delete":"Topic #%d was deleted by %s", + "panel_logs_mod_action_topic_move":"%s was moved by %s", + "panel_logs_mod_action_topic_move_dest":"%s was moved to %s by %s", + "panel_logs_mod_action_topic_unknown":"Unknown action '%s' on elementType '%s' by %s", + "panel_logs_mod_action_reply_delete":"A reply in %s was deleted by %s", + "panel_logs_mod_action_user_ban":"%s was banned by %s", + "panel_logs_mod_action_user_unban":"%s was unbanned by %s", + "panel_logs_mod_action_user_activate":"%s was activated by %s", + "panel_logs_mod_action_unknown":"Unknown action '%s' on elementType '%s' by %s", + "panel_logs_mod_no_logs":"There aren't any events logged.", "user_unknown":"Unknown", "topic_unknown":"Unknown", diff --git a/routes/panel/logs.go b/routes/panel/logs.go index b9a1584c..d314a835 100644 --- a/routes/panel/logs.go +++ b/routes/panel/logs.go @@ -55,7 +55,7 @@ func handleUnknownTopic(topic *c.Topic, err error) *c.Topic { // TODO: Move the log building logic into /common/ and it's own abstraction func topicElementTypeAction(action string, elementType string, elementID int, actor *c.User, topic *c.Topic) (out string) { if action == "delete" { - return p.GetTmplPhrasef("panel_logs_moderation_action_topic_delete", elementID, actor.Link, actor.Name) + return p.GetTmplPhrasef("panel_logs_mod_action_topic_delete", elementID, actor.Link, actor.Name) } var tbit string aarr := strings.Split(action, "-") @@ -67,15 +67,15 @@ func topicElementTypeAction(action string, elementType string, elementID int, ac fid, _ := strconv.Atoi(aarr[1]) forum, err := c.Forums.Get(fid) if err == nil { - return p.GetTmplPhrasef("panel_logs_moderation_action_topic_move_dest", topic.Link, topic.Title, forum.Link, forum.Name, actor.Link, actor.Name) + return p.GetTmplPhrasef("panel_logs_mod_action_topic_move_dest", topic.Link, topic.Title, forum.Link, forum.Name, actor.Link, actor.Name) } } tbit = "move" default: - return p.GetTmplPhrasef("panel_logs_moderation_action_topic_unknown", action, elementType, actor.Link, actor.Name) + return p.GetTmplPhrasef("panel_logs_mod_action_topic_unknown", action, elementType, actor.Link, actor.Name) } if tbit != "" { - return p.GetTmplPhrasef("panel_logs_moderation_action_topic_"+tbit, topic.Link, topic.Title, actor.Link, actor.Name) + return p.GetTmplPhrasef("panel_logs_mod_action_topic_"+tbit, topic.Link, topic.Title, actor.Link, actor.Name) } return fmt.Sprintf(out, topic.Link, topic.Title, actor.Link, actor.Name) } @@ -87,15 +87,15 @@ func modlogsElementType(action string, elementType string, elementID int, actor out = topicElementTypeAction(action, elementType, elementID, actor, topic) case "user": targetUser := handleUnknownUser(c.Users.Get(elementID)) - out = p.GetTmplPhrasef("panel_logs_moderation_action_user_"+action, targetUser.Link, targetUser.Name, actor.Link, actor.Name) + out = p.GetTmplPhrasef("panel_logs_mod_action_user_"+action, targetUser.Link, targetUser.Name, actor.Link, actor.Name) case "reply": if action == "delete" { topic := handleUnknownTopic(c.TopicByReplyID(elementID)) - out = p.GetTmplPhrasef("panel_logs_moderation_action_reply_delete", topic.Link, topic.Title, actor.Link, actor.Name) + out = p.GetTmplPhrasef("panel_logs_mod_action_reply_delete", topic.Link, topic.Title, actor.Link, actor.Name) } } if out == "" { - out = p.GetTmplPhrasef("panel_logs_moderation_action_unknown", action, elementType, actor.Link, actor.Name) + out = p.GetTmplPhrasef("panel_logs_mod_action_unknown", action, elementType, actor.Link, actor.Name) } return out } diff --git a/templates/panel_modlogs.html b/templates/panel_modlogs.html index 54607025..2833cd9e 100644 --- a/templates/panel_modlogs.html +++ b/templates/panel_modlogs.html @@ -1,5 +1,5 @@
-

{{lang "panel_logs_moderation_head"}}

+

{{lang "panel_logs_mod_head"}}

{{range .Logs}} @@ -13,10 +13,6 @@
- {{else}} -
- {{lang "panel_logs_moderation_no_logs"}} -
- {{end}} + {{else}}
{{lang "panel_logs_mod_no_logs"}}
{{end}} {{template "paginator.html" . }} \ No newline at end of file diff --git a/templates/panel_reglogs.html b/templates/panel_reglogs.html index 764ecec2..6752b09e 100644 --- a/templates/panel_reglogs.html +++ b/templates/panel_reglogs.html @@ -1,22 +1,16 @@
-

{{lang "panel_logs_registration_head"}}

+

{{lang "panel_logs_reg_head"}}

-
+
{{range .Logs}}
- - {{if not .Success}}{{lang "panel_logs_registration_attempt"}}: {{end}}{{.Username}}{{if .Email}} ({{lang "panel_logs_registration_email"}}: {{.Email}}){{end}}{{if .ParsedReason}} ({{lang "panel_logs_registration_reason"}}: {{.ParsedReason}}){{end}} - {{if $.CurrentUser.Perms.ViewIPs}}
{{.IP}}{{end}} -
- - {{.DoneAt}} - -
+ {{if not .Success}}{{lang "panel_logs_reg_attempt"}}{{end}}{{.Username}}{{if .Email}} ({{lang "panel_logs_reg_email"}}{{.Email}}){{end}}{{if .ParsedReason}} ({{lang "panel_logs_reg_reason"}}{{.ParsedReason}}){{end}} +
+ {{if $.CurrentUser.Perms.ViewIPs}}{{.IP}}{{end}} + {{.DoneAt}} +
+
- {{else}} - - {{end}} + {{else}}{{end}}
{{template "paginator.html" . }} \ No newline at end of file diff --git a/themes/cosora/public/panel.css b/themes/cosora/public/panel.css index fabf5524..837be370 100644 --- a/themes/cosora/public/panel.css +++ b/themes/cosora/public/panel.css @@ -395,6 +395,18 @@ select + .timeRangeSelector { margin-bottom: 18px; } +#panel_reglogs .panel_compactrow { + flex-direction: column; +} +.logdetail { + display: flex; + width: 100%; + margin-top: 4px; +} +#panel_reglogs .logdetail small, #panel_reglogs .logdetails span { + font-size: 14px; +} + .pageset { margin-left: 16px; } diff --git a/themes/nox/public/panel.css b/themes/nox/public/panel.css index 669216c8..5d7b9c0f 100644 --- a/themes/nox/public/panel.css +++ b/themes/nox/public/panel.css @@ -26,9 +26,6 @@ .menu_stats { margin-left: 4px; } -/*.back_to_site { - font-size: 18px; -}*/ .above_right { background-color: rgb(62, 62, 62); margin-top: -12px; @@ -397,10 +394,7 @@ span.grip::after { padding-top: 12px; padding-bottom: 12px; } -#widgetTmpl { - display: none; -} -.widget_disabled { +#widgetTmpl, .widget_disabled { display: none; } .bg_red .widget_disabled { @@ -417,6 +411,18 @@ span.grip::after { height: 80px; } +#panel_reglogs .panel_compactrow { + flex-direction: column; +} +.logdetail { + display: flex; + width: 100%; + margin-top: 3px; +} +#panel_reglogs .logdetail small, #panel_reglogs .logdetails span { + font-size: 14px; +} + #panel_debug .grid_stat:not(.grid_stat_head) { margin-bottom: 5px; } diff --git a/themes/nox/theme.json b/themes/nox/theme.json index 4b4e7a3e..fffdfa28 100644 --- a/themes/nox/theme.json +++ b/themes/nox/theme.json @@ -1,6 +1,6 @@ { "Name": "nox", - "FriendlyName": "Nox (Incomplete)", + "FriendlyName": "Nox", "Version": "0.0.1", "Creator": "Azareal", "URL": "github.com/Azareal/Gosora", diff --git a/themes/shadow/public/panel.css b/themes/shadow/public/panel.css index 961de724..c35a7e9c 100644 --- a/themes/shadow/public/panel.css +++ b/themes/shadow/public/panel.css @@ -152,6 +152,13 @@ select + .timeRangeSelector { display: block; } +.logdetail { + margin-top: 4px; +} +#panel_reglogs .logdetail small, #panel_reglogs .logdetails span { + font-size: 12px; +} + .pageset { margin-left: 0px; margin-bottom: 0px; diff --git a/themes/tempra_simple/public/panel.css b/themes/tempra_simple/public/panel.css index eeab1c6a..3fe066b0 100644 --- a/themes/tempra_simple/public/panel.css +++ b/themes/tempra_simple/public/panel.css @@ -198,4 +198,11 @@ select + .timeRangeSelector { content: ""; display: block; clear: both; +} + +.logdetail { + margin-top: 5px; +} +#panel_reglogs .logdetail small, #panel_reglogs .logdetails span { + font-size: 14px; } \ No newline at end of file