\n)
@@ -98,7 +104,7 @@ module Invidious::Frontend::Pagination
str << %(
)
if !first_page
- self.first_page(str, locale, base_url.to_s)
+ self.first_page(str, locale, base_url.to_s, previous_page_button)
end
str << %(
\n)
diff --git a/src/invidious/routes/before_all.cr b/src/invidious/routes/before_all.cr
index 396840a4..be80659f 100644
--- a/src/invidious/routes/before_all.cr
+++ b/src/invidious/routes/before_all.cr
@@ -104,10 +104,13 @@ module Invidious::Routes::BeforeAll
thin_mode = env.params.query["thin_mode"]? || preferences.thin_mode.to_s
thin_mode = thin_mode == "true"
locale = env.params.query["hl"]? || preferences.locale
+ previous_page_button = env.params.query["previous_page_button"]? || preferences.previous_page_button.to_s
+ previous_page_button = previous_page_button == "true"
preferences.dark_mode = dark_mode
preferences.thin_mode = thin_mode
preferences.locale = locale
+ preferences.previous_page_button = previous_page_button
env.set "preferences", preferences
current_page = env.request.path
diff --git a/src/invidious/routes/preferences.cr b/src/invidious/routes/preferences.cr
index abe0f34e..5c86202d 100644
--- a/src/invidious/routes/preferences.cr
+++ b/src/invidious/routes/preferences.cr
@@ -140,6 +140,10 @@ module Invidious::Routes::PreferencesRoute
notifications_only ||= "off"
notifications_only = notifications_only == "on"
+ previous_page_button = env.params.body["previous_page_button"]?.try &.as(String)
+ previous_page_button ||= "off"
+ previous_page_button = previous_page_button == "on"
+
# Convert to JSON and back again to take advantage of converters used for compatibility
preferences = Preferences.from_json({
annotations: annotations,
@@ -175,6 +179,7 @@ module Invidious::Routes::PreferencesRoute
vr_mode: vr_mode,
show_nick: show_nick,
save_player_pos: save_player_pos,
+ previous_page_button: previous_page_button
}.to_json)
if user = env.get? "user"
diff --git a/src/invidious/user/preferences.cr b/src/invidious/user/preferences.cr
index b3059403..a0ea3018 100644
--- a/src/invidious/user/preferences.cr
+++ b/src/invidious/user/preferences.cr
@@ -55,6 +55,7 @@ struct Preferences
property extend_desc : Bool = CONFIG.default_user_preferences.extend_desc
property volume : Int32 = CONFIG.default_user_preferences.volume
property save_player_pos : Bool = CONFIG.default_user_preferences.save_player_pos
+ property previous_page_button : Bool = CONFIG.default_user_preferences.previous_page_button
module BoolToString
def self.to_json(value : String, json : JSON::Builder)
diff --git a/src/invidious/views/channel.ecr b/src/invidious/views/channel.ecr
index df39d1ea..123a0a50 100644
--- a/src/invidious/views/channel.ecr
+++ b/src/invidious/views/channel.ecr
@@ -21,7 +21,8 @@
page_nav_html = IV::Frontend::Pagination.nav_ctoken(locale,
base_url: relative_url,
ctoken: next_continuation,
- first_page: continuation.nil?
+ first_page: continuation.nil?,
+ previous_page_button: env.get("preferences").as(Preferences).previous_page_button
)
%>
@@ -41,6 +42,10 @@
<%- end -%>
+<%- if env.get("preferences").as(Preferences).previous_page_button -%>
+
+<%- end -%>
+
<%= author %> - Invidious
<% end %>
diff --git a/src/invidious/views/components/items_paginated.ecr b/src/invidious/views/components/items_paginated.ecr
index 4534a0a3..d0cb8771 100644
--- a/src/invidious/views/components/items_paginated.ecr
+++ b/src/invidious/views/components/items_paginated.ecr
@@ -8,4 +8,14 @@
<%= page_nav_html %>
+
+
diff --git a/src/invidious/views/user/preferences.ecr b/src/invidious/views/user/preferences.ecr
index 55349c5a..4b915a53 100644
--- a/src/invidious/views/user/preferences.ecr
+++ b/src/invidious/views/user/preferences.ecr
@@ -189,6 +189,12 @@
<% end %>