Support removing donation link / custom donation test

This commit is contained in:
vitorio 2018-07-07 01:15:40 -05:00
parent b6bf38b85c
commit 26b0a7d75d

View file

@ -409,6 +409,20 @@ class UiWebsocketPlugin(object):
</li>
"""))
donate_key = site.content_manager.contents.get("content.json", {}).get("donate", True)
if donate_key == False or donate_key == "":
pass
elif (type(donate_key) == str or type(donate_key) == unicode) and len(donate_key) > 0:
escaped_donate_key = cgi.escape(donate_key, True)
body.append(_(u"""
<li>
<label>{_[Donate]}</label><br>
<div class='flex'>
{escaped_donate_key}
</div>
</li>
"""))
else:
site_address = self.site.address
body.append(_(u"""
<li>