mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Set query as an alias for search query in search
This commit is contained in:
parent
a9ff18812a
commit
8bd4e8026f
2 changed files with 7 additions and 4 deletions
|
@ -42,6 +42,7 @@ module Invidious::Routes::Search
|
||||||
|
|
||||||
query = env.params.query["search_query"]?
|
query = env.params.query["search_query"]?
|
||||||
query ||= env.params.query["q"]?
|
query ||= env.params.query["q"]?
|
||||||
|
query ||= env.params.query["query"]?
|
||||||
|
|
||||||
if !query || query.empty?
|
if !query || query.empty?
|
||||||
# Display the full page search box implemented in #1977
|
# Display the full page search box implemented in #1977
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<% is_channel_search = operators.fetch("channel", false) && channel.is_a? AboutChannel && !subscriptions.nil?%>
|
<% is_channel_search = operators.fetch("channel", false) && channel.is_a? AboutChannel && !subscriptions.nil?%>
|
||||||
|
<% filter_params = nil %>
|
||||||
|
|
||||||
<% content_for "header" do %>
|
<% content_for "header" do %>
|
||||||
<link rel="stylesheet" href="/css/search.css?v=<%= ASSET_COMMIT %>">
|
<link rel="stylesheet" href="/css/search.css?v=<%= ASSET_COMMIT %>">
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if is_channel_search %>
|
<% if is_channel_search %>
|
||||||
|
<% filter_params = "&channel=#{operators.fetch("channel", "")}" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= rendered "components/search-filters/search-filters" %>
|
<%= rendered "components/search-filters/search-filters" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -39,7 +41,7 @@
|
||||||
<div class="pure-g h-box v-box">
|
<div class="pure-g h-box v-box">
|
||||||
<div class="pure-u-1 pure-u-lg-1-5">
|
<div class="pure-u-1 pure-u-lg-1-5">
|
||||||
<% if page > 1 %>
|
<% if page > 1 %>
|
||||||
<a href="/search?q=<%= search_query_encoded %>&page=<%= page - 1 %>">
|
<a href="/search?q=<%= search_query_encoded %>&page=<%= page - 1 %><%=filter_params%>">
|
||||||
<%= translate(locale, "Previous page") %>
|
<%= translate(locale, "Previous page") %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -47,7 +49,7 @@
|
||||||
<div class="pure-u-1 pure-u-lg-3-5"></div>
|
<div class="pure-u-1 pure-u-lg-3-5"></div>
|
||||||
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
||||||
<% if count >= 20 %>
|
<% if count >= 20 %>
|
||||||
<a href="/search?q=<%= search_query_encoded %>&page=<%= page + 1 %>">
|
<a href="/search?q=<%= search_query_encoded %>&page=<%= page + 1 %><%=filter_params%>">
|
||||||
<%= translate(locale, "Next page") %>
|
<%= translate(locale, "Next page") %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -65,7 +67,7 @@
|
||||||
<div class="pure-g h-box">
|
<div class="pure-g h-box">
|
||||||
<div class="pure-u-1 pure-u-lg-1-5">
|
<div class="pure-u-1 pure-u-lg-1-5">
|
||||||
<% if page > 1 %>
|
<% if page > 1 %>
|
||||||
<a href="/search?q=<%= search_query_encoded %>&page=<%= page - 1 %>">
|
<a href="/search?q=<%= search_query_encoded %>&page=<%= page - 1 %><%=filter_params%>">
|
||||||
<%= translate(locale, "Previous page") %>
|
<%= translate(locale, "Previous page") %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -73,7 +75,7 @@
|
||||||
<div class="pure-u-1 pure-u-lg-3-5"></div>
|
<div class="pure-u-1 pure-u-lg-3-5"></div>
|
||||||
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
<div class="pure-u-1 pure-u-lg-1-5" style="text-align:right">
|
||||||
<% if count >= 20 %>
|
<% if count >= 20 %>
|
||||||
<a href="/search?q=<%= search_query_encoded %>&page=<%= page + 1 %>">
|
<a href="/search?q=<%= search_query_encoded %>&page=<%= page + 1 %><%=filter_params%>">
|
||||||
<%= translate(locale, "Next page") %>
|
<%= translate(locale, "Next page") %>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue