From 2bc26bfb31443740f46d8bf59310e53625bcd4f2 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Sat, 4 Jun 2022 07:27:59 +0000 Subject: [PATCH] Split custom/BTC/Monero donations for sites --- plugins/Sidebar/SidebarPlugin.py | 36 +++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/plugins/Sidebar/SidebarPlugin.py b/plugins/Sidebar/SidebarPlugin.py index 987751e6..5c771543 100644 --- a/plugins/Sidebar/SidebarPlugin.py +++ b/plugins/Sidebar/SidebarPlugin.py @@ -434,15 +434,37 @@ class UiWebsocketPlugin(object): """)) - donate_key = site.content_manager.contents.get("content.json", {}).get("donate", None) - if type(donate_key) is str and len(donate_key) > 0: + donate_generic = site.content_manager.contents.get("content.json", {}).get("donate", None) or site.content_manager.contents.get("content.json", {}).get("donate-generic", None) + donate_btc = site.content_manager.contents.get("content.json", {}).get("donate-btc", None) + donate_xmr = site.content_manager.contents.get("content.json", {}).get("donate-xmr", None) + donate_enabled = bool(donate_generic or donate_btc or donate_xmr) + if donate_enabled: body.append(_("""
  • -
    -
    - {donate_key} - {_[Donate]} -
    +
    + """)) + if donate_generic: + body.append(_(""" +
    + {donate_generic} +
    + """)) + if donate_btc: + body.append(_(""" +
    + {donate_btc} + {_[Donate BTC]} +
    + """)) + if donate_xmr: + body.append(_(""" +
    + {donate_key} + {_[Donate Monero]} +
    + """)) + if donate_enabled: + body.append(_("""
  • """))