From 7729d6496e45d4de9c7b6449b0d40ed9e53d8f22 Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 26 Jun 2021 19:39:30 -0700 Subject: [PATCH] Set query as an alias for search query in search --- src/invidious/routes/search.cr | 1 + src/invidious/views/search.ecr | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/invidious/routes/search.cr b/src/invidious/routes/search.cr index 176b6288..71955dd0 100644 --- a/src/invidious/routes/search.cr +++ b/src/invidious/routes/search.cr @@ -40,6 +40,7 @@ class Invidious::Routes::Search < Invidious::Routes::BaseRoute query = env.params.query["search_query"]? query ||= env.params.query["q"]? + query ||= env.params.query["query"]? if !query || query.empty? # Display the full page search box implemented in #1977 diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index 36fd612c..a8b327d8 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -1,4 +1,5 @@ <% is_channel_search = operators.fetch("channel", false) && channel.is_a? AboutChannel && !subscriptions.nil?%> +<% filter_params = nil %> <% content_for "header" do %> @@ -22,6 +23,7 @@ <% end %> <% if is_channel_search %> + <% filter_params = "&channel=#{operators.fetch("channel", "")}" %> <% else %> <%= rendered "components/search-filters/search-filters" %> <% end %> @@ -36,7 +38,7 @@
<% if page > 1 %> - + <%= translate(locale, "Previous page") %> <% end %> @@ -44,7 +46,7 @@
<% if count >= 20 %> - + <%= translate(locale, "Next page") %> <% end %> @@ -62,7 +64,7 @@
<% if page > 1 %> - + <%= translate(locale, "Previous page") %> <% end %> @@ -70,7 +72,7 @@
<% if count >= 20 %> - + <%= translate(locale, "Next page") %> <% end %>