mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Post notices become old after 14 days. (#7197)
This commit is contained in:
@@ -432,12 +432,22 @@ createWidget("post-notice", {
|
||||
tagName: "div.post-notice",
|
||||
|
||||
buildClasses(attrs) {
|
||||
const classes = [];
|
||||
|
||||
if (attrs.postNoticeType === "first") {
|
||||
return ["new-user"];
|
||||
classes.push("new-user");
|
||||
} else if (attrs.postNoticeType === "returning") {
|
||||
return ["returning-user"];
|
||||
classes.push("returning-user");
|
||||
}
|
||||
return [];
|
||||
|
||||
if (
|
||||
new Date() - new Date(attrs.created_at) >
|
||||
this.siteSettings.old_post_notice_days * 86400000
|
||||
) {
|
||||
classes.push("old");
|
||||
}
|
||||
|
||||
return classes;
|
||||
},
|
||||
|
||||
html(attrs) {
|
||||
|
||||
Reference in New Issue
Block a user