2021-01-22 05:47:47 +00:00
|
|
|
@use crate::extensions::{SubmissionExt, ProfileExt};
|
|
|
|
@use crate::views::{OwnedProfileView, OwnedSubmissionView};
|
2021-01-14 04:46:34 +00:00
|
|
|
@use hyaenidae_toolkit::templates::{card_body, card_section};
|
|
|
|
@use hyaenidae_toolkit::{templates::link, Link};
|
2021-01-22 05:47:47 +00:00
|
|
|
@use hyaenidae_toolkit::templates::icon;
|
2021-01-14 04:46:34 +00:00
|
|
|
@use hyaenidae_toolkit::templates::ago;
|
2021-01-23 01:54:48 +00:00
|
|
|
@use hyaenidae_toolkit::{templates::{tile, tiles}, Tiles};
|
2021-01-14 04:46:34 +00:00
|
|
|
|
2021-01-22 05:47:47 +00:00
|
|
|
@(sub_view: &OwnedSubmissionView, pro_view: &OwnedProfileView, dark: bool)
|
2021-01-14 04:46:34 +00:00
|
|
|
|
|
|
|
@:card_body({
|
|
|
|
<div class="profile-box">
|
2021-01-23 01:54:48 +00:00
|
|
|
@:icon(&pro_view.icon().small(true).dark(dark))
|
2021-01-14 04:46:34 +00:00
|
|
|
<div class="profile-box--content">
|
|
|
|
<div class="profile-box--all-meta">
|
|
|
|
<div>
|
|
|
|
<div class="profile-box--meta">
|
2021-01-22 05:47:47 +00:00
|
|
|
@if let Some(name) = pro_view.profile.display_name() {
|
2021-01-14 04:46:34 +00:00
|
|
|
<div class="profile-box--meta--display">
|
2021-01-24 04:04:27 +00:00
|
|
|
@:link(&Link::current_tab(&pro_view.profile.view_path()).plain(true), {
|
2021-01-14 04:46:34 +00:00
|
|
|
@name
|
|
|
|
})
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
<div class="profile-box--meta--handle">
|
2021-01-24 04:04:27 +00:00
|
|
|
@:link(&Link::current_tab(&pro_view.profile.view_path()).plain(true), {
|
2021-01-22 05:47:47 +00:00
|
|
|
@pro_view.profile.full_handle()
|
2021-01-14 04:46:34 +00:00
|
|
|
})
|
|
|
|
</div>
|
2021-01-22 05:47:47 +00:00
|
|
|
@if let Some(published) = sub_view.submission.published() {
|
2021-01-14 04:46:34 +00:00
|
|
|
<div class="profile-box--meta--date">
|
2021-01-24 04:04:27 +00:00
|
|
|
posted @:ago(published)
|
2021-01-14 04:46:34 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="profile-box--body">
|
2021-01-22 05:47:47 +00:00
|
|
|
<h3>@sub_view.submission.title_text()</h3>
|
|
|
|
@if let Some(description) = sub_view.submission.description_text() {
|
2021-01-14 04:46:34 +00:00
|
|
|
<p>@description</p>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
})
|
|
|
|
@:card_section({
|
2021-01-23 01:54:48 +00:00
|
|
|
@:tiles(&Tiles::new().small(true), {
|
2021-01-22 05:47:47 +00:00
|
|
|
@for t in sub_view.tiles() {
|
|
|
|
@:tile(&t)
|
2021-01-14 04:46:34 +00:00
|
|
|
}
|
2021-01-22 05:47:47 +00:00
|
|
|
})
|
2021-01-14 04:46:34 +00:00
|
|
|
})
|