diff --git a/src/invidious/routes/misc.cr b/src/invidious/routes/misc.cr index d6bd9571..28a134a9 100644 --- a/src/invidious/routes/misc.cr +++ b/src/invidious/routes/misc.cr @@ -43,4 +43,14 @@ module Invidious::Routes::Misc instance_url = fetch_random_instance env.redirect "https://#{instance_url}#{referer}" end + + def self.confirm_leave(env) + locale = env.get("preferences").as(Preferences).locale + + link = env.params.query["link"]? + + referer = get_referer(env) + + templated "confirm_leave" + end end diff --git a/src/invidious/routing.cr b/src/invidious/routing.cr index ba05da19..1504e7ea 100644 --- a/src/invidious/routing.cr +++ b/src/invidious/routing.cr @@ -21,6 +21,7 @@ module Invidious::Routing get "/privacy", Routes::Misc, :privacy get "/licenses", Routes::Misc, :licenses get "/redirect", Routes::Misc, :cross_instance_redirect + get "/confirm_leave", Routes::Misc, :confirm_leave self.register_channel_routes self.register_watch_routes diff --git a/src/invidious/views/confirm_leave.ecr b/src/invidious/views/confirm_leave.ecr new file mode 100644 index 00000000..1b9027af --- /dev/null +++ b/src/invidious/views/confirm_leave.ecr @@ -0,0 +1,24 @@ +<% content_for "header" do %> +<%= translate(locale, "Leave Invidious") %> - Invidious +<% end %> + +
+
+ + <%= translate(locale, "You are leaving Invidious. Continue to external link?") %> + + + +
+