From c6409c77a4520d8ad97d24862591f52091617e39 Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Fri, 9 Aug 2024 03:20:02 -0700 Subject: [PATCH 1/8] Initial commit --- assets/404_tv_box_dark_theme.svg | 1261 ++++++++++++++++++++++++++++++ src/invidious/helpers/errors.cr | 5 +- src/invidious/views/error.ecr | 2 +- 3 files changed, 1265 insertions(+), 3 deletions(-) create mode 100644 assets/404_tv_box_dark_theme.svg 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/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index 21b789bc5..acabb1f26 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -74,7 +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") + return templated "error" end @@ -84,7 +85,7 @@ 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") 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..80305be07 100644 --- a/src/invidious/views/error.ecr +++ b/src/invidious/views/error.ecr @@ -3,6 +3,6 @@ <% end %>
- <%= error_message %> + <%= unfound_tv_box_dark_theme %> <%= next_steps %>
From 6044c6640707399393dcbec2867707786014b585 Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Sat, 10 Aug 2024 18:37:10 -0700 Subject: [PATCH 2/8] Set up for theme toggling --- src/invidious/helpers/errors.cr | 1 + src/invidious/views/error.ecr | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index acabb1f26..dc24b173e 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -85,6 +85,7 @@ 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") next_steps = error_redirect_helper(env) diff --git a/src/invidious/views/error.ecr b/src/invidious/views/error.ecr index 80305be07..6cf33f26f 100644 --- a/src/invidious/views/error.ecr +++ b/src/invidious/views/error.ecr @@ -3,6 +3,9 @@ <% end %>
+ + <%= error_message %> + <%= unfound_tv_box_dark_theme %> <%= next_steps %>
From 824206612dd54e6a9c52e43a8f45d761a235a795 Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Sat, 10 Aug 2024 22:59:17 -0700 Subject: [PATCH 3/8] Add dark light interoperability --- assets/404_tv_box_light_theme.svg | 1261 +++++++++++++++++++++++++++++ src/invidious/helpers/errors.cr | 6 +- src/invidious/views/error.ecr | 16 +- 3 files changed, 1277 insertions(+), 6 deletions(-) create mode 100644 assets/404_tv_box_light_theme.svg 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/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index dc24b173e..11eb1421e 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -75,7 +75,8 @@ def error_template_helper(env : HTTP::Server::Context, status_code : Int32, exce # 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 @@ -87,6 +88,7 @@ def error_template_helper(env : HTTP::Server::Context, status_code : Int32, mess 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" @@ -199,4 +201,4 @@ def error_redirect_helper(env : HTTP::Server::Context) else return "" end -end +end \ No newline at end of file diff --git a/src/invidious/views/error.ecr b/src/invidious/views/error.ecr index 6cf33f26f..ed504c2c1 100644 --- a/src/invidious/views/error.ecr +++ b/src/invidious/views/error.ecr @@ -1,11 +1,19 @@ +<% + dark_mode = env.get("preferences").as(Preferences).dark_mode +%> + <% content_for "header" do %> <%= "Error" %> - Invidious <% end %>
- +
<%= error_message %> - - <%= unfound_tv_box_dark_theme %> + <% if dark_mode == "dark" %> + <%= unfound_tv_box_dark_theme %> + <% else %> + <%= unfound_tv_box_light_theme %> + <% end %> +
<%= next_steps %> -
+ \ No newline at end of file From f8793c6d9f0b0eafae13c20cf362422e5e88cc4f Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Sat, 10 Aug 2024 23:20:05 -0700 Subject: [PATCH 4/8] Restore new line EOF --- src/invidious/helpers/errors.cr | 2 +- src/invidious/views/error.ecr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr index 11eb1421e..0d735f859 100644 --- a/src/invidious/helpers/errors.cr +++ b/src/invidious/helpers/errors.cr @@ -201,4 +201,4 @@ def error_redirect_helper(env : HTTP::Server::Context) else return "" end -end \ No newline at end of file +end diff --git a/src/invidious/views/error.ecr b/src/invidious/views/error.ecr index ed504c2c1..2c910525c 100644 --- a/src/invidious/views/error.ecr +++ b/src/invidious/views/error.ecr @@ -16,4 +16,4 @@ <% end %> <%= next_steps %> - \ No newline at end of file + From a9600c8c7cae275255602e044056708376f1fa55 Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Mon, 12 Aug 2024 22:34:39 -0700 Subject: [PATCH 5/8] Asset --- assets/css/default.css | 6 ++++++ src/invidious/views/error.ecr | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/css/default.css b/assets/css/default.css index a47762ec1..f37394f7b 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -799,3 +799,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/views/error.ecr b/src/invidious/views/error.ecr index 2c910525c..7dfcfd015 100644 --- a/src/invidious/views/error.ecr +++ b/src/invidious/views/error.ecr @@ -10,9 +10,9 @@
<%= error_message %> <% if dark_mode == "dark" %> - <%= unfound_tv_box_dark_theme %> + SVG Image <% else %> - <%= unfound_tv_box_light_theme %> + SVG Image <% end %>
<%= next_steps %> From 270468e2eb0b05e863cf50e414818f68d2d57ab3 Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Tue, 13 Aug 2024 00:32:50 -0700 Subject: [PATCH 6/8] Center items --- assets/404_tv_box_dark_theme.svg | 4 ++-- assets/404_tv_box_light_theme.svg | 4 ++-- src/invidious/views/error.ecr | 10 +++++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/assets/404_tv_box_dark_theme.svg b/assets/404_tv_box_dark_theme.svg index 6217ccd3f..60c00bd28 100644 --- a/assets/404_tv_box_dark_theme.svg +++ b/assets/404_tv_box_dark_theme.svg @@ -1,7 +1,7 @@
-
+
<%= error_message %> <% if dark_mode == "dark" %> - SVG Image +
+ SVG Image +
<% else %> - SVG Image +
+ SVG Image +
<% end %>
<%= next_steps %> From 5e87b32530dae052b158422e3daebdfeedde5420 Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Tue, 13 Aug 2024 00:36:54 -0700 Subject: [PATCH 7/8] Increase scale --- assets/404_tv_box_dark_theme.svg | 4 ++-- assets/404_tv_box_light_theme.svg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/404_tv_box_dark_theme.svg b/assets/404_tv_box_dark_theme.svg index 60c00bd28..6217ccd3f 100644 --- a/assets/404_tv_box_dark_theme.svg +++ b/assets/404_tv_box_dark_theme.svg @@ -1,7 +1,7 @@ Date: Tue, 13 Aug 2024 00:40:48 -0700 Subject: [PATCH 8/8] Twice --- assets/404_tv_box_light_theme.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/404_tv_box_light_theme.svg b/assets/404_tv_box_light_theme.svg index 0a7e4f36b..9c2f97050 100644 --- a/assets/404_tv_box_light_theme.svg +++ b/assets/404_tv_box_light_theme.svg @@ -1,7 +1,7 @@