show notification badge in menu
This commit is contained in:
@ -23,7 +23,7 @@ use tera::Context;
|
||||
use crate::model::{
|
||||
notification::Notification,
|
||||
role::Role,
|
||||
user::{User, UserWithRoles},
|
||||
user::{User, UserWithRolesAndNotificationCount},
|
||||
};
|
||||
|
||||
pub(crate) mod admin;
|
||||
@ -53,7 +53,10 @@ async fn index(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage<'_
|
||||
}
|
||||
|
||||
context.insert("notifications", &Notification::for_user(db, &user).await);
|
||||
context.insert("loggedin_user", &UserWithRoles::from_user(user, db).await);
|
||||
context.insert(
|
||||
"loggedin_user",
|
||||
&UserWithRolesAndNotificationCount::from_user(user, db).await,
|
||||
);
|
||||
Template::render("index", context.into_json())
|
||||
}
|
||||
|
||||
@ -75,7 +78,10 @@ async fn steering(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage
|
||||
context.insert("coxes", &coxes);
|
||||
context.insert("bootskundige", &bootskundige);
|
||||
|
||||
context.insert("loggedin_user", &UserWithRoles::from_user(user, db).await);
|
||||
context.insert(
|
||||
"loggedin_user",
|
||||
&UserWithRolesAndNotificationCount::from_user(user, db).await,
|
||||
);
|
||||
Template::render("steering", context.into_json())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user