datasette/datasette/templates
Matt Van Horn 5f83d94119
Add content hash to JS includes (closes #2714)
The CSS link in base.html already carries `?{{ app_css_hash }}` so that
browsers refetch when the bundled file changes. The five first-party JS
files shipped with datasette did not. Cache-busting JS the same way
matches the existing CSS pattern and uses the static_hash() helper that
already powers app_css_hash().

Files updated:
- datasette/app.py: expose static_hash as a callable in template context.
- datasette/handle_exception.py: include static_hash in the error-page
  template context (mirrors the existing app_css_hash entry there).
- datasette/templates/base.html: hash datasette-manager.js and
  navigation-search.js.
- datasette/templates/table.html: hash column-chooser.js, table.js, and
  mobile-column-actions.js.
- tests/test_html.py: new test_js_content_hash parametrized across all
  five files; existing test_navigation_menu_links updated to expect the
  new query string.

Vendored libraries (cm-editor-6.0.1.bundle.js, sql-formatter-2.3.3.min.js,
json-format-highlight-1.0.1.js) already carry a version in the filename
and were left unchanged.
2026-05-26 00:14:15 -07:00
..
_action_menu.html Keyboard navigation and ARIA attributes for actions menus (#2727) 2026-05-24 14:11:04 -07:00
_close_open_menus.html Keyboard navigation and ARIA attributes for actions menus (#2727) 2026-05-24 14:11:04 -07:00
_codemirror.html Remove min-height on CodeMirror, closes #1899 2022-11-17 23:21:00 -08:00
_codemirror_foot.html Use DOMContentLoaded instead of load event for CodeMirror initialization. Closes #1894 (#1898) 2022-11-17 23:29:00 -08:00
_crumbs.html Refactor breadcrumbs to respect permissions, refs #1831 2022-10-13 14:42:52 -07:00
_debug_common_functions.html Simplified the code for the permission debug pages 2025-10-30 10:28:04 -07:00
_description_source_license.html ?_extra= support and TableView refactor to table_view 2023-03-22 15:49:39 -07:00
_facet_results.html Fix for datalist against foreign key facets 2022-11-17 17:23:35 -08:00
_footer.html Queries took rather than query took, closes #1572 2021-12-18 20:03:21 -08:00
_permission_ui_styles.html New allowed_resources_sql plugin hook and debug tools (#2505) 2025-10-08 14:27:51 -07:00
_permissions_debug_tabs.html Permission tabs include allow debug page 2025-10-30 17:54:07 -07:00
_suggested_facets.html ?_extra= support and TableView refactor to table_view 2023-03-22 15:49:39 -07:00
_table.html Table headers and column options visible for 0 rows 2026-04-22 22:23:02 -07:00
allow_debug.html Permission tabs include allow debug page 2025-10-30 17:54:07 -07:00
api_explorer.html New .core CSS class for inputs and buttons 2024-09-03 08:37:26 -07:00
base.html Add content hash to JS includes (closes #2714) 2026-05-26 00:14:15 -07:00
create_token.html Replace token-based CSRF with Sec-Fetch-Site header protection (#2689) 2026-04-14 17:11:36 -07:00
csrf_error.html Replace token-based CSRF with Sec-Fetch-Site header protection (#2689) 2026-04-14 17:11:36 -07:00
database.html /-/schema and /db/-/schema and /db/table/-/schema pages (plus .json/.md) 2025-11-07 12:01:23 -08:00
debug_actions.html Fix for text None shown on /-/actions, closes #2599 2025-11-26 17:12:52 -08:00
debug_allowed.html Simplified the code for the permission debug pages 2025-10-30 10:28:04 -07:00
debug_check.html Simplified the code for the permission debug pages 2025-10-30 10:28:04 -07:00
debug_permissions_playground.html Replace token-based CSRF with Sec-Fetch-Site header protection (#2689) 2026-04-14 17:11:36 -07:00
debug_rules.html Permissions SQL API improvements (#2558) 2025-10-30 15:48:46 -07:00
error.html Refactor breadcrumbs to respect permissions, refs #1831 2022-10-13 14:42:52 -07:00
index.html Fix for spacing on index page, closes #2399 2024-08-20 09:36:02 -07:00
logout.html Replace token-based CSRF with Sec-Fetch-Site header protection (#2689) 2026-04-14 17:11:36 -07:00
messages_debug.html Replace token-based CSRF with Sec-Fetch-Site header protection (#2689) 2026-04-14 17:11:36 -07:00
patterns.html header.hd and footer.ft, refs #2420 2024-09-05 19:57:27 -07:00
query.html Fix 500 error when accessing query page without ?sql= parameter (#2744) 2026-05-25 12:33:57 -07:00
row.html Refactored action menus to a shared include, closes #2301 2024-03-12 16:35:34 -07:00
schema.html /-/schema and /db/-/schema and /db/table/-/schema pages (plus .json/.md) 2025-11-07 12:01:23 -08:00
show_json.html Refactor breadcrumbs to respect permissions, refs #1831 2022-10-13 14:42:52 -07:00
table.html Add content hash to JS includes (closes #2714) 2026-05-26 00:14:15 -07:00