diff --git a/assets/404_tv_box_dark_theme.svg b/assets/404_tv_box_dark_theme.svg new file mode 100644 index 000000000..6217ccd3f --- /dev/null +++ b/assets/404_tv_box_dark_theme.svg @@ -0,0 +1,1261 @@ + + + + + + Layer 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/404_tv_box_light_theme.svg b/assets/404_tv_box_light_theme.svg new file mode 100644 index 000000000..9c2f97050 --- /dev/null +++ b/assets/404_tv_box_light_theme.svg @@ -0,0 +1,1261 @@ + + + + + + Layer 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/css/default.css b/assets/css/default.css index 2cedcf0c5..d95bded35 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -816,3 +816,9 @@ h1, h2, h3, h4, h5, p, #download_widget { width: 100%; } + +/* 404 TV Box */ +.error-page { + width: 50%; + height: auto; +} \ No newline at end of file diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index b2df682d5..7a0f3a000 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -74,6 +74,8 @@ def error_template_helper(env : HTTP::Server::Context, status_code : Int32, exce # Don't show the usual "next steps" widget. The same options are # proposed above the error message, just worded differently. next_steps = "" + unfound_tv_box_dark_theme = File.read("assets/404_tv_box_dark_theme.svg") + unfound_tv_box_light_theme = File.read("assets/404_tv_box_light_theme.svg") return templated "error" end @@ -85,6 +87,8 @@ def error_template_helper(env : HTTP::Server::Context, status_code : Int32, mess locale = env.get("preferences").as(Preferences).locale error_message = translate(locale, message) + unfound_tv_box_dark_theme = File.read("assets/404_tv_box_dark_theme.svg") + unfound_tv_box_light_theme = File.read("assets/404_tv_box_light_theme.svg") next_steps = error_redirect_helper(env) return templated "error" diff --git a/src/invidious/views/error.ecr b/src/invidious/views/error.ecr index 04eb74d54..bc35524ff 100644 --- a/src/invidious/views/error.ecr +++ b/src/invidious/views/error.ecr @@ -1,8 +1,23 @@ +<% + dark_mode = env.get("preferences").as(Preferences).dark_mode +%> + <% content_for "header" do %> <%= "Error" %> - Invidious <% end %>
- <%= error_message %> +
+ <%= error_message %> + <% if dark_mode == "dark" %> +
+ SVG Image +
+ <% else %> +
+ SVG Image +
+ <% end %> +
<%= next_steps %>