Fix moderation issues #1156 #1157
No reviewers
Labels
No labels
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Plume/Plume#1157
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "gro2bl/Plume:fix_moderation_issues"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR includes the fixes for issues mentioned in #1156
the changes looks sensible, but i have a few codestyle issues
@ -90,0 +90,4 @@} else {@if ctx.2.clone().map(|u| u.is_moderator()).unwrap_or(false) {<a href="@uri!(instance::admin_mod)">@i18n!(ctx.1, "Moderation")</a>}codestyle:
done
@ -0,0 +7,4 @@<h1>@i18n!(ctx.1, title)</h1>@tabs(&[(&uri!(instance::admin).to_string(), i18n!(ctx.1, "Configuration"), if selected_tab == 1 {true} else {false}),can you replace all the
if selected_tab == 1 {true} else {false}to simpleselected_tab == 1please?done
@ -0,0 +18,4 @@@tabs(&[(&uri!(instance::admin_instances: page = _).to_string(), i18n!(ctx.1, "Instances"), if selected_tab == 1 {true} else {false}),(&uri!(instance::admin_users: page = _).to_string(), i18n!(ctx.1, "Users"), if selected_tab == 2 {true} else {false}),(&uri!(instance::admin_email_blocklist: page=_).to_string(), i18n!(ctx.1, "Email blocklist"), if selected_tab == 3 {true} else {false})oh, i get why the conditions elsewhere. This would be a lot easier to understand if the numbers used for the moderation half be the same (2,3,4) as the admin half. No needs for branch everywhere
done
@ -12,3 +7,1 @@(&uri!(instance::admin_instances: page = _).to_string(), i18n!(ctx.1, "Instances"), false),(&uri!(instance::admin_users: page = _).to_string(), i18n!(ctx.1, "Users"), false),])@:admin_header(ctx, "Moderation", 0)shouldn't it be 1 instead of 0?
There is an inconsistency problem on how
admin.rs.htmlhandles default tab and howadmin_mod.rs.htmldoes it. Actually the Configuration tab has been hardcoded insideadmin.rs.htmlwhich is not available inadmin_mod.rs.html. Also other tabs have their own layout (i.e. they are not a child template) so it's not feasible to include the first moderation tab (Instances) by default to be loaded in/adminwhen the user is a moderator. I just left it as is for you to make a decision:/adminto their first tab route, both for admin and moderator, this needs the creation of a separate template for Configuration tab and then bothadmin.rs.htmlandadmin_mod.rs.htmlwould be useless./adminand instead of tabs on the top, use some other type of UX component to show different pages./adminroute and do the #1.If you want I can go for one of these or any other idea you have but the
0,1or even2doesn't make any difference here, the result would be an empty admin page with some tabs.I agree that 0 or 1 changes nothing, i just find it more coherent. We are in a way on the configuration tab which refused to load. But yeah, the html generated is the same either way (2 would change slightly the result, showing
Instancesas the selected tab i believe)2 It shows Instances as selected tab but without the instances page template because "Instances" template is a whole page template not a partial template and we cannot include it as a child inside admin_mod. that's why we might need to do one of those 3 solutions I mentioned above.
@ -13,2 +7,2 @@(&uri!(instance::admin_email_blocklist:page=_).to_string(), i18n!(ctx.1, "Email blocklist"), true),])@:base(ctx, i18n!(ctx.1, "Blocklisted Emails"), {}, {}, {@:admin_header(ctx, "Blocklisted Emails", (if ctx.2.clone().map(|u| u.is_admin()).unwrap() {4} else {3}))it looks to me like it was always 4th entry before, why is it now sometime 3rd?
@ -14,3 +9,1 @@(&uri!(instance::admin_users: page = _).to_string(), i18n!(ctx.1, "Users"), false),(&uri!(instance::admin_email_blocklist:page=_).to_string(), i18n!(ctx.1, "Email blocklist"), false),])@:admin_header(ctx, "Instances", (if ctx.2.clone().map(|u| u.is_admin()).unwrap() {2} else {1}))why not always 2?
@ -14,3 +9,1 @@(&uri!(instance::admin_users: page = _).to_string(), i18n!(ctx.1, "Users"), true),(&uri!(instance::admin_email_blocklist: page=_).to_string(), i18n!(ctx.1, "Email blocklist"), false)])@:admin_header(ctx, "Users", (if ctx.2.clone().map(|u| u.is_admin()).unwrap() {3} else {2}))why not always 3?