Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

user_profile_modal: Update remove/unsubscribe buttons to action button.

Sayam Samal703acbaccc25
diff --git a/web/styles/popovers.css b/web/styles/popovers.css
index c0ccaf427b6..85c07c11ead 100644
--- a/web/styles/popovers.css
+++ b/web/styles/popovers.css
@@ -594,12 +594,6 @@ ul.popover-group-menu-member-list {
margin-bottom: 5px;
-webkit-overflow-scrolling: touch;
- .remove-subscription-button,
- .remove-member-button {
- padding-top: 2px;
- padding-bottom: 2px;
- }
-
.user-stream-list,
.user-group-list {
width: 100%;
@@ -622,7 +616,7 @@ ul.popover-group-menu-member-list {
&.remove_subscription,
&.remove_member {
- text-align: right;
+ float: right;
padding-right: 10px;
}
diff --git a/web/templates/components/action_button.hbs b/web/templates/components/action_button.hbs
index 52f8c429437..c4aaea4456c 100644
--- a/web/templates/components/action_button.hbs
+++ b/web/templates/components/action_button.hbs
@@ -1,4 +1,4 @@
-<button type="{{#if type}}{{type}}{{else}}button{{/if}}" {{#if id}}id="{{id}}"{{/if}} class="{{#if custom_classes}}{{custom_classes}} {{/if}}action-button action-button-{{attention}}-{{intent}} {{#if hidden}}hide{{/if}}" {{#if data-tooltip-template-id}}data-tooltip-template-id="{{data-tooltip-template-id}}"{{/if}} tabindex="0" {{#if aria-label}}aria-label="{{aria-label}}"{{/if}}
+<button type="{{#if type}}{{type}}{{else}}button{{/if}}" {{#if id}}id="{{id}}"{{/if}} class="{{#if custom_classes}}{{custom_classes}} {{/if}}action-button action-button-{{attention}}-{{intent}} {{#if hidden}}hide{{/if}}" {{#if data-tippy-content}}data-tippy-content="{{data-tippy-content}}"{{/if}} {{#if data-tooltip-template-id}}data-tooltip-template-id="{{data-tooltip-template-id}}"{{/if}} tabindex="0" {{#if aria-label}}aria-label="{{aria-label}}"{{/if}}
{{#if disabled}}disabled{{/if}}
>
{{#if icon}}
diff --git a/web/templates/user_group_list_item.hbs b/web/templates/user_group_list_item.hbs
index ae3ab502c85..891c5db31db 100644
--- a/web/templates/user_group_list_item.hbs
+++ b/web/templates/user_group_list_item.hbs
@@ -8,13 +8,13 @@
</td>
{{#if can_remove_members }}
<td class="remove_member">
- <div class="group_list_remove">
- <span {{#unless is_direct_member}}class="tippy-zulip-tooltip" data-tippy-content="{{#if is_me}}{{t 'You are a member of {name} because you are a member of a subgroup ({subgroups_name}).'}} {{else}}{{t 'This user is a member of {name} because they are a member of a subgroup ({subgroups_name}).'}}{{/if}}"{{/unless}}>
- <button type="button" name="remove" class="remove-member-button button small rounded button-danger" {{#unless is_direct_member}}disabled="disabled"{{/unless}} >
- {{t 'Remove' }}
- </button>
+ {{#if is_direct_member}}
+ {{> components/action_button label=(t "Remove") custom_classes="remove-member-button" attention="quiet" intent="danger" aria-label=(t "Remove") }}
+ {{else}}
+ <span class="tippy-zulip-tooltip" data-tippy-content="{{#if is_me}}{{t 'You are a member of {name} because you are a member of a subgroup ({subgroups_name}).'}} {{else}}{{t 'This user is a member of {name} because they are a member of a subgroup ({subgroups_name}).'}}{{/if}}">
+ {{> components/action_button label=(t "Remove") custom_classes="remove-member-button" attention="quiet" intent="danger" aria-label=(t "Remove") disabled="disabled" }}
</span>
- </div>
+ {{/if}}
</td>
{{/if}}
</tr>
diff --git a/web/templates/user_stream_list_item.hbs b/web/templates/user_stream_list_item.hbs
index 82aa342b283..0348f6cb9cc 100644
--- a/web/templates/user_stream_list_item.hbs
+++ b/web/templates/user_stream_list_item.hbs
@@ -9,11 +9,13 @@
</td>
{{#if show_unsubscribe_button}}
<td class="remove_subscription">
- <div class="subscription_list_remove">
- <button type="button" name="unsubscribe" class="remove-subscription-button button small rounded button-danger {{#if (or show_private_stream_unsub_tooltip show_last_user_in_private_stream_unsub_tooltip)}}tippy-zulip-tooltip{{/if}}" data-tippy-content='{{#if show_private_stream_unsub_tooltip}}{{t "Use channel settings to unsubscribe from private channels."}}{{else}}{{t "Use channel settings to unsubscribe the last user from a private channel."}}{{/if}}'>
- {{t 'Unsubscribe' }}
- </button>
- </div>
+ {{#if show_private_stream_unsub_tooltip}}
+ {{> components/action_button label=(t "Unsubscribe") custom_classes="remove-subscription-button tippy-zulip-tooltip" attention="quiet" intent="danger" aria-label=(t "Unsubscribe") data-tippy-content=(t "Use channel settings to unsubscribe from private channels.") }}
+ {{else if show_last_user_in_private_stream_unsub_tooltip}}
+ {{> components/action_button label=(t "Unsubscribe") custom_classes="remove-subscription-button tippy-zulip-tooltip" attention="quiet" intent="danger" aria-label=(t "Unsubscribe") data-tippy-content=(t "Use channel settings to unsubscribe the last user from a private channel.") }}
+ {{else}}
+ {{> components/action_button label=(t "Unsubscribe") custom_classes="remove-subscription-button" attention="quiet" intent="danger" aria-label=(t "Unsubscribe") }}
+ {{/if}}
</td>
{{/if}}
</tr>