zulip/web/templates
Zixuan James Li 268f858f39 linkifier: Support URL templates for linkifiers.
This swaps out url_format_string from all of our APIs and replaces it
with url_template. Note that the documentation changes in the following
commits  will be squashed with this commit.

We change the "url_format" key to "url_template" for the
realm_linkifiers events in event_schema, along with updating
LinkifierDict. "url_template" is the name chosen to normalize
mixed usages of "url_format_string" and "url_format" throughout
the backend.

The markdown processor is updated to stop handling the format string
interpolation and delegate the task template expansion to the uri_template
library instead.

This change affects many test cases. We mostly just replace "%(name)s"
with "{name}", "url_format_string" with "url_template" to make sure that
they still pass. There are some test cases dedicated for testing "%"
escaping, which aren't relevant anymore and are subject to removal.
But for now we keep most of them as-is, and make sure that "%" is always
escaped since we do not use it for variable substitution any more.

Since url_format_string is not populated anymore, a migration is created
to remove this field entirely, and make url_template non-nullable since
we will always populate it. Note that it is possible to have
url_template being null after migration 0422 and before 0424, but
in practice, url_template will not be None after backfilling and the
backend now is always setting url_template.

With the removal of url_format_string, RealmFilter model will now be cleaned
with URL template checks, and the old checks for escapes are removed.

We also modified RealmFilter.clean to skip the validation when the
url_template is invalid. This avoids raising mulitple ValidationError's
when calling full_clean on a linkifier. But we might eventually want to
have a more centric approach to data validation instead of having
the same validation in both the clean method and the validator.

