Compare commits
No commits in common. "7a6fdbef146149da2b2790ca3160af212dae65da" and "ef6ac8c0420f92a3b84e82781d67eb4a3416b78d" have entirely different histories.
7a6fdbef14
...
ef6ac8c042
1 changed files with 3 additions and 14 deletions
17
src/main.rs
17
src/main.rs
|
@ -1,5 +1,5 @@
|
||||||
use jiff::tz::TimeZone;
|
use jiff::tz::TimeZone;
|
||||||
use jiff::{Timestamp, Unit};
|
use jiff::Timestamp;
|
||||||
use pleroma::Activities;
|
use pleroma::Activities;
|
||||||
use std::ffi::OsStr;
|
use std::ffi::OsStr;
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
|
@ -227,7 +227,7 @@ markup::define! {
|
||||||
|
|
||||||
div[class="activity-content"] {
|
div[class="activity-content"] {
|
||||||
a[href=MAPPINGS.get().unwrap().get(&activity.id).and_then(|url| url.as_ref().map(|url| url.path()))] {
|
a[href=MAPPINGS.get().unwrap().get(&activity.id).and_then(|url| url.as_ref().map(|url| url.path()))] {
|
||||||
time[datetime=&activity.datetime()] { @activity.human_published() }
|
time[datetime=&activity.published] { @activity.human_published() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@if let Some(in_reply_to) = &activity.in_reply_to {
|
@if let Some(in_reply_to) = &activity.in_reply_to {
|
||||||
|
@ -259,7 +259,7 @@ markup::define! {
|
||||||
Attachment<'a>(attachment: &'a pleroma::activity::Attachment) {
|
Attachment<'a>(attachment: &'a pleroma::activity::Attachment) {
|
||||||
@match attachment.media_type.as_str() {
|
@match attachment.media_type.as_str() {
|
||||||
"image/gif" |"image/jpeg" | "image/png" => {
|
"image/gif" |"image/jpeg" | "image/png" => {
|
||||||
img[src=&attachment.url, alt=&attachment.name, loading="lazy"];
|
img[src=&attachment.url, loading="lazy"];
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
a[href=&attachment.url] { @attachment.media_type " attachment" }
|
a[href=&attachment.url] { @attachment.media_type " attachment" }
|
||||||
|
@ -285,17 +285,6 @@ impl pleroma::Activity {
|
||||||
|
|
||||||
published.strftime("%d %b %Y").to_string()
|
published.strftime("%d %b %Y").to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// datetime for `time` element
|
|
||||||
fn datetime(&self) -> String {
|
|
||||||
let published = self
|
|
||||||
.published
|
|
||||||
.parse::<Timestamp>()
|
|
||||||
.map(|ts| ts.round(Unit::Second).expect("rounding to succeeed"))
|
|
||||||
.expect("invalid published value");
|
|
||||||
|
|
||||||
published.to_string()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pleroma::Actor {
|
impl pleroma::Actor {
|
||||||
|
|
Loading…
Reference in a new issue