forked from alemi/upub
fix(web): better activity line, dates, icons
This commit is contained in:
parent
fc4840dc5d
commit
73f178462f
3 changed files with 13 additions and 14 deletions
|
@ -20,13 +20,12 @@ pub fn ActivityLine(activity: serde_json::Value) -> impl IntoView {
|
|||
<img src={avatar} class="avatar-inline mr-s ml-1-r" /><b>{username}</b><small>@{domain}</small>
|
||||
</a>
|
||||
<span style="float:right">
|
||||
<a class="upub-title clean" href={Uri::web(FetchKind::Object, &object_id)} ><code class="color moreinfo" title={object_id.clone()} >{kind.as_ref().to_string()}</code></a>
|
||||
<a class="hover ml-1 hidden-on-mobile" href={Uri::web(FetchKind::Object, &object_id)} >
|
||||
<DateTime t=activity.published() />
|
||||
</a>
|
||||
<span class="hidden-on-mobile">
|
||||
<PrivacyMarker addressed=activity.addressed() />
|
||||
</span>
|
||||
<code class="color moreinfo" title={activity.published().map(|x| x.to_rfc2822())} >
|
||||
<a class="upub-title clean" title={object_id.clone()} href={Uri::web(FetchKind::Object, &object_id)} >
|
||||
{kind.as_ref().to_string()}
|
||||
</a>
|
||||
<PrivacyMarker addressed=activity.addressed() />
|
||||
</code>
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ pub fn DateTime(t: Option<chrono::DateTime<chrono::Utc>>) -> impl IntoView {
|
|||
} else if delta.num_days() < 90 {
|
||||
format!("{}d ago", delta.num_days())
|
||||
} else {
|
||||
t.format("%Y/%m/%d %H:%M:%S").to_string()
|
||||
t.format("%d/%m/%Y").to_string()
|
||||
};
|
||||
let rfc = t.to_rfc2822();
|
||||
Some(view! {
|
||||
|
@ -37,7 +37,7 @@ pub fn DateTime(t: Option<chrono::DateTime<chrono::Utc>>) -> impl IntoView {
|
|||
}
|
||||
}
|
||||
|
||||
pub const PRIVACY_PUBLIC : &str = "💿";
|
||||
pub const PRIVACY_PUBLIC : &str = "🪩";
|
||||
pub const PRIVACY_FOLLOWERS : &str = "🔒";
|
||||
pub const PRIVACY_PRIVATE : &str = "📨";
|
||||
|
||||
|
@ -52,6 +52,6 @@ pub fn PrivacyMarker(addressed: Vec<String>) -> impl IntoView {
|
|||
};
|
||||
let audience = format!("[ {} ]", addressed.join(", "));
|
||||
view! {
|
||||
<span class="emoji ml-1 moreinfo" title={audience} >{privacy}</span>
|
||||
<span class="emoji ml-1 mr-s moreinfo" title={audience} >{privacy}</span>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,13 +22,13 @@ pub fn Object(object: serde_json::Value) -> impl IntoView {
|
|||
<td><ActorBanner object=author /></td>
|
||||
<td class="rev" >
|
||||
{object.in_reply_to().id().map(|reply| view! {
|
||||
<small><i><a class="clean mr-1" href={Uri::web(FetchKind::Object, &reply)} title={reply}>reply</a></i></small>
|
||||
<small><i><a class="clean" href={Uri::web(FetchKind::Object, &reply)} title={reply}>reply</a></i></small>
|
||||
})}
|
||||
<a class="clean hover" href={Uri::web(FetchKind::Object, object.id().unwrap_or_default())}>
|
||||
<PrivacyMarker addressed=object.addressed() />
|
||||
<a class="clean hover ml-s" href={Uri::web(FetchKind::Object, object.id().unwrap_or_default())}>
|
||||
<DateTime t=object.published() />
|
||||
</a>
|
||||
<sup><small><a class="clean" href={uid} target="_blank">"↗"</a></small></sup>
|
||||
<PrivacyMarker addressed=object.addressed() />
|
||||
<sup><small><a class="clean ml-s" href={uid} target="_blank">"↗"</a></small></sup>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue