FEATURE: Let staff add custom post notices. (#7377)

This commit is contained in:
Dan Ungureanu
2019-04-19 17:53:58 +03:00
committed by GitHub
parent ba6369edc5
commit 57d1dea8a2
24 changed files with 282 additions and 102 deletions

View File

@ -879,8 +879,8 @@ widgetTest("post notice - with username", {
this.siteSettings.prioritize_username_in_ux = true;
this.siteSettings.old_post_notice_days = 14;
this.set("args", {
postNoticeType: "returning",
postNoticeTime: twoDaysAgo,
noticeType: "returning_user",
noticeTime: twoDaysAgo,
username: "codinghorror",
name: "Jeff",
created_at: new Date()
@ -891,7 +891,10 @@ widgetTest("post notice - with username", {
find(".post-notice.returning-user:not(.old)")
.text()
.trim(),
I18n.t("post.notice.return", { user: "codinghorror", time: "2d ago" })
I18n.t("post.notice.returning_user", {
user: "codinghorror",
time: "2d ago"
})
);
}
});
@ -902,7 +905,7 @@ widgetTest("post notice - with name", {
this.siteSettings.prioritize_username_in_ux = false;
this.siteSettings.old_post_notice_days = 14;
this.set("args", {
postNoticeType: "first",
noticeType: "new_user",
username: "codinghorror",
name: "Jeff",
created_at: new Date(2019, 0, 1)
@ -913,7 +916,7 @@ widgetTest("post notice - with name", {
find(".post-notice.old.new-user")
.text()
.trim(),
I18n.t("post.notice.first", { user: "Jeff", time: "Jan '10" })
I18n.t("post.notice.new_user", { user: "Jeff", time: "Jan '10" })
);
}
});