diff --git a/assets/css/search.css b/assets/css/search.css index 226207a5..a5996362 100644 --- a/assets/css/search.css +++ b/assets/css/search.css @@ -69,6 +69,15 @@ fieldset, legend { #filters-apply { text-align: end; } +/* Error message */ + +.no-results-error { + text-align: center; + line-height: 180%; + font-size: 110%; + padding: 15px 15px 125px 15px; +} + /* Responsive rules */ @media only screen and (max-width: 800px) { diff --git a/locales/en-US.json b/locales/en-US.json index 03df88b6..58098929 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -175,7 +175,9 @@ "Show less": "Show less", "Watch on YouTube": "Watch on YouTube", "Switch Invidious Instance": "Switch Invidious Instance", - "Broken? Try another Invidious Instance": "Broken? Try another Invidious Instance", + "search_message_no_results": "No results found.", + "search_message_change_filters_or_query": "Try widening your search query and/or changing the filters.", + "search_message_use_another_instance": " You can also search on another instance.", "Hide annotations": "Hide annotations", "Show annotations": "Show annotations", "Genre: ": "Genre: ", diff --git a/src/invidious/frontend/misc.cr b/src/invidious/frontend/misc.cr new file mode 100644 index 00000000..43ba9f5c --- /dev/null +++ b/src/invidious/frontend/misc.cr @@ -0,0 +1,14 @@ +module Invidious::Frontend::Misc + extend self + + def redirect_url(env : HTTP::Server::Context) + prefs = env.get("preferences").as(Preferences) + + if prefs.automatic_instance_redirect + current_page = env.get?("current_page").as(String) + redirect_url = "/redirect?referer=#{current_page}" + else + redirect_url = "https://redirect.invidious.io#{env.request.resource}" + end + end +end diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index f1f6ab20..7110703e 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -9,18 +9,13 @@ url_prev_page = "/search?q=#{search_query_encoded}{filter_params}&page=#{query.page - 1}" url_next_page = "/search?q=#{search_query_encoded}{filter_params}&page=#{query.page + 1}" + + redirect_url = Invidious::Frontend::Misc.redirect_url(env) -%> -<% if videos.size == 0 %> -