Merge pull request #94 from zeronet-conservancy/disable-default-donating

custom donation addresses (in content.json) are still allowed and in fact improved

later work should include other ways of donations that btc

refs #74
This commit is contained in:
caryoscelus 2022-05-29 23:13:54 +04:00 committed by GitHub
commit 653efa71ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 14 deletions

View File

@ -425,33 +425,26 @@ class UiWebsocketPlugin(object):
</li>
"""))
donate_key = site.content_manager.contents.get("content.json", {}).get("donate", True)
site_address = self.site.address
body.append(_("""
<li>
<label>{_[Site address]}</label><br>
<div class='flex'>
<span class='input text disabled'>{site_address}</span>
"""))
if donate_key == False or donate_key == "":
pass
elif (type(donate_key) == str or type(donate_key) == str) and len(donate_key) > 0:
body.append(_("""
</div>
</li>
"""))
donate_key = site.content_manager.contents.get("content.json", {}).get("donate", None)
if type(donate_key) is str and len(donate_key) > 0:
body.append(_("""
<li>
<label>{_[Donate]}</label><br>
<div class='flex'>
{donate_key}
"""))
else:
body.append(_("""
<a href='bitcoin:{site_address}' class='button' id='button-donate'>{_[Donate]}</a>
"""))
body.append(_("""
{donate_key}
<a href='bitcoin:{donate_key}' class='button' id='button-donate'>{_[Donate]}</a>
</div>
</li>
"""))
"""))
def sidebarRenderOwnedCheckbox(self, body, site):
if self.site.settings["own"]: