diff --git a/tools/lib/capitalization.py b/tools/lib/capitalization.py index 02c064b5e8..1fd4a6077a 100644 --- a/tools/lib/capitalization.py +++ b/tools/lib/capitalization.py @@ -140,6 +140,10 @@ IGNORED_PHRASES = [ r"does not apply to moderators and administrators", # Used in message-delete-time-limit setting label r"does not apply to administrators", + # Used as indicator with names for guest users. + r"guest", + # Used in pills for deactivated users. + r"deactivated", ] # Sort regexes in descending order of their lengths. As a result, the diff --git a/web/src/buddy_data.js b/web/src/buddy_data.js index 5759c14a5b..6137578f1e 100644 --- a/web/src/buddy_data.js +++ b/web/src/buddy_data.js @@ -152,6 +152,7 @@ export function info_for(user_id) { user_circle_class, status_text, user_list_style, + should_add_guest_user_indicator: people.should_add_guest_user_indicator(user_id), }; } diff --git a/web/src/compose_validate.js b/web/src/compose_validate.js index 2550febdee..43f7ef0315 100644 --- a/web/src/compose_validate.js +++ b/web/src/compose_validate.js @@ -173,6 +173,7 @@ export function warn_if_mentioning_unsubscribed_user(mentioned, $textarea) { can_subscribe_other_users, name: mentioned.full_name, classname: compose_banner.CLASSNAMES.recipient_not_subscribed, + should_add_guest_user_indicator: people.should_add_guest_user_indicator(user_id), }; const new_row = render_not_subscribed_warning(context); diff --git a/web/src/input_pill.ts b/web/src/input_pill.ts index 9fa5e29643..5184fc2821 100644 --- a/web/src/input_pill.ts +++ b/web/src/input_pill.ts @@ -17,6 +17,7 @@ export type InputPillItem = { img_src?: string; deactivated?: boolean; status_emoji_info?: EmojiRenderingDetails & {emoji_alt_code: boolean}; // TODO: Move this in user_status.js + should_add_guest_user_indicator?: boolean; } & T; type InputPillCreateOptions = { @@ -55,6 +56,7 @@ type InputPillRenderingDetails = { deactivated?: boolean; has_status?: boolean; status_emoji_info?: EmojiRenderingDetails & {emoji_alt_code: boolean}; + should_add_guest_user_indicator?: boolean; }; // These are the functions that are exposed to other modules. @@ -156,6 +158,7 @@ export function create(opts: InputPillCreateOptions): InputPillContainer compose_banner }} {{/compose_banner}} diff --git a/web/templates/input_pill.hbs b/web/templates/input_pill.hbs index 53bc1520c4..2dfb00256d 100644 --- a/web/templates/input_pill.hbs +++ b/web/templates/input_pill.hbs @@ -4,6 +4,8 @@ {{/if}} {{ display_value }} + {{~#if should_add_guest_user_indicator}} ({{t 'guest'}}){{~/if~}} + {{~#if deactivated}} ({{t 'deactivated'}}){{~/if~}} {{~#if has_status~}} {{~> status_emoji status_emoji_info~}} {{~/if~}} diff --git a/web/templates/message_body.hbs b/web/templates/message_body.hbs index f1ecfe2eaa..14f520f5ad 100644 --- a/web/templates/message_body.hbs +++ b/web/templates/message_body.hbs @@ -5,7 +5,7 @@ {{#if include_sender}} - {{msg/sender_full_name}} + {{> user_full_name name=msg/sender_full_name should_add_guest_user_indicator=should_add_guest_indicator_for_sender}} {{#unless status_message}} {{> status_emoji msg/status_emoji_info}} diff --git a/web/templates/popovers/user_card/user_card_popover.hbs b/web/templates/popovers/user_card/user_card_popover.hbs index 954504cf56..fdeeafd833 100644 --- a/web/templates/popovers/user_card/user_card_popover.hbs +++ b/web/templates/popovers/user_card/user_card_popover.hbs @@ -3,7 +3,7 @@