add: better quote post ui
This commit is contained in:
parent
fb2a9285d2
commit
2b91422d18
8 changed files with 138 additions and 102 deletions
|
@ -95,6 +95,19 @@ macro_rules! get_lang {
|
|||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! user_banned {
|
||||
($user:expr, $other_user:ident, $data:ident, $jar:ident) => {
|
||||
let lang = get_lang!($jar, $data.0);
|
||||
let mut context = initial_context(&$data.0.0, lang, &$user).await;
|
||||
context.insert("profile", &$other_user);
|
||||
|
||||
return Ok(Html(
|
||||
$data.1.render("profile/banned.html", &context).unwrap(),
|
||||
));
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! check_user_blocked_or_private {
|
||||
($user:expr, $other_user:ident, $data:ident, $jar:ident) => {
|
||||
|
@ -115,13 +128,13 @@ macro_rules! check_user_blocked_or_private {
|
|||
|
||||
// check if other user is banned
|
||||
if $other_user.permissions.check_banned() {
|
||||
let lang = get_lang!($jar, $data.0);
|
||||
let mut context = initial_context(&$data.0.0, lang, &$user).await;
|
||||
context.insert("profile", &$other_user);
|
||||
|
||||
return Ok(Html(
|
||||
$data.1.render("profile/banned.html", &context).unwrap(),
|
||||
));
|
||||
if let Some(ref ua) = $user {
|
||||
if !ua.permissions.check(FinePermission::MANAGE_USERS) {
|
||||
$crate::user_banned!($user, $other_user, $data, $jar);
|
||||
}
|
||||
} else {
|
||||
$crate::user_banned!($user, $other_user, $data, $jar);
|
||||
}
|
||||
}
|
||||
|
||||
// check if we're blocked
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue