UX: improve activity column title data (#23614)

This commit is contained in:
Kris 2023-09-25 15:53:16 -04:00 committed by GitHub
parent 5484030162
commit cbf8d85e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 11 deletions

View File

@ -89,10 +89,17 @@ const Bookmark = RestModel.extend({
@discourseComputed("bumpedAt", "createdAt")
bumpedAtTitle(bumpedAt, createdAt) {
return I18n.t("topic.bumped_at_title", {
createdAtDate: longDate(createdAt),
bumpedAtDate: longDate(bumpedAt),
});
const BUMPED_FORMAT = "YYYY-MM-DDTHH:mm:ss";
if (moment(bumpedAt).isValid() && moment(createdAt).isValid()) {
const bumpedAtStr = moment(bumpedAt).format(BUMPED_FORMAT);
const createdAtStr = moment(createdAt).format(BUMPED_FORMAT);
return bumpedAtStr !== createdAtStr
? `${I18n.t("topic.created_at", {
date: longDate(createdAt),
})}\n${I18n.t("topic.bumped_at", { date: longDate(bumpedAt) })}`
: I18n.t("topic.created_at", { date: longDate(createdAt) });
}
},
@discourseComputed("created_at")

View File

@ -127,10 +127,17 @@ const Topic = RestModel.extend({
@discourseComputed("bumpedAt", "createdAt")
bumpedAtTitle(bumpedAt, createdAt) {
return I18n.t("topic.bumped_at_title", {
createdAtDate: longDate(createdAt),
bumpedAtDate: longDate(bumpedAt),
});
const BUMPED_FORMAT = "YYYY-MM-DDTHH:mm:ss";
if (moment(bumpedAt).isValid() && moment(createdAt).isValid()) {
const bumpedAtStr = moment(bumpedAt).format(BUMPED_FORMAT);
const createdAtStr = moment(createdAt).format(BUMPED_FORMAT);
return bumpedAtStr !== createdAtStr
? `${I18n.t("topic.created_at", {
date: longDate(createdAt),
})}\n${I18n.t("topic.bumped_at", { date: longDate(bumpedAt) })}`
: I18n.t("topic.created_at", { date: longDate(createdAt) });
}
},
@discourseComputed("created_at")

View File

@ -3013,9 +3013,8 @@ en:
other {}
}
bumped_at_title: |
First post: %{createdAtDate}
Posted: %{bumpedAtDate}
created_at: "Created: %{date}"
bumped_at: "Latest: %{date}"
browse_all_categories_latest: "<a href='%{basePath}/categories'>Browse all categories</a> or <a href='%{basePath}/latest'>view latest topics</a>."
browse_all_categories_latest_or_top: "<a href='%{basePath}/categories'>Browse all categories</a>, <a href='%{basePath}/latest'>view latest topics</a> or see top:"