mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
The alignment of icon and text of the disabled option in
dropdown widget was somewhow broken due to an extra span
element present which broke the grid layout used for
rendering the icon and text properly.
This also makes the layout consistent with other options
shown with icon.
This was due to e643d7e6fd
which resulted in space
between icon and text. We could have fix that by using
"~" character to remove whitespace in handlebar templates
but making the layout consistent felt a better choice.
67 lines
3.7 KiB
Handlebars
67 lines
3.7 KiB
Handlebars
{{#with item}}
|
|
<li class="list-item {{#if is_current_user_setting}}current_user_setting{{/if}}" role="presentation" data-unique-id="{{unique_id}}" data-name="{{name}}" tabindex="0">
|
|
{{#if description}}
|
|
<a class="dropdown-list-item-common-styles">
|
|
<span class="dropdown-list-item-name">
|
|
{{#if bold_current_selection}}
|
|
<span class="dropdown-list-text-selected">{{name}}</span>
|
|
{{# if (or has_edit_icon has_delete_icon)}}
|
|
<span class="dropdown-list-buttons">
|
|
{{#if has_edit_icon}}
|
|
{{> components/icon_button custom_classes="dropdown-list-edit dropdown-list-control-button" intent="neutral" icon="edit" aria-label=edit_icon_label }}
|
|
{{/if}}
|
|
{{#if has_delete_icon}}
|
|
{{> components/icon_button custom_classes="dropdown-list-delete dropdown-list-control-button" intent="danger" icon="trash" aria-label=delete_icon_label }}
|
|
{{/if}}
|
|
</span>
|
|
{{/if}}
|
|
{{else}}
|
|
<span class="dropdown-list-text-neutral">{{name}}</span>
|
|
{{/if}}
|
|
</span>
|
|
<span class="dropdown-list-item-description line-clamp">
|
|
{{description}}
|
|
</span>
|
|
</a>
|
|
{{else}}
|
|
<a class="dropdown-list-item-common-styles {{#if is_setting_disabled}}setting-disabled-option{{/if}}">
|
|
{{#if stream}}
|
|
{{> inline_decorated_channel_name stream=stream show_colored_icon=true}}
|
|
{{else if is_direct_message}}
|
|
<i class="zulip-icon zulip-icon-users channel-privacy-type-icon"></i> <span class="decorated-dm-name">{{name}}</span>
|
|
{{else if is_setting_disabled}}
|
|
{{#if show_disabled_icon}}
|
|
<i class="setting-disabled-option-icon fa fa-ban" aria-hidden="true"></i>
|
|
{{/if}}
|
|
{{#if show_disabled_option_name}}
|
|
<span class="setting-disabled-option-text dropdown-list-text-neutral">{{name}}</span>
|
|
{{else}}
|
|
<span class="setting-disabled-option-text dropdown-list-text-neutral">{{t "Disable" }}</span>
|
|
{{/if}}
|
|
{{else if (eq unique_id -2)}}
|
|
{{!-- This is the option for PresetUrlOption.MAPPING --}}
|
|
<i class="zulip-icon zulip-icon-equal channel-privacy-type-icon" aria-hidden="true"></i> <span class="dropdown-list-text-neutral">{{name}}</span>
|
|
{{else}}
|
|
<span class="dropdown-list-item-name">
|
|
{{#if bold_current_selection}}
|
|
<span class="dropdown-list-text-selected">{{name}}</span>
|
|
{{else}}
|
|
<span class="dropdown-list-text-neutral">{{name}}</span>
|
|
{{/if}}
|
|
{{# if (or has_edit_icon has_delete_icon)}}
|
|
<span class="dropdown-list-buttons">
|
|
{{#if has_edit_icon}}
|
|
{{> components/icon_button custom_classes="dropdown-list-edit dropdown-list-control-button" intent="neutral" icon="edit" aria-label=(t "Edit folder") }}
|
|
{{/if}}
|
|
{{#if has_delete_icon}}
|
|
{{> components/icon_button custom_classes="dropdown-list-delete dropdown-list-control-button" intent="danger" icon="trash" aria-label=(t "Delete folder") }}
|
|
{{/if}}
|
|
</span>
|
|
{{/if}}
|
|
</span>
|
|
{{/if}}
|
|
</a>
|
|
{{/if}}
|
|
</li>
|
|
{{/with}}
|