2022-01-22 00:45:11 +01:00
|
|
|
<div class="micromodal" id="user-profile-modal" data-user-id="{{user_id}}" aria-hidden="true">
|
2022-11-11 08:10:56 +01:00
|
|
|
<div class="modal__overlay" tabindex="-1">
|
2022-10-20 20:14:36 +02:00
|
|
|
<div class="modal__container new-style" role="dialog" aria-modal="true" aria-labelledby="dialog_title">
|
2022-10-14 00:34:57 +02:00
|
|
|
<div class="modal__header">
|
2023-04-18 00:55:20 +02:00
|
|
|
{{#unless is_bot}}
|
2022-11-09 20:53:11 +01:00
|
|
|
<div class="tippy-zulip-tooltip" data-tippy-content="{{last_seen}}">
|
|
|
|
<span class="{{user_circle_class}} user_circle user_profile_presence"></span>
|
|
|
|
</div>
|
2023-04-18 00:55:20 +02:00
|
|
|
{{/unless}}
|
2023-01-27 07:18:43 +01:00
|
|
|
<h1 class="modal__title user_profile_name_heading" id="name">
|
2022-08-24 13:46:25 +02:00
|
|
|
{{#if is_bot}}
|
2023-09-09 13:13:14 +02:00
|
|
|
<i class="zulip-icon zulip-icon-bot" aria-hidden="true"></i>
|
2022-08-24 13:46:25 +02:00
|
|
|
{{/if}}
|
2023-08-08 06:59:04 +02:00
|
|
|
<span class="user_profile_name">{{full_name}}</span>
|
2021-07-22 17:50:59 +02:00
|
|
|
{{#if is_me}}
|
2023-09-09 13:13:14 +02:00
|
|
|
<a href="/#settings/profile">
|
2023-09-09 15:24:27 +02:00
|
|
|
<i class="fa fa-edit tippy-zulip-tooltip user_profile_manage_own_edit_button" data-tippy-content="{{t 'Edit profile' }}" aria-hidden="true"></i>
|
2023-09-09 13:13:14 +02:00
|
|
|
</a>
|
|
|
|
{{/if}}
|
|
|
|
{{#if can_manage_profile}}
|
2023-09-09 15:24:27 +02:00
|
|
|
<i class="fa fa-edit tippy-zulip-tooltip user_profile_manage_others_edit_button" data-tippy-content="{{t 'Manage user' }}" aria-hidden="true"></i>
|
2021-06-03 09:36:43 +02:00
|
|
|
{{/if}}
|
2022-10-14 00:34:57 +02:00
|
|
|
</h1>
|
|
|
|
<button class="modal__close" aria-label="{{t 'Close modal' }}" data-micromodal-close></button>
|
|
|
|
</div>
|
|
|
|
<div id="tab-toggle" class="center"></div>
|
|
|
|
<main class="modal__body" id="body" data-simplebar data-simplebar-auto-hide="false">
|
2021-07-22 17:50:59 +02:00
|
|
|
<div class="tab-data">
|
|
|
|
<div class="tabcontent active" id="profile-tab">
|
2022-06-05 16:37:04 +02:00
|
|
|
<div class="top">
|
|
|
|
<div class="col-wrap col-left">
|
|
|
|
<div id="default-section">
|
2021-10-26 15:43:39 +02:00
|
|
|
{{#if email}}
|
2022-06-05 16:37:04 +02:00
|
|
|
<div id="email" class="default-field">
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="name">{{t "Email" }}</div>
|
2022-06-05 16:37:04 +02:00
|
|
|
<div class="value">{{email}}</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
<div id="user-id" class="default-field">
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="name">{{t "User ID" }}</div>
|
2022-06-05 16:37:04 +02:00
|
|
|
<div class="value">{{user_id}}</div>
|
|
|
|
</div>
|
|
|
|
<div id="user-type" class="default-field">
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="name">{{t "Role" }}</div>
|
2022-08-24 13:46:25 +02:00
|
|
|
{{#if is_bot}}
|
|
|
|
{{#if is_system_bot}}
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="value">{{t "System bot" }}</div>
|
2022-08-24 13:46:25 +02:00
|
|
|
{{else}}
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="value">{{t "Bot" }}</div>
|
2022-08-24 13:46:25 +02:00
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
|
|
|
<div class="value">{{user_type}}</div>
|
|
|
|
{{/if}}
|
2022-06-05 16:37:04 +02:00
|
|
|
</div>
|
|
|
|
<div id="date-joined" class="default-field">
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="name">{{t "Joined" }}</div>
|
2022-06-05 16:37:04 +02:00
|
|
|
<div class="value">{{date_joined}}</div>
|
|
|
|
</div>
|
|
|
|
{{#if user_time}}
|
|
|
|
<div class="default-field">
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="name">{{t "Local time" }}</div>
|
2022-06-05 16:37:04 +02:00
|
|
|
<div class="value">{{user_time}}</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2022-06-05 14:12:19 +02:00
|
|
|
</div>
|
2022-06-05 16:37:04 +02:00
|
|
|
</div>
|
|
|
|
<div class="col-wrap col-right">
|
|
|
|
<div id="avatar" {{#if user_is_guest}} class="guest-avatar" {{/if}}
|
|
|
|
style="background-image: url('{{user_avatar}}');">
|
2022-06-05 14:12:19 +02:00
|
|
|
</div>
|
2022-03-10 14:43:17 +01:00
|
|
|
</div>
|
2022-06-05 16:37:04 +02:00
|
|
|
</div>
|
|
|
|
<div class="bottom">
|
2022-06-05 14:12:19 +02:00
|
|
|
<div id="content">
|
2022-08-24 13:46:25 +02:00
|
|
|
{{#if is_bot}}
|
|
|
|
<div class="field-section">
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="name">{{t "Bot type" }}</div>
|
2022-08-24 13:46:25 +02:00
|
|
|
<div class="bot_info_value">{{bot_type}}</div>
|
|
|
|
</div>
|
|
|
|
{{#if bot_owner}}
|
|
|
|
<div class="field-section bot_owner_user_field" data-field-id="{{bot_owner.user_id}}">
|
2023-03-15 23:51:27 +01:00
|
|
|
<div class="name">{{t "Owner" }}</div>
|
2022-08-24 13:46:25 +02:00
|
|
|
<div class="pill-container not-editable">
|
|
|
|
<div class="input" contenteditable="false" style="display: none;"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
2023-02-21 13:18:57 +01:00
|
|
|
{{> user_custom_profile_fields profile_fields=profile_data}}
|
2022-08-24 13:46:25 +02:00
|
|
|
{{/if}}
|
2021-06-03 09:36:43 +02:00
|
|
|
</div>
|
2021-07-22 17:50:59 +02:00
|
|
|
</div>
|
2021-06-03 09:36:43 +02:00
|
|
|
</div>
|
|
|
|
|
2021-07-22 17:50:59 +02:00
|
|
|
<div class="tabcontent" id="user-profile-streams-tab">
|
2023-09-08 19:37:58 +02:00
|
|
|
<div class="alert stream_list_info"></div>
|
|
|
|
{{#if show_user_subscribe_widget}}
|
|
|
|
<div class="header-section">
|
2023-09-08 22:46:01 +02:00
|
|
|
<h3 class="stream-tab-element-header">{{t 'Subscribe {full_name} to streams'}}</h3>
|
2023-09-08 19:37:58 +02:00
|
|
|
</div>
|
|
|
|
{{> user_profile_subscribe_widget}}
|
|
|
|
{{/if}}
|
2021-07-22 17:50:59 +02:00
|
|
|
<div class="stream-list-top-section">
|
|
|
|
<div class="header-section">
|
2023-09-08 22:46:01 +02:00
|
|
|
<h3 class="stream-tab-element-header">{{t 'Subscribed streams' }}</h3>
|
2021-07-22 17:50:59 +02:00
|
|
|
</div>
|
2023-03-27 10:24:27 +02:00
|
|
|
<input type="text" class="stream-search modal_text_input" placeholder="{{t 'Filter streams' }}" />
|
2021-07-22 17:50:59 +02:00
|
|
|
<button type="button" class="clear_search_button" id="clear_stream_search">
|
|
|
|
<i class="fa fa-remove" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="subscription-stream-list">
|
|
|
|
<table class="user-stream-list" data-empty="{{t 'No stream subscriptions.'}}"></table>
|
|
|
|
</div>
|
2021-06-30 18:47:04 +02:00
|
|
|
</div>
|
2021-06-23 09:55:13 +02:00
|
|
|
|
2021-07-22 17:50:59 +02:00
|
|
|
<div class="tabcontent" id="user-profile-groups-tab">
|
|
|
|
<div class="subscription-group-list">
|
|
|
|
<table class="user-group-list" data-empty="{{t 'No user group subscriptions.'}}"></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
settings_users: Migrate manage user modal to full profile modal.
This commit migrates the "manage user" modal to the "Full Profile"
modal. Refactored the show_edit_user_info_modal function since
earlier, we used to have a separate "Manage User" modal.
Consequently, we checked if we were coming from the
user_info_popover and then built the dialog widget accordingly.
However, with this new change, we no longer need to build the
dialog widget. Therefore, removed that part and now just pass
the container of the 'user profile modal' to get the content.
Previously, for deactivation, we used to have a separate dialog
widget. But now, since we have a dedicated function to handle
this case, refactored the deactivation code to use the
'confirm_deactivation' function.
Additionally, created two new functions to handle the loading
spinner. Since we will need these functions in the future for
the "Manage Bot" modal, we marked them as exported.
"Since we do not want to show the 'Manage User' tab to the user
looking at their own profile, in the 'can_manage_user' function
that we use to render the 'Manage User' tab, we check if the user
profile popover belongs to the same user. If it does, we set it to
'false' instead of 'true,' ensuring that the 'Manage User' tab is
not visible.
Added a new tab in the user profile modal 'manage user'.
Fixes: #21806
2023-09-09 12:42:04 +02:00
|
|
|
<div class="tabcontent" id="manage-profile-tab"></div>
|
2021-06-23 09:55:13 +02:00
|
|
|
</div>
|
2021-07-22 17:50:59 +02:00
|
|
|
</main>
|
user_profile: Fix inconsistent height of user profile switching tabs.
This commit fixes the inconsistent height of the user profile when
switching tabs. We now have four tabs in the user profile:
"Profile," "Streams," "User Groups," and "Manage User." However,
the "Manage User" tab has footer buttons that need to remain
sticky at the bottom without changing the overall height of
the modal.
To achieve this, we wrapped the footer inside a div element and
assigned it a class called "manage-profile-tab-footer." The main
body of the user profile is given a height of 60vh. However, for
the "Manage User" tab, we decreased this height to 52vh and
allocated the remaining 8vh height to the div element to
accommodate the footer buttons. This ensures that the user
profile maintains consistent height when switching between tabs.
However, we have a 1px border in the footer, so to ensure that
the height is consistent, we reduce the height of the modal
content by 1px, making it calc(52vh - 1px).
To implement this, CSS code was added to the "popover.css" file
and accessed through the class specified in the "user_profile.js"
file.
The default padding of the buttons inside footer is 20px, but
with the above solution on large screens the buttons are not
aligned properly, so removed the padding top and bottom
and instead applied the flex box and property to align the buttons.
2023-09-09 14:26:50 +02:00
|
|
|
<div class="manage-profile-tab-footer">
|
|
|
|
<footer class="modal__footer">
|
|
|
|
<button type="button" class="modal__btn dialog_exit_button" aria-label="{{t 'Close this dialog window' }}" data-micromodal-close>{{t "Cancel" }}</button>
|
|
|
|
<button type="button" class="modal__btn dialog_submit_button">
|
|
|
|
<span>{{t "Save changes"}}</span>
|
|
|
|
<div class="modal__spinner"></div>
|
|
|
|
</button>
|
|
|
|
</footer>
|
|
|
|
</div>
|
2018-04-23 20:41:35 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|