add: ability to set home to stack
This commit is contained in:
parent
870289a5bb
commit
5df0ea6152
4 changed files with 31 additions and 13 deletions
|
@ -11,7 +11,7 @@ use axum::{
|
|||
use axum_extra::extract::CookieJar;
|
||||
use serde::Deserialize;
|
||||
use tera::Context;
|
||||
use tetratto_core::model::{Error, auth::User, communities::Community, permissions::FinePermission};
|
||||
use tetratto_core::model::{auth::User, communities::Community, permissions::FinePermission, Error};
|
||||
use tetratto_shared::hash::hash;
|
||||
use contrasted::{Color, MINIMUM_CONTRAST_THRESHOLD};
|
||||
|
||||
|
@ -49,12 +49,20 @@ pub async fn settings_request(
|
|||
}
|
||||
};
|
||||
|
||||
let stacks = match data.0.get_stacks_by_owner(profile.id).await {
|
||||
Ok(ua) => ua,
|
||||
Err(e) => {
|
||||
return Err(Html(render_error(e, &jar, &data, &None).await));
|
||||
}
|
||||
};
|
||||
|
||||
let tokens = profile.tokens.clone();
|
||||
|
||||
let lang = get_lang!(jar, data.0);
|
||||
let mut context = initial_context(&data.0.0, lang, &Some(user)).await;
|
||||
|
||||
context.insert("profile", &profile);
|
||||
context.insert("stacks", &stacks);
|
||||
context.insert("user_settings_serde", &clean_settings(&profile.settings));
|
||||
context.insert(
|
||||
"user_tokens_serde",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue