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:
parent
323b7004ed
commit
4c736096ae
3 changed files with 19 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue