diff --git a/static/js/managers/FilterManager.js b/static/js/managers/FilterManager.js index 23e4ac89..8d28fb31 100644 --- a/static/js/managers/FilterManager.js +++ b/static/js/managers/FilterManager.js @@ -39,8 +39,10 @@ export class FilterManager { this.createModelTypeTags(); } - // Add click handlers for license filter tags - this.initializeLicenseFilters(); + // Add click handlers for license filter tags if supported on this page + if (this.shouldShowLicenseFilters()) { + this.initializeLicenseFilters(); + } // Add click handler for filter button if (this.filterButton) { @@ -386,8 +388,10 @@ export class FilterManager { this.applyTagElementState(tag, state); }); - // Update license tags - this.updateLicenseSelections(); + // Update license tags if visible on this page + if (this.shouldShowLicenseFilters()) { + this.updateLicenseSelections(); + } this.updateModelTypeSelections(); } @@ -546,11 +550,15 @@ export class FilterManager { ...source, baseModel: Array.isArray(source.baseModel) ? [...source.baseModel] : [], tags: this.normalizeTagFilters(source.tags), - license: this.normalizeLicenseFilters(source.license), + license: this.shouldShowLicenseFilters() ? this.normalizeLicenseFilters(source.license) : {}, modelTypes: this.normalizeModelTypeFilters(source.modelTypes) }; } + shouldShowLicenseFilters() { + return this.currentPage !== 'recipes'; + } + normalizeTagFilters(tagFilters) { if (!tagFilters) { return {}; diff --git a/templates/components/header.html b/templates/components/header.html index 2c358914..e2942c39 100644 --- a/templates/components/header.html +++ b/templates/components/header.html @@ -147,6 +147,7 @@ {% endif %} + {% if current_page != 'recipes' %}

{{ t('header.filter.license') }}

@@ -158,6 +159,7 @@
+ {% endif %}