diff --git a/crates/app/src/assets.rs b/crates/app/src/assets.rs index 36ef889..225c842 100644 --- a/crates/app/src/assets.rs +++ b/crates/app/src/assets.rs @@ -54,6 +54,10 @@ pub const COMMUNITIES_SETTINGS: &str = include_str!("./public/html/communities/s pub const TIMELINES_HOME: &str = include_str!("./public/html/timelines/home.html"); pub const TIMELINES_POPULAR: &str = include_str!("./public/html/timelines/popular.html"); +pub const MOD_AUDIT_LOG: &str = include_str!("./public/html/mod/audit_log.html"); +pub const MOD_REPORTS: &str = include_str!("./public/html/mod/reports.html"); +pub const MOD_FILE_REPORT: &str = include_str!("./public/html/mod/file_report.html"); + // langs pub const LANG_EN_US: &str = include_str!("./langs/en-US.toml"); @@ -173,6 +177,10 @@ pub(crate) async fn write_assets(config: &Config) -> PathBufD { write_template!(html_path->"timelines/home.html"(crate::assets::TIMELINES_HOME) -d "timelines" --config=config); write_template!(html_path->"timelines/popular.html"(crate::assets::TIMELINES_POPULAR) --config=config); + write_template!(html_path->"mod/audit_log.html"(crate::assets::MOD_AUDIT_LOG) -d "mod" --config=config); + write_template!(html_path->"mod/reports.html"(crate::assets::MOD_REPORTS) --config=config); + write_template!(html_path->"mod/file_report.html"(crate::assets::MOD_FILE_REPORT) --config=config); + html_path } diff --git a/crates/app/src/langs/en-US.toml b/crates/app/src/langs/en-US.toml index be21778..5af0496 100644 --- a/crates/app/src/langs/en-US.toml +++ b/crates/app/src/langs/en-US.toml @@ -7,9 +7,18 @@ version = "1.0.0" "general:link.communities" = "Communities" "general:link.next" = "Next" "general:link.previous" = "Previous" +"general:link.source_code" = "Source code" +"general:link.audit_log" = "Audit log" +"general:link.reports" = "Reports" "general:action.save" = "Save" "general:action.delete" = "Delete" "general:action.back" = "Back" +"general:action.report" = "Report" +"general:action.manage" = "Manage" +"general:label.mod" = "Mod" +"general:label.file_report" = "File report" +"general:label.account_banned" = "Account banned" +"general:label.account_banned_body" = "Your account has been banned for violating our policies." "dialog:action.okay" = "Ok" "dialog:action.continue" = "Continue" @@ -72,3 +81,5 @@ version = "1.0.0" "settings:label.new_username" = "New username" "settings:label.change_avatar" = "Change avatar" "settings:label.change_banner" = "Change banner" + +"mod_panel:label.open_reported_content" = "Open reported content" diff --git a/crates/app/src/macros.rs b/crates/app/src/macros.rs index 94c5404..5966377 100644 --- a/crates/app/src/macros.rs +++ b/crates/app/src/macros.rs @@ -63,7 +63,13 @@ macro_rules! get_user_from_token { )) .await { - Ok(ua) => Some(ua), + Ok(ua) => { + if ua.permissions.check_banned() { + Some(tetratto_core::model::auth::User::banned()) + } else { + Some(ua) + } + } Err(_) => None, } } else { diff --git a/crates/app/src/public/html/communities/base.html b/crates/app/src/public/html/communities/base.html index 10e08b4..838ca69 100644 --- a/crates/app/src/public/html/communities/base.html +++ b/crates/app/src/public/html/communities/base.html @@ -15,14 +15,42 @@ {{ components::community_avatar(id=community.id, community=community, size="72px") }}