Split custom/BTC/Monero donations for sites

This commit is contained in:
caryoscelus 2022-06-04 07:27:59 +00:00
parent 1a0b079bf5
commit 2bc26bfb31
1 changed files with 29 additions and 7 deletions

View File

@ -434,15 +434,37 @@ class UiWebsocketPlugin(object):
</div> </div>
</li> </li>
""")) """))
donate_key = site.content_manager.contents.get("content.json", {}).get("donate", None) donate_generic = site.content_manager.contents.get("content.json", {}).get("donate", None) or site.content_manager.contents.get("content.json", {}).get("donate-generic", None)
if type(donate_key) is str and len(donate_key) > 0: 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(_(""" body.append(_("""
<li> <li>
<label>{_[Donate]}</label><br> <label>{_[Donate]}</label><br>
<div class='flex'> """))
{donate_key} if donate_generic:
<a href='bitcoin:{donate_key}' class='button' id='button-donate'>{_[Donate]}</a> body.append(_("""
</div> <div class='flex'>
{donate_generic}
</div>
"""))
if donate_btc:
body.append(_("""
<div class='flex'>
{donate_btc}
<a href='bitcoin:{donate_btc}' class='button'>{_[Donate BTC]}</a>
</div>
"""))
if donate_xmr:
body.append(_("""
<div class='flex'>
{donate_key}
<a href='monero:{donate_xmr}' class='button'>{_[Donate Monero]}</a>
</div>
"""))
if donate_enabled:
body.append(_("""
</li> </li>
""")) """))