Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stream-settings: Extract channel folder UI to a new template.
Sahil Batra825880f4cd3a
diff --git a/web/templates/stream_settings/channel_folder.hbs b/web/templates/stream_settings/channel_folder.hbsnew file mode 100644index 00000000000..dde864b46e9--- /dev/null+++ b/web/templates/stream_settings/channel_folder.hbs@@ -0,0 +1,38 @@+<div class="channel-folder-subsection {{#if is_stream_edit}}settings-subsection-parent{{/if}}">+ <div class="channel-folder-title-container {{#if is_stream_edit}}subsection-header{{/if}}">+ <h3 class="stream_setting_subsection_title">{{t "Folders"}}</h3>+ {{#if is_stream_edit}}+ {{> ../settings/settings_save_discard_widget section_name="stream-permissions" }}+ {{/if}}+ </div>++ <div class="input-group channel-folder-container">+ {{!-- This is a modified version of dropdown_widget_with_label.hbs+ component so that we can show dropdown button and button to create+ a new folder on same line without having to add much CSS with+ hardcoded margin and padding values. --}}+ <label class="settings-field-label" for="{{channel_folder_widget_name}}_widget">+ {{t "Channel folder"}}+ {{> ../help_link_widget link="/help/channel-folders" }}+ </label>+ <span class="prop-element hide" id="id_{{channel_folder_widget_name}}" data-setting-widget-type="dropdown-list-widget" data-setting-value-type="number"></span>+ <div class="dropdown_widget_with_label_wrapper channel-folder-widget-container">+ {{> ../dropdown_widget widget_name=channel_folder_widget_name}}++ {{#if is_admin}}+ {{> ../components/action_button+ label=(t "Create new folder")+ attention="quiet"+ intent="neutral"+ type="button"+ custom_classes="create-channel-folder-button"+ }}+ {{/if}}+ </div>+ </div>++ <span class="settings-field-label no-folders-configured-message">+ {{t "There are no channel folders configured in this organization."}}+ {{> ../help_link_widget link="/help/channel-folders" }}+ </span>+</div>diff --git a/web/templates/stream_settings/stream_permissions.hbs b/web/templates/stream_settings/stream_permissions.hbsindex 5102585ac89..ccc785ac9ac 100644--- a/web/templates/stream_settings/stream_permissions.hbs+++ b/web/templates/stream_settings/stream_permissions.hbs@@ -27,44 +27,7 @@</div></div>-<div class="channel-folder-subsection {{#if is_stream_edit}}settings-subsection-parent{{/if}}">- <div class="channel-folder-title-container {{#if is_stream_edit}}subsection-header{{/if}}">- <h3 class="stream_setting_subsection_title">{{t "Folders"}}</h3>- {{#if is_stream_edit}}- {{> ../settings/settings_save_discard_widget section_name="stream-permissions" }}- {{/if}}- </div>-- <div class="input-group channel-folder-container">- {{!-- This is a modified version of dropdown_widget_with_label.hbs- component so that we can show dropdown button and button to create- a new folder on same line without having to add much CSS with- hardcoded margin and padding values. --}}- <label class="settings-field-label" for="{{channel_folder_widget_name}}_widget">- {{t "Channel folder"}}- {{> ../help_link_widget link="/help/channel-folders" }}- </label>- <span class="prop-element hide" id="id_{{channel_folder_widget_name}}" data-setting-widget-type="dropdown-list-widget" data-setting-value-type="number"></span>- <div class="dropdown_widget_with_label_wrapper channel-folder-widget-container">- {{> ../dropdown_widget widget_name=channel_folder_widget_name}}-- {{#if is_admin}}- {{> ../components/action_button- label=(t "Create new folder")- attention="quiet"- intent="neutral"- type="button"- custom_classes="create-channel-folder-button"- }}- {{/if}}- </div>- </div>-- <span class="settings-field-label no-folders-configured-message">- {{t "There are no channel folders configured in this organization."}}- {{> ../help_link_widget link="/help/channel-folders" }}- </span>-</div>+{{> channel_folder .}}<div class="advanced-configurations-container {{#if is_stream_edit}}settings-subsection-parent{{/if}}"><div class="advance-config-title-container {{#if is_stream_edit}}subsection-header{{/if}}">