mirror of
https://github.com/iv-org/invidious
synced 2024-11-28 05:53:28 +01:00
Autofill search for playlists and communities page
This commit is contained in:
parent
cfe9d47fa0
commit
4ee3ec09df
@ -903,6 +903,7 @@ get "/search" do |env|
|
|||||||
count, videos = search(search_query, page, search_params, region).as(Tuple)
|
count, videos = search(search_query, page, search_params, region).as(Tuple)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
env.set "search", query
|
||||||
templated "search"
|
templated "search"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -3070,6 +3071,7 @@ get "/channel/:ucid/playlists" do |env|
|
|||||||
items = items.map { |item| item.as(SearchPlaylist) }
|
items = items.map { |item| item.as(SearchPlaylist) }
|
||||||
items.each { |item| item.author = "" }
|
items.each { |item| item.author = "" }
|
||||||
|
|
||||||
|
env.set "search", "channel:#{channel.ucid} "
|
||||||
templated "playlists"
|
templated "playlists"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -3110,6 +3112,7 @@ get "/channel/:ucid/community" do |env|
|
|||||||
error_message = ex.message
|
error_message = ex.message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
env.set "search", "channel:#{channel.ucid} "
|
||||||
templated "community"
|
templated "community"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<div class="pure-u-1 pure-u-md-12-24 searchbar">
|
<div class="pure-u-1 pure-u-md-12-24 searchbar">
|
||||||
<form class="pure-form" action="/search" method="get">
|
<form class="pure-form" action="/search" method="get">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="search" style="width:100%" name="q" placeholder="<%= translate(locale, "search") %>" value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } || env.params.query["q"]?.try {|x| HTML.escape(x)} %>">
|
<input type="search" style="width:100%" name="q" placeholder="<%= translate(locale, "search") %>" value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } %>">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user