UX: improve activity column title data (#23614)
This commit is contained in:
parent
5484030162
commit
cbf8d85e6b
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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:"
|
||||
|
|
Loading…
Reference in New Issue