Files
invidious/patches/6-donate-page.patch
T
2021-10-15 13:46:24 +00:00

96 lines
5.0 KiB
Diff

From a7bfbd84d9da7f15e6f7b8bde2aafde19a232b97 Mon Sep 17 00:00:00 2001
From: Emilien Devos <contact@emiliendevos.be>
Date: Thu, 12 Aug 2021 23:16:22 +0200
Subject: [PATCH] donate page
---
src/invidious.cr | 1 +
src/invidious/routes/misc.cr | 5 +++
src/invidious/views/components/feed_menu.ecr | 3 ++
src/invidious/views/donate.ecr | 34 ++++++++++++++++++++
src/invidious/views/template.ecr | 4 +--
5 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 src/invidious/views/donate.ecr
diff --git a/src/invidious.cr b/src/invidious.cr
index 9e67e216..a73e6645 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -314,6 +314,7 @@ end
{% unless flag?(:api_only) %}
Invidious::Routing.get "/", Invidious::Routes::Misc, :home
+ Invidious::Routing.get "/donate", Invidious::Routes::Misc, :donate
Invidious::Routing.get "/privacy", Invidious::Routes::Misc, :privacy
Invidious::Routing.get "/licenses", Invidious::Routes::Misc, :licenses
diff --git a/src/invidious/routes/misc.cr b/src/invidious/routes/misc.cr
index 0e6356d0..cbf5215d 100644
--- a/src/invidious/routes/misc.cr
+++ b/src/invidious/routes/misc.cr
@@ -33,6 +33,11 @@ module Invidious::Routes::Misc
templated "privacy"
end
+ def self.donate(env)
+ locale = LOCALES[env.get("preferences").as(Preferences).locale]?
+ templated "donate"
+ end
+
def self.licenses(env)
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
rendered "licenses"
diff --git a/src/invidious/views/components/feed_menu.ecr b/src/invidious/views/components/feed_menu.ecr
index 3dbeaf37..d84d03d0 100644
--- a/src/invidious/views/components/feed_menu.ecr
+++ b/src/invidious/views/components/feed_menu.ecr
@@ -1,4 +1,7 @@
<div class="feed-menu">
+ <a href="/donate" class="feed-menu-item pure-menu-heading">
+ Donate
+ </a>
<% feed_menu = env.get("preferences").as(Preferences).feed_menu.dup %>
<% if !env.get?("user") %>
<% feed_menu.reject! {|item| {"Subscriptions", "Playlists"}.includes? item} %>
diff --git a/src/invidious/views/donate.ecr b/src/invidious/views/donate.ecr
new file mode 100644
index 00000000..59e6f7f9
--- /dev/null
+++ b/src/invidious/views/donate.ecr
@@ -0,0 +1,34 @@
+<% content_for "header" do %>
+<title>Donate - Invidious</title>
+<% end %>
+
+<div class="h-box">
+ <h2>Donate to YewTube</h2>
+ <h3>Why donating?</h3>
+ <p>Every day YewTube handle 40 million requests and 2TB (2000GB) of bandwidth. All this traffic has a cost.</p>
+ <p>By donating, you are helping me cover the costs and also improve the user experience because I'll be able to rent more powerful servers.</p>
+ <p>I truly thank you if you consider donating to YewTube.</p>
+ <h3>Payment methods</h3>
+ <h4>Credit/debit card and bank transfer</h4>
+ <ul>
+ <li>Liberapay (recurrent donation): <a href="https://liberapay.com/yewtube/">https://liberapay.com/yewtube/</a></li>
+ <li>Buy Me a Coffee (one time donation): <a href="https://www.buymeacoffee.com/yewtube">https://www.buymeacoffee.com/yewtube</a></li>
+ </ul>
+ <h4>Cryptocurrency</h4>
+ <ul>
+ <li>Bitcoin: <a href="bitcoin:1735mageHQCmHgMgDWtN4FYVL2kgst1jvE">1735mageHQCmHgMgDWtN4FYVL2kgst1jvE</a> (Segwit compatible)</li>
+ <li>Bitcoin cash: <a href="bitcoincash:qz6qvjt9m4wqrqhyet3v3gljrpnys3wl2yxz0jfuu2">qz6qvjt9m4wqrqhyet3v3gljrpnys3wl2yxz0jfuu2</a></li>
+ <li>Ethereum: <a href="ethereum:0x52B72e00be486C03C9b09AA0D441ADE1EfA5d2CB">0x52B72e00be486C03C9b09AA0D441ADE1EfA5d2CB</a></li>
+ <li>Monero: <a href="monero:82VziQe69ynRNKZ2Bk7XcoYUA6Q1eRuPyGxV3gVWDju7EPkUXZE2oGTGWiah51cCKRMAmwTY11D6qcH3NpGtfdjcNccmXL5">82VziQe69ynRNKZ2Bk7XcoYUA6Q1eRuPyGxV3gVWDju7EPkUXZE2oGTGWiah51cCKRMAmwTY11D6qcH3NpGtfdjcNccmXL5</a></li>
+ <li>Nano: <a href="nano:nano_3hrphgbgi4px1gfiftsphokukcj1tkk168it6xeetxpc9c7jt5e6i7kmjupi">nano_3hrphgbgi4px1gfiftsphokukcj1tkk168it6xeetxpc9c7jt5e6i7kmjupi</a></li>
+ <li>Stellar: <a href="stellar:GB5LHWSIOM6BRO7CMWRMWVWJUGPCKVRAVINGUJHA7PYP3CHES2XCMDG5">GB5LHWSIOM6BRO7CMWRMWVWJUGPCKVRAVINGUJHA7PYP3CHES2XCMDG5</a></li>
+ <li>Dogecoin: <a href="dogecoin:D6dsXSZEp1rkqvLAV41QxXTPPgvDSU2rjo">D6dsXSZEp1rkqvLAV41QxXTPPgvDSU2rjo</a></li>
+ <li>Dash: <a href="dash:XmWHgigKxxNuCiiYfE5ZY6EoRDBwmfUJA5">XmWHgigKxxNuCiiYfE5ZY6EoRDBwmfUJA5</a></li>
+ <li>Ripple: <a href="ripple:rwM9qRsciVWdvAfPjgJHFV4hpP6HtdCVi">rwM9qRsciVWdvAfPjgJHFV4hpP6HtdCVi</a></li>
+ <li>Binance coin: <a href="bnb:bnb10vd22k3ujp9ezjc6s8x7vqvuh02hlvcwqtsepq">bnb10vd22k3ujp9ezjc6s8x7vqvuh02hlvcwqtsepq</a></li>
+ <li>Litecoin: <a href="litecoin:ltc1qre3xwwjsnctpfrx6eu0y77nca3cwlhe8kzy27d">ltc1qre3xwwjsnctpfrx6eu0y77nca3cwlhe8kzy27d</a></li>
+ <li>USD Coin: <a href="usdcoin:bnb10vd22k3ujp9ezjc6s8x7vqvuh02hlvcwqtsepq">bnb10vd22k3ujp9ezjc6s8x7vqvuh02hlvcwqtsepq</a></li>
+ </ul>
+ <h4>Is your prefered payment method not listed?</h4>
+ <p>Feel ask me by email at <code>donate[at]yewtu.be</code> to add it.</p>
+</div>
\ No newline at end of file