From 9753be50d30837e712aa7771b6c5aeacacc5b66e Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sat, 4 May 2024 01:58:17 -0400 Subject: [PATCH] Options for donation and contact links --- config/config.example.yml | 8 +- locales/en-US.json | 4 +- locales/es.json | 3 +- src/invidious/config.cr | 4 + src/invidious/views/template.ecr | 340 ++++++++++++++++--------------- 5 files changed, 188 insertions(+), 171 deletions(-) diff --git a/config/config.example.yml b/config/config.example.yml index 38085a20..2b353c23 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -791,7 +791,7 @@ default_user_preferences: ## Default: true ## #vr_mode: true - + ## ## Save the playback position ## Allow to continue watching at the previous position when @@ -899,3 +899,9 @@ default_user_preferences: ## Default: false ## #extend_desc: false + +# redis_url: 127.0.0.1:6379 +# redis_socket: /var/run/valkey/valkey.sock +# donation_url: "https://example.com/donate" +# contact_url: "https://example.com/contact" +# home_domain: "https://example.com/ diff --git a/locales/en-US.json b/locales/en-US.json index 22336c5c..c25acfa9 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -497,5 +497,7 @@ "toggle_theme": "Toggle Theme", "carousel_slide": "Slide {{current}} of {{total}}", "carousel_skip": "Skip the Carousel", - "carousel_go_to": "Go to slide `x`" + "carousel_go_to": "Go to slide `x`", + "footer_contact_url": "Contact the Administrator" + } diff --git a/locales/es.json b/locales/es.json index e130d2c5..9b03b1d0 100644 --- a/locales/es.json +++ b/locales/es.json @@ -514,5 +514,6 @@ "The Popular feed has been disabled by the administrator.": "El feed Popular ha sido desactivado por el administrador.", "carousel_slide": "Diapositiva {{current}} de {{total}}", "carousel_skip": "Saltar el carrusel", - "carousel_go_to": "Ir a la diapositiva `x`" + "carousel_go_to": "Ir a la diapositiva `x`", + "footer_contact_url": "Contactar al Administrador" } diff --git a/src/invidious/config.cr b/src/invidious/config.cr index 8962623c..1c947294 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -88,6 +88,10 @@ class Config property hmac_key : String = "" # Domain to be used for links to resources on the site where an absolute URL is required property domain : String? + property donation_url : String? + property contact_url : String? + property home_domain : String? + # Subscribe to channels using PubSubHubbub (requires domain, hmac_key) property use_pubsub_feeds : Bool | Int32 = false property popular_enabled : Bool = true diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 02d2f1ba..c2d06700 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -1,183 +1,187 @@ <% - locale = env.get("preferences").as(Preferences).locale - dark_mode = env.get("preferences").as(Preferences).dark_mode + locale = env.get("preferences").as(Preferences).locale + dark_mode = env.get("preferences").as(Preferences).dark_mode %> - - - - <%= yield_content "header" %> - - - - - - - - - - - - - - - + + + + <%= yield_content "header" %> + + + + + + + + + + + + + + + --theme"> - -
-
- - - - <% if env.get? "user" %> - - - <% if CONFIG.enable_user_notifications %> - - <% end %> - <% end %> - +
+
+ + + <% if env.get? "user" %> + + + <% if CONFIG.enable_user_notifications %> + + <% end %> + <% end %> +