hyaenidae/server/templates/submissions/profile_box.rs.html
2021-01-27 20:59:58 -06:00

38 lines
1.4 KiB
HTML

@use crate::extensions::ProfileExt;
@use crate::views::OwnedProfileView;
@use chrono::{DateTime, Utc};
@use hyaenidae_toolkit::{templates::link, Link};
@use hyaenidae_toolkit::templates::ago;
@use hyaenidae_toolkit::templates::icon;
@(view: &OwnedProfileView, published: Option<DateTime<Utc>>, dark: bool, body: Content)
<div class="profile-box">
@:icon(&view.icon().small(true).dark(dark))
<div class="profile-box--content">
<div class="profile-box--all-meta">
<div class="profile-box--meta">
@if let Some(name) = view.profile.display_name() {
<div class="profile-box--meta--display">
@:link(&Link::current_tab(&view.profile.view_path()).plain(true), {
@Html(name)
})
</div>
}
<div class="profile-box--meta--handle">
@:link(&Link::current_tab(&view.profile.view_path()).plain(true), {
@view.profile.full_handle()
})
</div>
@if let Some(published) = published {
<div class="profile-box--meta--date">
posted
@:ago(published)
</div>
}
</div>
</div>
<div class="profile-box--body">@:body()</div>
</div>
</div>