add: channels, messages

This commit is contained in:
trisua 2025-04-27 23:11:37 -04:00
parent 67492cf73f
commit 7774124bd0
40 changed files with 2238 additions and 115 deletions

View file

@ -525,6 +525,14 @@ pub async fn settings_request(
));
}
let channels = match data.0.get_channels_by_community(community.id).await {
Ok(p) => p,
Err(e) => return Err(Html(render_error(e, &jar, &data, &Some(user)).await)),
};
let can_manage_channels = membership.role.check(CommunityPermission::MANAGE_CHANNELS)
| user.permissions.check(FinePermission::MANAGE_CHANNELS);
// init context
let lang = get_lang!(jar, data.0);
let mut context = initial_context(&data.0.0, lang, &Some(user)).await;
@ -535,6 +543,9 @@ pub async fn settings_request(
&clean_context(&community.context),
);
context.insert("can_manage_channels", &can_manage_channels);
context.insert("channels", &channels);
// return
Ok(Html(
data.1