mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FEATURE: Let staff add custom post notices. (#7377)
This commit is contained in:
@ -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" })
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user