Show search source badges only with show_sources param

The badges are a debugging aid - render them only when explicitly
requested via ?show_sources=1 instead of on every search.
This commit is contained in:
Christoph Haas 2026-08-23 10:49:32 +02:00
parent 323b7004ed
commit 4c736096ae
3 changed files with 19 additions and 4 deletions

View file

@ -1,4 +1,10 @@
module PackagesHelper
# Search result origin badges are only shown when explicitly
# requested via ?show_sources=1
def search_sources_visible?
params[:show_sources].present?
end
# Human readable label for the search strategy that put a package
# into the search results (see PackagesController#search_packages)
def search_source_label(source)