forked from Ruderverein-Donau-Linz/rowt
send loggedin_user in /admin/user
This commit is contained in:
parent
194577f9bd
commit
f034a780a2
@ -3,7 +3,6 @@
|
||||
|
||||
# Notes / Bugfixes
|
||||
- [ ] User loggedin status not present on user admin interface (header/footer not rendering) [ph]
|
||||
- [ ] is_cox: cox can become cox and than rower at the same event, (rower and than cox -> exception working) [ph]
|
||||
- [ ] Mobile Breakpoint: Add user broken user admin interface [mb]
|
||||
|
||||
# Frontend Process
|
||||
|
@ -204,8 +204,9 @@ impl<'r> FromRequest<'r> for CoxUser {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct AdminUser {
|
||||
user: User,
|
||||
pub(crate) user: User,
|
||||
}
|
||||
|
||||
impl TryFrom<User> for AdminUser {
|
||||
|
@ -9,9 +9,12 @@ use rocket_dyn_templates::{context, Template};
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[get("/user")]
|
||||
async fn index(db: &State<SqlitePool>, _admin: AdminUser) -> Template {
|
||||
async fn index(db: &State<SqlitePool>, admin: AdminUser) -> Template {
|
||||
let users = User::all(db).await;
|
||||
Template::render("admin/user/index", context!(users))
|
||||
Template::render(
|
||||
"admin/user/index",
|
||||
context!(users, loggedin_user: admin.user),
|
||||
)
|
||||
}
|
||||
|
||||
#[get("/user/<user>/reset-pw")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user