Fixes #23124.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-04-19 12:20:49 -07:00
..
compose_banner upload: Separate uploads into one upload bar per file. 2023-04-12 15:42:07 -07:00
confirm_dialog message_edit: Show modal when trying to move older messages. 2023-04-11 11:07:23 -07:00
navbar_alerts web: Save a needless 301 redirect from /apps to /apps/. 2023-03-24 14:51:01 -07:00
settings linkifier: Support URL templates for linkifiers. 2023-04-19 12:20:49 -07:00
stream_settings stream_privacy: Use new lock and hashtag icons. 2023-04-10 23:41:30 -07:00
user_group_settings settings: Add settings_text_input class to text inputs. 2023-03-27 22:34:30 -07:00
widgets
about_zulip.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
actions_popover_content.hbs web: Use `uri` instead of `url`. 2023-04-10 10:26:48 -07:00
actions_popover_template.hbs
all_messages_sidebar_actions.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
announce_stream_docs.hbs
blueslip_stacktrace.hbs
bookend.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
buddy_list_tooltip_content.hbs
change_email_modal.hbs modals: Add modal_text_input class to text inputs. 2023-03-27 22:34:30 -07:00
compose.hbs compose: Fix send later tooltip being cut by compose box container. 2023-04-19 09:43:50 -07:00
compose_control_buttons.hbs
compose_control_buttons_in_popover.hbs
compose_control_buttons_popover.hbs
compose_select_enter_behaviour_popover.hbs
copy_code_button.hbs
copy_invite_link.hbs
copy_message_button.hbs copy_message_button: Use `div` HTML tag instead of `button`. 2023-03-27 16:11:19 -07:00
copy_to_clipboard_svg.hbs
default_language_modal.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
dialog_change_password.hbs modals: Add modal_text_input class to text inputs. 2023-03-27 22:34:30 -07:00
dialog_widget.hbs modal: Make the modal content scrollable instead of the whole modal. 2023-03-01 15:36:29 -08:00
draft.hbs drafts: Add abstract classes for messages in an overlay. 2023-04-14 17:38:37 -07:00
draft_table_body.hbs drafts: Add abstract classes for messages in an overlay. 2023-04-14 17:38:37 -07:00
drafts_sidebar_action.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
edit_content_button.hbs
edited_notice.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
embedded_bot_config_item.hbs modals: Add modal_text_input class to text inputs. 2023-03-27 22:34:30 -07:00
emoji_popover.hbs
emoji_popover_content.hbs
emoji_popover_emoji.hbs css: Hyphenate .status-emoji selector. 2023-03-27 17:31:31 -07:00
emoji_popover_search_results.hbs
emoji_showcase.hbs
empty_feed_notice.hbs templates: Remove references to undefined fields. 2023-03-22 17:10:28 -07:00
favicon.svg.hbs
feedback_container.hbs
filter_topics.hbs
gear_menu.hbs web: Use `uri` instead of `url`. 2023-04-10 10:26:48 -07:00
giphy_picker.hbs
giphy_picker_mobile.hbs
help_link_widget.hbs
hotspot_icon.hbs
hotspot_overlay.hbs
inline_decorated_stream_name.hbs templates: Use new lock and hashtag icons for stream privacy. 2023-04-13 10:46:14 -07:00
input_pill.hbs
invitation_failed_error.hbs
invite_user_modal.hbs templates: Update `invite_users_modal.hbs` for undefined variables. 2023-04-10 09:07:11 -07:00
keyboard_shortcuts.hbs help: Document `=` keyboard shortcut. 2023-03-24 12:58:35 -07:00
left_sidebar.hbs tooltip: Append tooltips to "document.body". 2023-04-13 16:46:15 -07:00
left_sidebar_stream_setting_popover.hbs
lightbox_overlay.hbs
loader.hbs
login_to_access.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
login_to_view_image_button.hbs
mark_as_read_disabled_banner.hbs user_settings: Add option to not mark messages as read on scroll. 2023-04-18 18:32:02 -07:00
mark_as_read_turned_off_banner.hbs user_settings: Add option to not mark messages as read on scroll. 2023-04-18 18:32:02 -07:00
markdown_help.hbs markdown_help: Fix reference to possibly missing variables. 2023-04-04 12:56:18 -07:00
markdown_time_tooltip.hbs
markdown_timestamp.hbs
me_message.hbs
message_avatar.hbs
message_body.hbs message_body: Remove link from message time when locally echoed. 2023-04-17 12:19:20 -07:00
message_controls.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
message_edit_form.hbs upload: Separate uploads into one upload bar per file. 2023-04-12 15:42:07 -07:00
message_edit_history.hbs
message_feed_bottom_whitespace.hbs
message_feed_errors.hbs
message_group.hbs
message_hidden_dialog.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
message_history_modal.hbs
message_inline_image_tooltip.hbs
message_reaction.hbs templates: Fix &nbsp; syntax. 2023-03-15 16:34:32 -07:00
message_reactions.hbs
message_view_header.hbs navbar: Add Ionic search icon and use for navbar search. 2023-03-24 16:30:15 -07:00
mobile_message_buttons_popover_content.hbs private-messages: Update frontend strings to use "direct message" or "DM". 2023-02-24 11:47:26 -08:00
more_pms.hbs
more_topics.hbs
more_topics_spinner.hbs
move_topic_to_stream.hbs stream_popover: Add "Rename topic" option in topic sidebar popover. 2023-04-18 09:01:39 -07:00
muted_topic_ui_row.hbs settings: Drop column from tables on narrow screen. 2023-03-01 15:42:15 -08:00
muted_user_ui_row.hbs
narrow_to_compose_recipients_tooltip.hbs
navbar.hbs navbar: Use feathericon close icon. 2023-03-24 16:30:15 -07:00
navbar_icon_and_title.hbs stream_privacy: Use new lock and hashtag icons. 2023-04-10 23:41:30 -07:00
no_arrow_popover.hbs
non_editable_user_group.hbs
playground_links_popover_content.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
pm_list_item.hbs pm_list_item: Convert pm_user_status to a class. 2023-03-21 10:53:25 -07:00
presence_row.hbs
presence_rows.hbs
read_receipts.hbs
read_receipts_modal.hbs
recent_topic_row.hbs recipient_row: Set color of privacy icon as a shade of stream color. 2023-04-10 23:41:30 -07:00
recent_topics_filters.hbs private-messages: Update frontend strings to use "direct message" or "DM". 2023-02-24 11:47:26 -08:00
recent_topics_table.hbs
recipient_row.hbs recipient_row: Add a user icon at start of PMs. 2023-04-10 23:41:30 -07:00
remind_me_popover_content.hbs
resolve_topic_time_limit_error_modal.hbs message_edit: Show modal if user cannot resolve topics. 2023-04-17 11:25:28 -07:00
right_sidebar.hbs invite_user: Convert overlay to `dialog_widget`. 2023-02-26 18:37:05 -08:00
scheduled_message.hbs scheduled_messages: Add overlay to display and edit them. 2023-04-17 16:59:25 -07:00
scheduled_messages_overlay.hbs scheduled_messages: Add overlay to display and edit them. 2023-04-17 16:59:25 -07:00
search_list_item.hbs
search_operators.hbs private-messages: Update frontend strings to use "direct message" or "DM". 2023-02-24 11:47:26 -08:00
send_later_popover.hbs compose: Add UI to schedule messages. 2023-04-17 16:59:25 -07:00
set_status_overlay.hbs css: Hyphenate .status-emoji selector. 2023-03-27 17:31:31 -07:00
settings_overlay.hbs icons: Change bot icon from GitHub logo to Google material icon. 2023-04-13 10:47:09 -07:00
settings_tab.hbs
single_message.hbs message_row: Rename `local` class to be more verbose. 2023-04-17 12:19:20 -07:00
starred_messages_sidebar_actions.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
status_emoji.hbs css: Hyphenate .status-emoji selector. 2023-03-27 17:31:31 -07:00
status_emoji_selector.hbs css: Hyphenate .smiley-icon selector. 2023-03-27 17:31:31 -07:00
stream_privacy.hbs stream_privacy: Use new lock and hashtag icons. 2023-04-10 23:41:30 -07:00
stream_sidebar_actions.hbs recipient_row: Set color of privacy icon as a shade of stream color. 2023-04-10 23:41:30 -07:00
stream_sidebar_row.hbs recipient_row: Set color of privacy icon as a shade of stream color. 2023-04-10 23:41:30 -07:00
stream_topic_widget.hbs
streams_subheader.hbs
subscribe_to_more_streams.hbs
topic_edit_form.hbs
topic_list_item.hbs
topic_muted.hbs
topic_sidebar_actions.hbs popovers: Fix showing resolve topic option in sidebar popover. 2023-04-18 09:01:39 -07:00
topic_typeahead_hint.hbs compose_typeahead: Add hint text to topic typeahead dropdown. 2023-03-20 16:28:28 -07:00
typeahead_list_item.hbs typeahead: Show stream privacy icons in typeahead options. 2023-04-17 17:19:11 -07:00
typing_notification.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
typing_notifications.hbs
user_custom_profile_fields.hbs
user_group_info_popover.hbs
user_group_info_popover_content.hbs
user_group_list_item.hbs
user_info_popover_content.hbs web: Use `uri` instead of `url`. 2023-04-10 10:26:48 -07:00
user_info_popover_manage_menu.hbs templates: Replace unnecessary {{#tr}} blocks with {{t}} helper. 2023-03-16 11:26:45 -07:00
user_info_popover_title.hbs
user_profile_modal.hbs modals: Add modal_text_input class to text inputs. 2023-03-27 22:34:30 -07:00
user_stream_list_item.hbs recipient_row: Set color of privacy icon as a shade of stream color. 2023-04-10 23:41:30 -07:00
user_with_status_icon.hbs
view_code_in_playground.hbs