diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-07-27 08:51:10 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-07-27 08:51:10 -0500 |
| commit | 4ee3ec09df8a980239fb040d77731b4d52705d7a (patch) | |
| tree | e4a6a532e0b651c3299eb1f6331f05abd04b9cc1 /src | |
| parent | cfe9d47fa000bb7ba1add20ef41408c19e0df33d (diff) | |
| download | invidious-4ee3ec09df8a980239fb040d77731b4d52705d7a.tar.gz invidious-4ee3ec09df8a980239fb040d77731b4d52705d7a.tar.bz2 invidious-4ee3ec09df8a980239fb040d77731b4d52705d7a.zip | |
Autofill search for playlists and communities page
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 3 | ||||
| -rw-r--r-- | src/invidious/views/template.ecr | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 835cffc7..b560fcb9 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -903,6 +903,7 @@ get "/search" do |env| count, videos = search(search_query, page, search_params, region).as(Tuple) end + env.set "search", query templated "search" end @@ -3070,6 +3071,7 @@ get "/channel/:ucid/playlists" do |env| items = items.map { |item| item.as(SearchPlaylist) } items.each { |item| item.author = "" } + env.set "search", "channel:#{channel.ucid} " templated "playlists" end @@ -3110,6 +3112,7 @@ get "/channel/:ucid/community" do |env| error_message = ex.message end + env.set "search", "channel:#{channel.ucid} " templated "community" end diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 0d8c9924..6272d2be 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -35,7 +35,7 @@ <div class="pure-u-1 pure-u-md-12-24 searchbar"> <form class="pure-form" action="/search" method="get"> <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> </form> </div> |
