hyaenidae/server/templates/feed/index.rs.html
2021-01-23 22:04:27 -06:00

37 lines
1.3 KiB
HTML

@use crate::extensions::ProfileExt;
@use crate::feed::ViewFeedState;
@use crate::nav::NavState;
@use crate::templates::layouts::home;
@use hyaenidae_toolkit::templates::button_group;
@use hyaenidae_toolkit::{templates::{card, card_body, card_title, card_section}, Card};
@use hyaenidae_toolkit::templates::{thumbnail, thumbnails};
@(state: &ViewFeedState, nav_state: &NavState)
@:home("Feed", &format!("{}'s feed on Hyaenidae", state.profile.name()), nav_state, {}, {
@:card(&Card::full_width().dark(nav_state.dark()), {
@if state.has_submissions() {
@:card_title({ Feed })
@:card_section({
@:thumbnails({
@for view in state.submissions() {
@if let Some(thumb) = view.thumbnail() {
@:thumbnail(&thumb)
}
}
})
})
@if state.has_nav() {
@:card_body({
@:button_group(&state.nav(nav_state.dark()))
})
}
} else {
@:card_title({ There's nothing here })
@:card_body({
<p>Follow users on Hyaenidae to start seeing submissions in your feed</p>
})
}
})
})