mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 21:02:28 +00:00
Improve edited video indicators and preserve publish date
- Update `VideoCard.js` to display "• Edited" instead of "(edited)" for better visual consistency. - Update `app.js` to format the modal's "Last Edited" timestamp as "Last edited: [Absolute] ([Relative])". - Ensure `EditModal.js` correctly backfills and preserves `published_at` to prevent date resets. - Verify edit logic with existing tests.
This commit is contained in:
1 parent
782b5fe0b7
commit
ad0a9113f6
2 files changed
+11
-5
No files matched your search
@@ -8762,9 +8762,9 @@ class Application {
|
||||
(normalizedPostedAt === null || normalizedEditedAt - normalizedPostedAt >= 60);
|
||||
|
||||
if (shouldShowEdited) {
|
||||
payload.edited = `Last Edited: ${formatAbsoluteDateWithOrdinalUtil(
|
||||
normalizedEditedAt
|
||||
)}`;
|
||||
const abs = formatAbsoluteDateWithOrdinalUtil(normalizedEditedAt);
|
||||
const rel = this.formatTimeAgo(normalizedEditedAt);
|
||||
payload.edited = `Last edited: ${abs} (${rel})`;
|
||||
}
|
||||
|
||||
return payload;
|
||||
|
||||
@@ -956,9 +956,15 @@ export class VideoCard {
|
||||
Number.isFinite(this.video?.created_at) &&
|
||||
this.video.created_at > this.postedAt + 60
|
||||
) {
|
||||
const separator = this.createElement("span", {
|
||||
classNames: ["text-muted-strong", isCompact ? "" : "mx-1"],
|
||||
textContent: "•",
|
||||
});
|
||||
separator.setAttribute("aria-hidden", "true");
|
||||
metadata.appendChild(separator);
|
||||
|
||||
const edited = this.createElement("span", {
|
||||
classNames: ["ml-1"],
|
||||
textContent: "(edited)",
|
||||
textContent: "Edited",
|
||||
});
|
||||
metadata.appendChild(edited);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user