Files
zulip/web/templates/user_custom_profile_fields.hbs
Hardik Dharmani 4ee515a245 user_profile_modal: Abbrevate long URLs of custom fields.
Abbreviated long URL for custom field in the user profile modal
and user card popover. Added a copy-to-clipboard icon at
the end of the URL. When hovering over the copy button, it displays
a tippy tooltip with the text `Copy URL`. Clicking the copy button
displays a `Copied` tippy tooltip for 1 second.

Fixes #21680
2023-09-28 15:15:57 -07:00

35 lines
2.0 KiB
Handlebars

{{#each profile_fields}}
<li data-type="{{this.type}}" class="field-section custom_user_field" data-field-id="{{this.id}}">
{{#unless ../for_user_card_popover}}
<div class="name">{{this.name}}</div>
{{/unless}}
{{#if this.is_link}}
<div class="custom-user-url-field">
<a tabindex="0" href="{{this.value}}" target="_blank" rel="noopener noreferrer" class="value custom-profile-fields-link {{#if ../for_user_card_popover}}tippy-zulip-tooltip{{/if}}" data-tippy-content="{{this.name}}">{{this.value}}</a>
<button type="submit" class="tippy-zulip-tooltip copy-custom-field-url" data-tippy-content="{{t 'Copy URL' }}">
{{> copy_to_clipboard_svg }}
</button>
</div>
{{else if this.is_external_account}}
<a tabindex="0" href="{{this.link}}" target="_blank" rel="noopener noreferrer" class="value custom-profile-fields-link {{#if ../for_user_card_popover}}tippy-zulip-tooltip{{/if}}" data-tippy-content="{{this.name}}">
{{#if (eq this.subtype "github") }}
<i class="fa fa-github" aria-hidden="true"></i>
{{else if (eq this.subtype "twitter") }}
<i class="fa fa-twitter" aria-hidden="true"></i>
{{/if}}
{{this.value}}
</a>
{{else if this.is_user_field}}
<div class="pill-container not-editable" data-field-id="{{this.id}}">
<div class="input" contenteditable="false" style="display: none;"></div>
</div>
{{else}}
{{#if this.rendered_value}}
<span class="value rendered_markdown {{#if ../for_user_card_popover}}tippy-zulip-tooltip{{/if}}" data-tippy-content="{{this.name}}">{{rendered_markdown this.rendered_value}}</span>
{{else}}
<span class="value {{#if ../for_user_card_popover}}tippy-zulip-tooltip"{{/if}} data-tippy-content="{{this.name}}">{{this.value}}</span>
{{/if}}
{{/if}}
</li>
{{/each}}