add: channels, messages
This commit is contained in:
parent
67492cf73f
commit
7774124bd0
40 changed files with 2238 additions and 115 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue