diff --git a/templates/base.rs.html b/templates/base.rs.html
index 3940bf4d..711ed238 100644
--- a/templates/base.rs.html
+++ b/templates/base.rs.html
@@ -87,10 +87,8 @@
@i18n!(ctx.1, "Privacy policy")
@if ctx.2.clone().map(|u| u.is_admin()).unwrap_or(false) {
@i18n!(ctx.1, "Administration")
- } else {
- @if ctx.2.clone().map(|u| u.is_moderator()).unwrap_or(false) {
- @i18n!(ctx.1, "Moderation")
- }
+ } else if ctx.2.clone().map(|u| u.is_moderator()).unwrap_or(false) {
+ @i18n!(ctx.1, "Moderation")
}
diff --git a/templates/instance/admin_header.rs.html b/templates/instance/admin_header.rs.html
index 299ef565..7794f39f 100644
--- a/templates/instance/admin_header.rs.html
+++ b/templates/instance/admin_header.rs.html
@@ -3,21 +3,19 @@
@(ctx: BaseContext, title: &str, selected_tab: u8)
-@if ctx.2.clone().map(|u| u.is_admin()).unwrap_or(false) {
-
@i18n!(ctx.1, title)
+
@i18n!(ctx.1, title)
+@if ctx.2.clone().map(|u| u.is_admin()).unwrap_or(false) {
@tabs(&[
- (&uri!(instance::admin).to_string(), i18n!(ctx.1, "Configuration"), if selected_tab == 1 {true} else {false}),
- (&uri!(instance::admin_instances: page = _).to_string(), i18n!(ctx.1, "Instances"), if selected_tab == 2 {true} else {false}),
- (&uri!(instance::admin_users: page = _).to_string(), i18n!(ctx.1, "Users"), if selected_tab == 3 {true} else {false}),
- (&uri!(instance::admin_email_blocklist: page=_).to_string(), i18n!(ctx.1, "Email blocklist"), if selected_tab == 4 {true} else {false})
+ (&uri!(instance::admin).to_string(), i18n!(ctx.1, "Configuration"), selected_tab == 1),
+ (&uri!(instance::admin_instances: page = _).to_string(), i18n!(ctx.1, "Instances"), selected_tab == 2),
+ (&uri!(instance::admin_users: page = _).to_string(), i18n!(ctx.1, "Users"), selected_tab == 3),
+ (&uri!(instance::admin_email_blocklist: page=_).to_string(), i18n!(ctx.1, "Email blocklist"), selected_tab == 4)
])
} else {
-
@i18n!(ctx.1, "Moderation")
-
@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})
+ (&uri!(instance::admin_instances: page = _).to_string(), i18n!(ctx.1, "Instances"), selected_tab == 2),
+ (&uri!(instance::admin_users: page = _).to_string(), i18n!(ctx.1, "Users"), selected_tab == 3),
+ (&uri!(instance::admin_email_blocklist: page=_).to_string(), i18n!(ctx.1, "Email blocklist"), selected_tab == 4)
])
}
diff --git a/templates/instance/emailblocklist.rs.html b/templates/instance/emailblocklist.rs.html
index 32c7ea6e..7e82cea4 100644
--- a/templates/instance/emailblocklist.rs.html
+++ b/templates/instance/emailblocklist.rs.html
@@ -5,7 +5,7 @@
@(ctx:BaseContext, emails: Vec
, page:i32, n_pages:i32)
@: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}))
+ @:admin_header(ctx, "Blocklisted Emails", 4)