Skip to content

A platform for community discussion. Free, open, simple.

UX: Post notices part 2 (#35049)

chapoi5fa95b69e427
diff --git a/app/assets/javascripts/discourse/app/components/post/notice.gjs b/app/assets/javascripts/discourse/app/components/post/notice.gjs
index 737a657657a..f681cfed3cb 100644
--- a/app/assets/javascripts/discourse/app/components/post/notice.gjs
+++ b/app/assets/javascripts/discourse/app/components/post/notice.gjs
@@ -31,7 +31,7 @@ export default class PostNotice extends Component {
get shouldRender() {
const postAge = new Date() - new Date(this.args.post.created_at);
const maxAge = this.siteSettings.old_post_notice_days * 86400000;
- return postAge <= maxAge;
+ return this.args.post.notice.type === "custom" || postAge <= maxAge;
}
<template>
diff --git a/app/assets/javascripts/discourse/app/components/post/notice/returning-user.gjs b/app/assets/javascripts/discourse/app/components/post/notice/returning-user.gjs
index 19b29f2bb79..10229e9203f 100644
--- a/app/assets/javascripts/discourse/app/components/post/notice/returning-user.gjs
+++ b/app/assets/javascripts/discourse/app/components/post/notice/returning-user.gjs
@@ -1,4 +1,4 @@
-import icon from "discourse/helpers/d-icon";
+import emoji from "discourse/helpers/emoji";
import { relativeAgeMediumSpan } from "discourse/lib/formatter";
import { i18n } from "discourse-i18n";
import PostNoticeNewUser from "./new-user";
@@ -11,7 +11,7 @@ export default class PostNoticeReturningUser extends PostNoticeNewUser {
}
<template>
- {{icon "far-face-smile"}}
+ {{emoji "wave"}}
<p>{{i18n "post.notice.returning_user" user=this.user time=this.time}}</p>
</template>
}
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss
index 75e4631ab6b..9e9c5fd1df1 100644
--- a/app/assets/stylesheets/common/base/topic-post.scss
+++ b/app/assets/stylesheets/common/base/topic-post.scss
@@ -1532,6 +1532,10 @@ span.mention {
gap: var(--space-2);
}
+ &.custom {
+ background: var(--danger-low);
+ }
+
.emoji {
width: 1.5em;
height: 1.5em;
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 82af3395348..750c9dbc79d 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -2578,7 +2578,7 @@ en:
watched_words_regular_expressions: "Allows the use of regular expressions for filtering words. If enabled, this feature groups sensitive words by their case-sensitivity. It then compiles all selected words into a single regular expression, adding word boundaries for regular watched words. Consequently, this regex-based filtering method adds an extra layer of control over content moderation by supporting more sophisticated word patterns. The setting also allows to easily substitute the original text with the replacement of choice."
enable_fast_edit: "Adds a button to the post selection menu to edit a small selection inline."
- old_post_notice_days: "The number of days after which a post notice is considered old. Old notices will be hidden."
+ old_post_notice_days: "The number of days after which the new-user and returning-user post notices will be hidden. The official post notice will always remain visible."
new_user_notice_tl: "Minimum trust level required to see new user post notices."
returning_user_notice_tl: "Minimum trust level required to see returning user post notices."
returning_users_days: "How many days should pass before a user is considered to be returning."