From 75826d840956590caad6f456cfc911df620a9431 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Thu, 5 Oct 2023 04:31:40 +0000 Subject: [PATCH] handlebars: Move popover handlebars to a new popovers folder. Organize related handlebars in a new folder together. --- tools/linter_lib/custom_check.py | 2 +- web/src/add_stream_options_popover.js | 2 +- web/src/compose_popovers.js | 6 +++--- web/src/emoji_picker.js | 14 +++++++------- web/src/message_actions_popover.js | 2 +- web/src/playground_links_popover.js | 2 +- web/src/scheduled_messages_popover.js | 2 +- web/src/user_card_popover.js | 6 +++--- web/src/user_group_popover.js | 2 +- web/src/user_topic_popover.js | 2 +- web/templates/compose_control_buttons.hbs | 2 +- web/templates/{ => popovers}/actions_popover.hbs | 0 .../change_visibility_policy_popover.hbs | 0 .../compose_control_buttons_in_popover.hbs | 0 .../compose_control_buttons_popover.hbs | 0 .../compose_select_enter_behaviour_popover.hbs | 0 .../{ => popovers/emoji}/emoji_popover.hbs | 0 .../{ => popovers/emoji}/emoji_popover_emoji.hbs | 0 .../emoji}/emoji_popover_emoji_map.hbs | 0 .../emoji}/emoji_popover_search_results.hbs | 0 .../{ => popovers/emoji}/emoji_showcase.hbs | 0 .../left_sidebar_stream_setting_popover.hbs | 0 .../mobile_message_buttons_popover.hbs | 0 .../{ => popovers}/playground_links_popover.hbs | 0 .../{ => popovers}/send_later_popover.hbs | 0 .../{ => popovers/user_card}/user_card_popover.hbs | 2 +- .../user_card}/user_card_popover_avatar.hbs | 0 .../user_card}/user_card_popover_manage_menu.hbs | 0 .../{ => popovers}/user_group_info_popover.hbs | 0 web/tests/i18n.test.js | 4 ++-- 30 files changed, 24 insertions(+), 24 deletions(-) rename web/templates/{ => popovers}/actions_popover.hbs (100%) rename web/templates/{ => popovers}/change_visibility_policy_popover.hbs (100%) rename web/templates/{ => popovers/compose_control_buttons}/compose_control_buttons_in_popover.hbs (100%) rename web/templates/{ => popovers/compose_control_buttons}/compose_control_buttons_popover.hbs (100%) rename web/templates/{ => popovers}/compose_select_enter_behaviour_popover.hbs (100%) rename web/templates/{ => popovers/emoji}/emoji_popover.hbs (100%) rename web/templates/{ => popovers/emoji}/emoji_popover_emoji.hbs (100%) rename web/templates/{ => popovers/emoji}/emoji_popover_emoji_map.hbs (100%) rename web/templates/{ => popovers/emoji}/emoji_popover_search_results.hbs (100%) rename web/templates/{ => popovers/emoji}/emoji_showcase.hbs (100%) rename web/templates/{ => popovers}/left_sidebar_stream_setting_popover.hbs (100%) rename web/templates/{ => popovers}/mobile_message_buttons_popover.hbs (100%) rename web/templates/{ => popovers}/playground_links_popover.hbs (100%) rename web/templates/{ => popovers}/send_later_popover.hbs (100%) rename web/templates/{ => popovers/user_card}/user_card_popover.hbs (98%) rename web/templates/{ => popovers/user_card}/user_card_popover_avatar.hbs (100%) rename web/templates/{ => popovers/user_card}/user_card_popover_manage_menu.hbs (100%) rename web/templates/{ => popovers}/user_group_info_popover.hbs (100%) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index d8a728a735..59ad1401dd 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -694,7 +694,7 @@ html_rules: List["Rule"] = [ "templates/corporate/billing.html", "templates/corporate/upgrade.html", # Miscellaneous violations to be cleaned up - "web/templates/user_card_popover_avatar.hbs", + "web/templates/popovers/user_card/user_card_popover_avatar.hbs", "web/templates/confirm_dialog/confirm_subscription_invites_warning.hbs", "templates/zerver/reset_confirm.html", "templates/zerver/config_error.html", diff --git a/web/src/add_stream_options_popover.js b/web/src/add_stream_options_popover.js index c4c0870e64..377ffa2718 100644 --- a/web/src/add_stream_options_popover.js +++ b/web/src/add_stream_options_popover.js @@ -1,6 +1,6 @@ import $ from "jquery"; -import render_left_sidebar_stream_setting_popover from "../templates/left_sidebar_stream_setting_popover.hbs"; +import render_left_sidebar_stream_setting_popover from "../templates/popovers/left_sidebar_stream_setting_popover.hbs"; import * as popover_menus from "./popover_menus"; import * as settings_data from "./settings_data"; diff --git a/web/src/compose_popovers.js b/web/src/compose_popovers.js index 751500e1da..78103ea075 100644 --- a/web/src/compose_popovers.js +++ b/web/src/compose_popovers.js @@ -1,9 +1,9 @@ import $ from "jquery"; import {delegate} from "tippy.js"; -import render_compose_control_buttons_popover from "../templates/compose_control_buttons_popover.hbs"; -import render_compose_select_enter_behaviour_popover from "../templates/compose_select_enter_behaviour_popover.hbs"; -import render_mobile_message_buttons_popover from "../templates/mobile_message_buttons_popover.hbs"; +import render_compose_control_buttons_popover from "../templates/popovers/compose_control_buttons/compose_control_buttons_popover.hbs"; +import render_compose_select_enter_behaviour_popover from "../templates/popovers/compose_select_enter_behaviour_popover.hbs"; +import render_mobile_message_buttons_popover from "../templates/popovers/mobile_message_buttons_popover.hbs"; import * as channel from "./channel"; import * as common from "./common"; diff --git a/web/src/emoji_picker.js b/web/src/emoji_picker.js index d09b0f71a4..971782e835 100644 --- a/web/src/emoji_picker.js +++ b/web/src/emoji_picker.js @@ -2,10 +2,10 @@ import $ from "jquery"; import emoji_codes from "../../static/generated/emoji/emoji_codes.json"; import * as typeahead from "../shared/src/typeahead"; -import render_emoji_popover from "../templates/emoji_popover.hbs"; -import render_emoji_popover_emoji_map from "../templates/emoji_popover_emoji_map.hbs"; -import render_emoji_popover_search_results from "../templates/emoji_popover_search_results.hbs"; -import render_emoji_showcase from "../templates/emoji_showcase.hbs"; +import render_emoji_popover from "../templates/popovers/emoji/emoji_popover.hbs"; +import render_emoji_popover_emoji_map from "../templates/popovers/emoji/emoji_popover_emoji_map.hbs"; +import render_emoji_popover_search_results from "../templates/popovers/emoji/emoji_popover_search_results.hbs"; +import render_emoji_showcase from "../templates/popovers/emoji/emoji_showcase.hbs"; import * as blueslip from "./blueslip"; import * as compose_ui from "./compose_ui"; @@ -646,9 +646,9 @@ function get_default_emoji_popover_options() { emoji_popover_instance = instance; const $popover = $(instance.popper); $popover.addClass("emoji-popover-root"); - instance.setContent(ui_util.parse_html( - generate_emoji_picker_content(current_message_id), - )); + instance.setContent( + ui_util.parse_html(generate_emoji_picker_content(current_message_id)), + ); emoji_catalog_last_coordinates = { section: 0, index: 0, diff --git a/web/src/message_actions_popover.js b/web/src/message_actions_popover.js index 00dbe0b0d3..8c90e0fc2a 100644 --- a/web/src/message_actions_popover.js +++ b/web/src/message_actions_popover.js @@ -1,7 +1,7 @@ import ClipboardJS from "clipboard"; import $ from "jquery"; -import render_actions_popover from "../templates/actions_popover.hbs"; +import render_actions_popover from "../templates/popovers/actions_popover.hbs"; import * as blueslip from "./blueslip"; import * as compose_actions from "./compose_actions"; diff --git a/web/src/playground_links_popover.js b/web/src/playground_links_popover.js index dadfceee20..aa7f4bab96 100644 --- a/web/src/playground_links_popover.js +++ b/web/src/playground_links_popover.js @@ -1,7 +1,7 @@ import $ from "jquery"; import url_template_lib from "url-template"; -import render_playground_links_popover from "../templates/playground_links_popover.hbs"; +import render_playground_links_popover from "../templates/popovers/playground_links_popover.hbs"; import * as blueslip from "./blueslip"; import * as popover_menus from "./popover_menus"; diff --git a/web/src/scheduled_messages_popover.js b/web/src/scheduled_messages_popover.js index 656b87384d..e41a12c99f 100644 --- a/web/src/scheduled_messages_popover.js +++ b/web/src/scheduled_messages_popover.js @@ -1,9 +1,9 @@ import $ from "jquery"; import {delegate} from "tippy.js"; +import render_send_later_popover from "../templates/popovers/send_later_popover.hbs"; import render_send_later_modal from "../templates/send_later_modal.hbs"; import render_send_later_modal_options from "../templates/send_later_modal_options.hbs"; -import render_send_later_popover from "../templates/send_later_popover.hbs"; import * as compose from "./compose"; import * as compose_validate from "./compose_validate"; diff --git a/web/src/user_card_popover.js b/web/src/user_card_popover.js index 9d64183a09..4da52e5fe8 100644 --- a/web/src/user_card_popover.js +++ b/web/src/user_card_popover.js @@ -4,9 +4,9 @@ import $ from "jquery"; import tippy from "tippy.js"; import render_confirm_mute_user from "../templates/confirm_dialog/confirm_mute_user.hbs"; -import render_user_card_popover from "../templates/user_card_popover.hbs"; -import render_user_card_popover_avatar from "../templates/user_card_popover_avatar.hbs"; -import render_user_card_popover_manage_menu from "../templates/user_card_popover_manage_menu.hbs"; +import render_user_card_popover from "../templates/popovers/user_card/user_card_popover.hbs"; +import render_user_card_popover_avatar from "../templates/popovers/user_card/user_card_popover_avatar.hbs"; +import render_user_card_popover_manage_menu from "../templates/popovers/user_card/user_card_popover_manage_menu.hbs"; import * as blueslip from "./blueslip"; import * as buddy_data from "./buddy_data"; diff --git a/web/src/user_group_popover.js b/web/src/user_group_popover.js index 68e8006801..c04b547717 100644 --- a/web/src/user_group_popover.js +++ b/web/src/user_group_popover.js @@ -1,6 +1,6 @@ import $ from "jquery"; -import render_user_group_info_popover from "../templates/user_group_info_popover.hbs"; +import render_user_group_info_popover from "../templates/popovers/user_group_info_popover.hbs"; import * as blueslip from "./blueslip"; import * as buddy_data from "./buddy_data"; diff --git a/web/src/user_topic_popover.js b/web/src/user_topic_popover.js index 0f4ab3c094..6d9198159a 100644 --- a/web/src/user_topic_popover.js +++ b/web/src/user_topic_popover.js @@ -1,6 +1,6 @@ import $ from "jquery"; -import render_change_visibility_policy_popover from "../templates/change_visibility_policy_popover.hbs"; +import render_change_visibility_policy_popover from "../templates/popovers/change_visibility_policy_popover.hbs"; import * as popover_menus from "./popover_menus"; import * as popover_menus_data from "./popover_menus_data"; diff --git a/web/templates/compose_control_buttons.hbs b/web/templates/compose_control_buttons.hbs index f9cbbc75d9..782f999213 100644 --- a/web/templates/compose_control_buttons.hbs +++ b/web/templates/compose_control_buttons.hbs @@ -24,7 +24,7 @@
|
- {{> compose_control_buttons_in_popover}} + {{> popovers/compose_control_buttons/compose_control_buttons_in_popover}}
{{t 'Drafts' }} diff --git a/web/templates/actions_popover.hbs b/web/templates/popovers/actions_popover.hbs similarity index 100% rename from web/templates/actions_popover.hbs rename to web/templates/popovers/actions_popover.hbs diff --git a/web/templates/change_visibility_policy_popover.hbs b/web/templates/popovers/change_visibility_policy_popover.hbs similarity index 100% rename from web/templates/change_visibility_policy_popover.hbs rename to web/templates/popovers/change_visibility_policy_popover.hbs diff --git a/web/templates/compose_control_buttons_in_popover.hbs b/web/templates/popovers/compose_control_buttons/compose_control_buttons_in_popover.hbs similarity index 100% rename from web/templates/compose_control_buttons_in_popover.hbs rename to web/templates/popovers/compose_control_buttons/compose_control_buttons_in_popover.hbs diff --git a/web/templates/compose_control_buttons_popover.hbs b/web/templates/popovers/compose_control_buttons/compose_control_buttons_popover.hbs similarity index 100% rename from web/templates/compose_control_buttons_popover.hbs rename to web/templates/popovers/compose_control_buttons/compose_control_buttons_popover.hbs diff --git a/web/templates/compose_select_enter_behaviour_popover.hbs b/web/templates/popovers/compose_select_enter_behaviour_popover.hbs similarity index 100% rename from web/templates/compose_select_enter_behaviour_popover.hbs rename to web/templates/popovers/compose_select_enter_behaviour_popover.hbs diff --git a/web/templates/emoji_popover.hbs b/web/templates/popovers/emoji/emoji_popover.hbs similarity index 100% rename from web/templates/emoji_popover.hbs rename to web/templates/popovers/emoji/emoji_popover.hbs diff --git a/web/templates/emoji_popover_emoji.hbs b/web/templates/popovers/emoji/emoji_popover_emoji.hbs similarity index 100% rename from web/templates/emoji_popover_emoji.hbs rename to web/templates/popovers/emoji/emoji_popover_emoji.hbs diff --git a/web/templates/emoji_popover_emoji_map.hbs b/web/templates/popovers/emoji/emoji_popover_emoji_map.hbs similarity index 100% rename from web/templates/emoji_popover_emoji_map.hbs rename to web/templates/popovers/emoji/emoji_popover_emoji_map.hbs diff --git a/web/templates/emoji_popover_search_results.hbs b/web/templates/popovers/emoji/emoji_popover_search_results.hbs similarity index 100% rename from web/templates/emoji_popover_search_results.hbs rename to web/templates/popovers/emoji/emoji_popover_search_results.hbs diff --git a/web/templates/emoji_showcase.hbs b/web/templates/popovers/emoji/emoji_showcase.hbs similarity index 100% rename from web/templates/emoji_showcase.hbs rename to web/templates/popovers/emoji/emoji_showcase.hbs diff --git a/web/templates/left_sidebar_stream_setting_popover.hbs b/web/templates/popovers/left_sidebar_stream_setting_popover.hbs similarity index 100% rename from web/templates/left_sidebar_stream_setting_popover.hbs rename to web/templates/popovers/left_sidebar_stream_setting_popover.hbs diff --git a/web/templates/mobile_message_buttons_popover.hbs b/web/templates/popovers/mobile_message_buttons_popover.hbs similarity index 100% rename from web/templates/mobile_message_buttons_popover.hbs rename to web/templates/popovers/mobile_message_buttons_popover.hbs diff --git a/web/templates/playground_links_popover.hbs b/web/templates/popovers/playground_links_popover.hbs similarity index 100% rename from web/templates/playground_links_popover.hbs rename to web/templates/popovers/playground_links_popover.hbs diff --git a/web/templates/send_later_popover.hbs b/web/templates/popovers/send_later_popover.hbs similarity index 100% rename from web/templates/send_later_popover.hbs rename to web/templates/popovers/send_later_popover.hbs diff --git a/web/templates/user_card_popover.hbs b/web/templates/popovers/user_card/user_card_popover.hbs similarity index 98% rename from web/templates/user_card_popover.hbs rename to web/templates/popovers/user_card/user_card_popover.hbs index d49b0dca09..9a066dbb1e 100644 --- a/web/templates/user_card_popover.hbs +++ b/web/templates/popovers/user_card/user_card_popover.hbs @@ -52,7 +52,7 @@
  • {{ user_type }}
  • {{/if}} {{!-- Display selected custom profile fields in this popover. --}} - {{> user_custom_profile_fields profile_fields=display_profile_fields for_user_card_popover=true}} + {{> ../../user_custom_profile_fields profile_fields=display_profile_fields for_user_card_popover=true}}
  • {{t "Joined {date_joined}" }}
  • diff --git a/web/templates/user_card_popover_avatar.hbs b/web/templates/popovers/user_card/user_card_popover_avatar.hbs similarity index 100% rename from web/templates/user_card_popover_avatar.hbs rename to web/templates/popovers/user_card/user_card_popover_avatar.hbs diff --git a/web/templates/user_card_popover_manage_menu.hbs b/web/templates/popovers/user_card/user_card_popover_manage_menu.hbs similarity index 100% rename from web/templates/user_card_popover_manage_menu.hbs rename to web/templates/popovers/user_card/user_card_popover_manage_menu.hbs diff --git a/web/templates/user_group_info_popover.hbs b/web/templates/popovers/user_group_info_popover.hbs similarity index 100% rename from web/templates/user_group_info_popover.hbs rename to web/templates/popovers/user_group_info_popover.hbs diff --git a/web/tests/i18n.test.js b/web/tests/i18n.test.js index f6dcd7f27d..eee7eb78d3 100644 --- a/web/tests/i18n.test.js +++ b/web/tests/i18n.test.js @@ -77,12 +77,12 @@ run_test("t_tag", ({mock_template}) => { "http://zulip.zulipdev.com/#narrow/stream/101-devel/topic/testing/near/99", }; - mock_template("actions_popover.hbs", true, (data, html) => { + mock_template("popovers/actions_popover.hbs", true, (data, html) => { assert.equal(data, args); assert.ok(html.indexOf("Citer et rĂ©pondre") > 0); }); - require("../templates/actions_popover.hbs")(args); + require("../templates/popovers/actions_popover.hbs")(args); }); run_test("tr_tag", ({mock_template}) => {