add: ability to set home to stack

This commit is contained in:
trisua 2025-05-09 16:23:40 -04:00
parent 870289a5bb
commit 5df0ea6152
4 changed files with 31 additions and 13 deletions

View file

@ -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",