diff --git a/static/templates/admin_profile_field_list.hbs b/static/templates/admin_profile_field_list.hbs index 106ea03551..08f6dee920 100644 --- a/static/templates/admin_profile_field_list.hbs +++ b/static/templates/admin_profile_field_list.hbs @@ -42,7 +42,7 @@
{{#each choices}} - {{partial "settings/profile_field_choice" }} + {{> settings/profile_field_choice }} {{/each}}
diff --git a/static/templates/admin_settings_modals.hbs b/static/templates/admin_settings_modals.hbs index b8b033cfee..b00538acf2 100644 --- a/static/templates/admin_settings_modals.hbs +++ b/static/templates/admin_settings_modals.hbs @@ -1,9 +1,9 @@ -{{ partial "settings/deactivation_user_modal" }} +{{> settings/deactivation_user_modal }} -{{ partial "settings/realm_domains_modal" }} +{{> settings/realm_domains_modal }} -{{ partial "settings/revoke_invite_modal" }} +{{> settings/revoke_invite_modal }} -{{ partial "settings/resend_invite_modal" }} +{{> settings/resend_invite_modal }}
diff --git a/static/templates/admin_tab.hbs b/static/templates/admin_tab.hbs index d562f51132..0c315f92be 100644 --- a/static/templates/admin_tab.hbs +++ b/static/templates/admin_tab.hbs @@ -1,30 +1,30 @@
-{{ partial "admin_settings_modals"}} +{{> admin_settings_modals}} -{{ partial "settings/organization_profile_admin" }} +{{> settings/organization_profile_admin }} -{{ partial "settings/organization_settings_admin" }} +{{> settings/organization_settings_admin }} -{{ partial "settings/organization_permissions_admin" }} +{{> settings/organization_permissions_admin }} -{{ partial "settings/emoji_settings_admin" }} +{{> settings/emoji_settings_admin }} -{{ partial "settings/user_list_admin" }} +{{> settings/user_list_admin }} -{{ partial "settings/deactivated_users_admin" }} +{{> settings/deactivated_users_admin }} -{{ partial "settings/bot_list_admin" }} +{{> settings/bot_list_admin }} -{{ partial "settings/default_streams_list_admin" }} +{{> settings/default_streams_list_admin }} -{{ partial "settings/auth_methods_settings_admin" }} +{{> settings/auth_methods_settings_admin }} -{{ partial "settings/linkifier_settings_admin" }} +{{> settings/linkifier_settings_admin }} -{{ partial "settings/invites_list_admin" }} +{{> settings/invites_list_admin }} -{{ partial "user_groups_admin" }} +{{> user_groups_admin }} -{{ partial "settings/profile_field_settings_admin" }} +{{> settings/profile_field_settings_admin }} diff --git a/static/templates/archive_message_group.hbs b/static/templates/archive_message_group.hbs index 784e7d876c..09c9a9ce41 100644 --- a/static/templates/archive_message_group.hbs +++ b/static/templates/archive_message_group.hbs @@ -6,7 +6,7 @@ {{/if}}
- {{partial "archive_recipient_row" }} + {{> archive_recipient_row }} {{#each message_containers}} {{{ this }}} {{/each}} diff --git a/static/templates/draft_table_body.hbs b/static/templates/draft_table_body.hbs index bf933143f9..cde69542ab 100644 --- a/static/templates/draft_table_body.hbs +++ b/static/templates/draft_table_body.hbs @@ -19,7 +19,7 @@
{{#each drafts}} - {{partial "draft"}} + {{> draft}} {{/each}} diff --git a/static/templates/edit_bot.hbs b/static/templates/edit_bot.hbs index 2fe2e86e23..3559525273 100644 --- a/static/templates/edit_bot.hbs +++ b/static/templates/edit_bot.hbs @@ -14,7 +14,7 @@
- {{partial "bot_owner_select" }} + {{> bot_owner_select }}
diff --git a/static/templates/emoji_popover_content.hbs b/static/templates/emoji_popover_content.hbs index 97756771b8..8a751297ca 100644 --- a/static/templates/emoji_popover_content.hbs +++ b/static/templates/emoji_popover_content.hbs @@ -13,7 +13,7 @@
{{name}}
{{#each this.emojis }} - {{ partial "emoji_popover_emoji" "type" "emoji_picker_emoji" "section" @../index "index" @index "message_id" ../../message_id "emoji_dict" this}} + {{> emoji_popover_emoji type="emoji_picker_emoji" section=@../index index=@index message_id=../../message_id emoji_dict=this}} {{/each}}
{{/each}} diff --git a/static/templates/emoji_popover_search_results.hbs b/static/templates/emoji_popover_search_results.hbs index 12f4fba088..a53162b0c3 100644 --- a/static/templates/emoji_popover_search_results.hbs +++ b/static/templates/emoji_popover_search_results.hbs @@ -1,3 +1,3 @@ {{#each search_results}} -{{ partial "emoji_popover_emoji" "type" "emoji_search_result" "section" "0" "index" @index "message_id" ../message_id "emoji_dict" this }} +{{> emoji_popover_emoji type="emoji_search_result" section="0" index=@index message_id=../message_id emoji_dict=this }} {{/each}} diff --git a/static/templates/me_message.hbs b/static/templates/me_message.hbs index d2cc718fde..4d0caa0b64 100644 --- a/static/templates/me_message.hbs +++ b/static/templates/me_message.hbs @@ -1,6 +1,6 @@ - {{partial "message_avatar"}} + {{> message_avatar}} @@ -14,7 +14,7 @@ {{#if edited_status_msg}} - {{partial "edited_notice"}} + {{> edited_notice}} {{/if}} diff --git a/static/templates/message_body.hbs b/static/templates/message_body.hbs index 97a0007392..642898b4c9 100644 --- a/static/templates/message_body.hbs +++ b/static/templates/message_body.hbs @@ -3,7 +3,7 @@ {{#if include_sender}} - {{partial "message_avatar"}} + {{> message_avatar}} {{msg/sender_full_name}} {{#if sender_is_bot}} @@ -15,7 +15,7 @@ {{/unless}} {{#if status_message}} - {{partial "me_message"}} + {{> me_message}} {{/if}} @@ -28,10 +28,10 @@ {{#if edited_alongside_sender}} - {{partial "edited_notice"}} + {{> edited_notice}} {{/if}} - {{partial "message_controls"}} + {{> message_controls}}
@@ -40,7 +40,7 @@ {{/unless}} {{#if edited_in_left_col}} -{{partial "edited_notice"}} +{{> edited_notice}} {{/if}}
@@ -48,4 +48,4 @@
{{t "[More...]" }}
{{t "[Condense this message]" }}
-
{{ partial "message_reactions" }}
+
{{> message_reactions }}
diff --git a/static/templates/message_group.hbs b/static/templates/message_group.hbs index 48aff2657e..f97f2a7cc6 100644 --- a/static/templates/message_group.hbs +++ b/static/templates/message_group.hbs @@ -8,20 +8,20 @@ {{/if}} {{#if bookend_top}} - {{partial "bookend"}} + {{> bookend}} {{/if}}
- {{partial "recipient_row" "use_match_properties" ../use_match_properties}} + {{> recipient_row use_match_properties=../use_match_properties}} {{#each message_containers}} {{#with this}} - {{partial "single_message" "use_match_properties" ../../use_match_properties "table_name" ../../table_name}} + {{> single_message use_match_properties=../../use_match_properties table_name=../../table_name}} {{/with}} {{/each}}
{{#if bookend_bottom}} - {{partial "bookend"}} + {{> bookend}} {{/if}} {{/with}} diff --git a/static/templates/message_reactions.hbs b/static/templates/message_reactions.hbs index 26930e78d3..d9e6d33a46 100644 --- a/static/templates/message_reactions.hbs +++ b/static/templates/message_reactions.hbs @@ -1,5 +1,5 @@ {{#each this/msg/message_reactions}} -{{partial "message_reaction"}} +{{> message_reaction}} {{/each}}
diff --git a/static/templates/settings/auth_methods_settings_admin.hbs b/static/templates/settings/auth_methods_settings_admin.hbs index 356c57ac47..be0f5fa7c5 100644 --- a/static/templates/settings/auth_methods_settings_admin.hbs +++ b/static/templates/settings/auth_methods_settings_admin.hbs @@ -3,7 +3,7 @@

{{t "Authentication methods" }}

- {{ partial "settings/settings_save_discard_widget" "section_name" "auth_settings" }} + {{> settings_save_discard_widget section_name="auth_settings" }}
diff --git a/static/templates/settings/bot_settings.hbs b/static/templates/settings/bot_settings.hbs index 8c86df2ac9..e0cb97b370 100644 --- a/static/templates/settings/bot_settings.hbs +++ b/static/templates/settings/bot_settings.hbs @@ -88,7 +88,7 @@
{{#each page_params.realm_embedded_bots as |bot index|}} {{#each bot.config as |config_value config_key|}} - {{partial "embedded_bot_config_item" "botname" bot.name "key" config_key "value" config_value}} + {{> ../embedded_bot_config_item botname=bot.name key=config_key value=config_value}} {{/each}} {{/each}}
diff --git a/static/templates/settings/display_settings.hbs b/static/templates/settings/display_settings.hbs index 48c904c033..b0eb6bbc10 100644 --- a/static/templates/settings/display_settings.hbs +++ b/static/templates/settings/display_settings.hbs @@ -16,7 +16,7 @@
- {{ partial "default_language_modal"}} + {{> ../default_language_modal}}
@@ -24,11 +24,11 @@
{{#each display_settings.settings.user_display_settings}} - {{partial "settings/settings_checkbox" - "setting_name" this - "is_checked" (lookup ../page_params this) - "label" (lookup ../settings_label this) - "render_only" (lookup ../display_settings.render_only this)}} + {{> settings_checkbox + setting_name=this + is_checked=(lookup ../page_params this) + label=(lookup ../settings_label this) + render_only=(lookup ../display_settings.render_only this)}} {{/each}}
@@ -49,10 +49,10 @@

{{t "Time settings" }}

- {{partial "settings/settings_checkbox" - "setting_name" "twenty_four_hour_time" - "is_checked" page_params.twenty_four_hour_time - "label" settings_label.twenty_four_hour_time}} + {{> settings_checkbox + setting_name="twenty_four_hour_time" + is_checked=page_params.twenty_four_hour_time + label=settings_label.twenty_four_hour_time}}
@@ -93,10 +93,10 @@
- {{partial "settings/settings_checkbox" - "setting_name" "translate_emoticons" - "is_checked" page_params.translate_emoticons - "label" settings_label.translate_emoticons}} + {{> settings_checkbox + setting_name="translate_emoticons" + is_checked=page_params.translate_emoticons + label=settings_label.translate_emoticons}}
diff --git a/static/templates/settings/emoji_settings_admin.hbs b/static/templates/settings/emoji_settings_admin.hbs index e6f18483ef..26958d25a3 100644 --- a/static/templates/settings/emoji_settings_admin.hbs +++ b/static/templates/settings/emoji_settings_admin.hbs @@ -1,6 +1,6 @@
- {{partial "settings/emoji_settings_tip"}} + {{> emoji_settings_tip}}
diff --git a/static/templates/settings/notification_settings.hbs b/static/templates/settings/notification_settings.hbs index 801b0a8d54..949df23fec 100644 --- a/static/templates/settings/notification_settings.hbs +++ b/static/templates/settings/notification_settings.hbs @@ -8,12 +8,12 @@

{{t "Unless I say otherwise for a particular stream, I want:" }}

{{#each notification_settings.stream_notification_settings}} - {{partial "settings/settings_checkbox" - "setting_name" this - "is_checked" (lookup ../page_params this) - "label" (lookup ../settings_label this) - "realm_push_notifications_enabled" (lookup ../page_params.realm_push_notifications_enabled) - "push_notifications_tooltip" (lookup ../push_notification_tooltip this)}} + {{> settings_checkbox + setting_name=this + is_checked=(lookup ../page_params this) + label=(lookup ../settings_label this) + realm_push_notifications_enabled=(lookup ../page_params.realm_push_notifications_enabled) + push_notifications_tooltip=(lookup ../push_notification_tooltip this)}} {{/each}}

@@ -26,12 +26,12 @@

{{#each notification_settings.pm_mention_notification_settings}} - {{partial "settings/settings_checkbox" - "setting_name" this - "is_checked" (lookup ../page_params this) - "label" (lookup ../settings_label this) - "realm_push_notifications_enabled" (lookup ../page_params.realm_push_notifications_enabled) - "push_notifications_tooltip" (lookup ../push_notification_tooltip this)}} + {{> settings_checkbox + setting_name=this + is_checked=(lookup ../page_params this) + label=(lookup ../settings_label this) + realm_push_notifications_enabled=(lookup ../page_params.realm_push_notifications_enabled) + push_notifications_tooltip=(lookup ../push_notification_tooltip this)}} {{/each}}
@@ -43,10 +43,10 @@
{{t "Desktop" }}
{{#each notification_settings.desktop_notification_settings}} - {{partial "settings/settings_checkbox" - "setting_name" this - "is_checked" (lookup ../page_params this) - "label" (lookup ../settings_label this)}} + {{> settings_checkbox + setting_name=this + is_checked=(lookup ../page_params this) + label=(lookup ../settings_label this)}} {{/each}}
diff --git a/static/templates/settings/organization_permissions_admin.hbs b/static/templates/settings/organization_permissions_admin.hbs index 697d710aa6..6fca410bb9 100644 --- a/static/templates/settings/organization_permissions_admin.hbs +++ b/static/templates/settings/organization_permissions_admin.hbs @@ -4,7 +4,7 @@

{{t "Joining the organization" }}

- {{ partial "settings/settings_save_discard_widget" "section_name" "org-join" }} + {{> settings_save_discard_widget section_name="org-join" }}
@@ -36,33 +36,33 @@

{{t "User identity" }}

- {{ partial "settings/settings_save_discard_widget" "section_name" "user-identity" }} + {{> settings_save_discard_widget section_name="user-identity" }}
- {{partial "settings/settings_checkbox" - "setting_name" "realm_name_changes_disabled" - "prefix" "id_" - "is_checked" realm_name_changes_disabled - "label" admin_settings_label.realm_name_changes_disabled}} + {{> settings_checkbox + setting_name="realm_name_changes_disabled" + prefix="id_" + is_checked=realm_name_changes_disabled + label=admin_settings_label.realm_name_changes_disabled}} - {{partial "settings/settings_checkbox" - "setting_name" "realm_email_changes_disabled" - "prefix" "id_" - "is_checked" realm_email_changes_disabled - "label" admin_settings_label.realm_email_changes_disabled}} + {{> settings_checkbox + setting_name="realm_email_changes_disabled" + prefix="id_" + is_checked=realm_email_changes_disabled + label=admin_settings_label.realm_email_changes_disabled}} - {{partial "settings/settings_checkbox" - "setting_name" "realm_avatar_changes_disabled" - "prefix" "id_" - "is_checked" realm_avatar_changes_disabled - "label" admin_settings_label.realm_avatar_changes_disabled}} + {{> settings_checkbox + setting_name="realm_avatar_changes_disabled" + prefix="id_" + is_checked=realm_avatar_changes_disabled + label=admin_settings_label.realm_avatar_changes_disabled}}

{{t "Other permissions" }}

- {{ partial "settings/settings_save_discard_widget" "section_name" "other-permissions" }} + {{> settings_save_discard_widget section_name="other-permissions" }}
diff --git a/static/templates/settings/organization_profile_admin.hbs b/static/templates/settings/organization_profile_admin.hbs index c7bd4c5384..cb2bc629bf 100644 --- a/static/templates/settings/organization_profile_admin.hbs +++ b/static/templates/settings/organization_profile_admin.hbs @@ -9,7 +9,7 @@ - {{ partial "settings/settings_save_discard_widget" "section_name" "org-profile" }} + {{> settings_save_discard_widget section_name="org-profile" }}
@@ -116,7 +116,7 @@ {{t 'Deactivate organization' }}
- {{ partial "settings/deactivate_realm_modal"}} + {{> deactivate_realm_modal}}
diff --git a/static/templates/settings/organization_settings_admin.hbs b/static/templates/settings/organization_settings_admin.hbs index 3f8e488a8d..5aae5b1827 100644 --- a/static/templates/settings/organization_settings_admin.hbs +++ b/static/templates/settings/organization_settings_admin.hbs @@ -10,7 +10,7 @@ - {{ partial "settings/settings_save_discard_widget" "section_name" "msg-editing" }} + {{> settings_save_discard_widget section_name="msg-editing" }}
@@ -32,17 +32,17 @@
- {{partial "settings/settings_checkbox" - "setting_name" "realm_allow_community_topic_editing" - "prefix" "id_" - "is_checked" realm_allow_community_topic_editing - "label" admin_settings_label.realm_allow_community_topic_editing}} + {{> settings_checkbox + setting_name="realm_allow_community_topic_editing" + prefix="id_" + is_checked=realm_allow_community_topic_editing + label=admin_settings_label.realm_allow_community_topic_editing}} - {{partial "settings/settings_checkbox" - "setting_name" "realm_allow_edit_history" - "prefix" "id_" - "is_checked" realm_allow_edit_history - "label" admin_settings_label.realm_allow_edit_history}} + {{> settings_checkbox + setting_name="realm_allow_edit_history" + prefix="id_" + is_checked=realm_allow_edit_history + label=admin_settings_label.realm_allow_edit_history}}
- {{ partial "stream_types" "is_public" true }} + {{> stream_types is_public=true }}
- {{ partial "subscription_setting_icon" }} + {{> subscription_setting_icon }}
{{name}}
- {{partial "subscription_count"}} + {{> subscription_count}}
diff --git a/static/templates/subscription_settings.hbs b/static/templates/subscription_settings.hbs index 0c25158b67..3a7b13c0d8 100644 --- a/static/templates/subscription_settings.hbs +++ b/static/templates/subscription_settings.hbs @@ -41,7 +41,7 @@
- {{partial "subscription_type"}} + {{> subscription_type}}
[{{t "Change" }}]
@@ -51,16 +51,16 @@
    {{#each settings}}
  • - {{partial "stream_settings_checkbox" - "setting_name" name - "prefix" "sub_" - "suffix" "_setting" - "is_checked" value - "is_muted" (lookup ../sub "is_muted") - "stream_id" (lookup ../sub "stream_id") - "notification_setting" is_notification_setting - "realm_setting_disabled" (lookup ../realm_settings name) - "label" label}} + {{> stream_settings_checkbox + setting_name=name + prefix="sub_" + suffix="_setting" + is_checked=value + is_muted=(lookup ../sub "is_muted") + stream_id=(lookup ../sub "stream_id") + notification_setting=is_notification_setting + realm_setting_disabled=(lookup ../realm_settings name) + label=label}}
  • {{/each}}
  • @@ -80,7 +80,7 @@
{{#with sub}}
- {{partial "subscription_members"}} + {{> subscription_members}}
{{/with}}
diff --git a/static/templates/subscription_stream_privacy_modal.hbs b/static/templates/subscription_stream_privacy_modal.hbs index e1fd18b654..68eca73e66 100644 --- a/static/templates/subscription_stream_privacy_modal.hbs +++ b/static/templates/subscription_stream_privacy_modal.hbs @@ -3,7 +3,7 @@

{{t "Change stream permissions for #" }}{{ stream_name }}

- {{ partial "stream_types" }} + {{> stream_types }} - {{ partial "stream_creation_form" }} + {{> stream_creation_form }} diff --git a/static/templates/subscriptions.hbs b/static/templates/subscriptions.hbs index 964257637d..aef3b63e30 100644 --- a/static/templates/subscriptions.hbs +++ b/static/templates/subscriptions.hbs @@ -1,3 +1,3 @@ {{#each subscriptions}} -{{partial "subscription"}} +{{> subscription}} {{/each}} diff --git a/static/templates/typing_notifications.hbs b/static/templates/typing_notifications.hbs index 516780310d..ec77e769cf 100644 --- a/static/templates/typing_notifications.hbs +++ b/static/templates/typing_notifications.hbs @@ -1,6 +1,6 @@ {{! Typing Notifications }} diff --git a/static/templates/user_presence_rows.hbs b/static/templates/user_presence_rows.hbs index 897536ec25..9a13d564bb 100644 --- a/static/templates/user_presence_rows.hbs +++ b/static/templates/user_presence_rows.hbs @@ -1,4 +1,4 @@ {{! User Presence rows }} {{#each users}} -{{partial "user_presence_row"}} +{{> user_presence_row}} {{/each}} diff --git a/tools/lib/template_parser.py b/tools/lib/template_parser.py index 00c0821b4f..b49f53e78a 100644 --- a/tools/lib/template_parser.py +++ b/tools/lib/template_parser.py @@ -61,7 +61,7 @@ def tokenize(text): return looking_at("{#") def looking_at_handlebarpartial() -> bool: - return looking_at("{{partial") + return looking_at("{{>") def looking_at_html_start(): # type: () -> bool diff --git a/tools/tests/test_pretty_print.py b/tools/tests/test_pretty_print.py index 93981cdf4a..ec3f620221 100644 --- a/tools/tests/test_pretty_print.py +++ b/tools/tests/test_pretty_print.py @@ -209,7 +209,7 @@ BAD_HTML8 = """
{{{test}}}
{{/if}} {{#if foobar2}} - {{partial "teststuff"}} + {{> teststuff}} {{/if}} {{/with}} {{/each}} @@ -222,7 +222,7 @@ GOOD_HTML8 = """
{{{test}}}
{{/if}} {{#if foobar2}} - {{partial "teststuff"}} + {{> teststuff}} {{/if}} {{/with}} {{/each}} @@ -422,19 +422,19 @@ GOOD_HTML15 = """ BAD_HTML16 = """
- {{partial "settings_checkbox" - "setting_name" "realm_name_in_notifications" - "is_checked" page_params.realm_name_in_notifications - "label" settings_label.realm_name_in_notifications}} + {{> settings_checkbox + setting_name="realm_name_in_notifications" + is_checked=page_params.realm_name_in_notifications + label=settings_label.realm_name_in_notifications}}
""" GOOD_HTML16 = """
- {{partial "settings_checkbox" - "setting_name" "realm_name_in_notifications" - "is_checked" page_params.realm_name_in_notifications - "label" settings_label.realm_name_in_notifications}} + {{> settings_checkbox + setting_name="realm_name_in_notifications" + is_checked=page_params.realm_name_in_notifications + label=settings_label.realm_name_in_notifications}}
"""