diff --git a/server/src/home.rs b/server/src/home.rs index 0ac2a65..e8fd3f7 100644 --- a/server/src/home.rs +++ b/server/src/home.rs @@ -1,7 +1,7 @@ use crate::{ error::Error, extensions::{ProfileExt, SubmissionExt}, - images::IconImage, + images::ThumbnailImage, middleware::UserProfile, nav::NavState, pagination::{ @@ -13,7 +13,7 @@ use crate::{ }; use actix_web::{web, HttpRequest, HttpResponse}; use hyaenidae_accounts::User; -use hyaenidae_toolkit::{Button, IndicatorColor, Tile}; +use hyaenidae_toolkit::{Button, IndicatorColor, Thumbnail}; use uuid::Uuid; pub(crate) async fn home( @@ -82,7 +82,7 @@ impl ViewHomeState { Ok(state) } - pub(crate) fn submissions(&self) -> Vec { + pub(crate) fn submissions(&self) -> Vec { self.submissions .iter() .filter_map(move |submission_id| { @@ -94,18 +94,20 @@ impl ViewHomeState { let file = self.cache.file_map.get(&file_id)?; let key = file.pictrs_key()?; - let tile = Tile::new(IconImage::new(key, &submission.title_text())) - .title(&submission.title_text()) - .description(&author.name()) - .link(&submission.view_path()); + let thumb = Thumbnail::new( + ThumbnailImage::new(key, &submission.title_text()), + &submission.view_path(), + ) + .title(&submission.title_text()) + .author(&author.name(), &author.view_path()); if submission.files().len() > 1 { - Some(tile.indicator( + Some(thumb.indicator( &format!("+{}", submission.files().len() - 1), IndicatorColor::White, )) } else { - Some(tile) + Some(thumb) } }) .collect() diff --git a/server/templates/index.rs.html b/server/templates/index.rs.html index 054202c..b1c286b 100644 --- a/server/templates/index.rs.html +++ b/server/templates/index.rs.html @@ -3,7 +3,7 @@ @use crate::templates::layouts::home; @use hyaenidae_toolkit::templates::button_group; @use hyaenidae_toolkit::{templates::{card, card_body, card_section, card_title}, Card}; -@use hyaenidae_toolkit::{templates::{tile, tiles}, Tiles}; +@use hyaenidae_toolkit::templates::{thumbnail, thumbnails}; @(home_view: &ViewHomeState, nav_state: &NavState) @@ -11,9 +11,9 @@ @:card(&Card::full_width().dark(nav_state.dark()), { @:card_title({ Submissions }) @:card_section({ - @:tiles(&Tiles::new(), { - @for t in home_view.submissions() { - @:tile(&t) + @:thumbnails({ + @for thumb in home_view.submissions() { + @:thumbnail(&thumb) } }) })