mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Show an educational message in the quick access menu for personal messages when there are none (#12564)
If the user has not been sent any messages, show a message in the quick access menu with an educational message. If the user can send private messages, also show a link to open the "new message" composer: This also adds a general improvement to the quick-access-panel, to be able to show an `emptyStateWidget` instead of just a message if there is nothing to show in the panel, as well as initial general styles for empty state.
This commit is contained in:
@ -19,6 +19,7 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:dynamic_favicon,
|
||||
:trust_level,
|
||||
:can_send_private_email_messages,
|
||||
:can_send_private_messages,
|
||||
:can_edit,
|
||||
:can_invite_to_forum,
|
||||
:no_password,
|
||||
@ -126,6 +127,10 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
scope.can_send_private_messages_to_email?
|
||||
end
|
||||
|
||||
def can_send_private_messages
|
||||
scope.can_send_private_message?(Discourse.system_user)
|
||||
end
|
||||
|
||||
def can_edit
|
||||
true
|
||||
end
|
||||
|
Reference in New Issue
Block a user