add: communities list page

TODO(ui): implement community creation, community viewing, community posting
TODO(ui): implement profile following, followers, and posts feed
This commit is contained in:
trisua 2025-03-27 18:10:47 -04:00
parent 5cfca49793
commit d6fbfc3cd6
28 changed files with 497 additions and 313 deletions

View file

@ -1,4 +1,5 @@
pub mod auth;
pub mod communities;
pub mod misc;
pub mod profile;
@ -21,16 +22,18 @@ pub fn routes() -> Router {
.route("/auth/login", get(auth::login_request))
// profile
.route("/user/{username}", get(profile::posts_request))
// communities
.route("/communities", get(communities::list_request))
}
pub fn render_error(
pub async fn render_error(
e: Error,
jar: &CookieJar,
data: &(DataManager, tera::Tera),
user: &Option<User>,
) -> String {
let lang = get_lang!(jar, data.0);
let mut context = initial_context(&data.0.0, lang, &user);
let mut context = initial_context(&data.0.0, lang, &user).await;
context.insert("error_text", &e.to_string());
data.1.render("misc/error.html", &mut context).unwrap()
}