Declutter search bar to only show search query

This commit changes the way search filters are parsed. Instead of
directly appending the data into the search query and creating k:v
pairs, all of the search filters are now a URL parameter. This results
in a clear look overall and hides much of the logic from the end user.

Closes #1969
This commit is contained in:
syeopite
2021-04-09 21:36:16 -07:00
parent ff43a47716
commit 1bb8429fe5
4 changed files with 15 additions and 20 deletions

View File

@@ -1726,8 +1726,6 @@ get "/channel/:ucid" do |env|
count, items = get_60_videos(channel.ucid, channel.author, page, channel.auto_generated, sort_by)
items.reject! &.paid
env.set "search", "channel:#{channel.ucid} "
end
templated "channel"
@@ -1781,7 +1779,6 @@ get "/channel/:ucid/playlists" do |env|
items = items.select { |item| item.is_a?(SearchPlaylist) }.map { |item| item.as(SearchPlaylist) }
items.each { |item| item.author = "" }
env.set "search", "channel:#{channel.ucid} "
templated "playlists"
end
@@ -1824,7 +1821,6 @@ get "/channel/:ucid/community" do |env|
next error_template(500, ex)
end
env.set "search", "channel:#{channel.ucid} "
templated "community"
end