From d660a4c2cbe00efff28ad431b52b299fc7c90a3a Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Tue, 25 Jul 2023 21:32:03 +0530 Subject: [PATCH 1/3] add option for instance donations --- config/config.example.yml | 10 ++++++++++ locales/en-US.json | 3 ++- src/invidious/config.cr | 1 + src/invidious/views/template.ecr | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/config/config.example.yml b/config/config.example.yml index 34070fe5..9e2b4058 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -496,6 +496,16 @@ hmac_key: "CHANGE_ME!!" ## #modified_source_code_url: "" +## +## Instance donation URL. If your instance has a donation option. +## you can add it here so it will be present in the footer along +## with the donation link for the project itself. +## +## Accepted values: a string +## Default: +## +#donate_url: "" + ## ## Maximum custom playlist length limit. ## diff --git a/locales/en-US.json b/locales/en-US.json index 74f43d90..e4af73b4 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -453,7 +453,8 @@ "next_steps_error_message": "After which you should try to: ", "next_steps_error_message_refresh": "Refresh", "next_steps_error_message_go_to_youtube": "Go to YouTube", - "footer_donate_page": "Donate", + "footer_donate_page": "Donate to Invidious", + "footer_instance_donate_page": "Donate to the instance", "footer_documentation": "Documentation", "footer_source_code": "Source code", "footer_original_source_code": "Original source code", diff --git a/src/invidious/config.cr b/src/invidious/config.cr index e5f1e822..60c840a4 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -116,6 +116,7 @@ class Config # URL to the modified source code to be easily AGPL compliant # Will display in the footer, next to the main source code link property modified_source_code_url : String? = nil + property donate_url : String? = nil # Connect to YouTube over 'ipv6', 'ipv4'. Will sometimes resolve fix issues with rate-limiting (see https://github.com/ytdl-org/youtube-dl/issues/21729) @[YAML::Field(converter: Preferences::FamilyConverter)] diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 77265679..bfcb8953 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -150,6 +150,12 @@ <%= translate(locale, "footer_donate_page") %> + <% if CONFIG.donate_url %> + + + <%= translate(locale, "footer_instance_donate_page") %> + + <% end %> <%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> @ <%= CURRENT_BRANCH %> From 008ac3d3a23111baccbd249082c35974d52ba3a3 Mon Sep 17 00:00:00 2001 From: Arya K Date: Wed, 26 Jul 2023 15:07:20 +0530 Subject: [PATCH 2/3] Update locales/en-US.json Co-authored-by: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> --- locales/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en-US.json b/locales/en-US.json index e4af73b4..89b7cfe9 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -454,7 +454,7 @@ "next_steps_error_message_refresh": "Refresh", "next_steps_error_message_go_to_youtube": "Go to YouTube", "footer_donate_page": "Donate to Invidious", - "footer_instance_donate_page": "Donate to the instance", + "footer_instance_donate_page": "Donate to this instance", "footer_documentation": "Documentation", "footer_source_code": "Source code", "footer_original_source_code": "Original source code", From 5ee5f49b5437891208f1f4d1c427ff4a4f215ccf Mon Sep 17 00:00:00 2001 From: Arya K Date: Fri, 28 Jul 2023 14:57:11 +0530 Subject: [PATCH 3/3] Update src/invidious/views/template.ecr Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> --- src/invidious/views/template.ecr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index bfcb8953..2a84c3a0 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -151,10 +151,10 @@ <%= translate(locale, "footer_donate_page") %> <% if CONFIG.donate_url %> - - - <%= translate(locale, "footer_instance_donate_page") %> - + + + <%= translate(locale, "footer_instance_donate_page") %> + <% end %> <%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> @ <%= CURRENT_BRANCH %>