From 26b0a7d75d7190f5c5dec32fcf784ef4dfb675d6 Mon Sep 17 00:00:00 2001 From: vitorio Date: Sat, 7 Jul 2018 01:15:40 -0500 Subject: [PATCH] Support removing donation link / custom donation test --- plugins/Sidebar/SidebarPlugin.py | 34 ++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/plugins/Sidebar/SidebarPlugin.py b/plugins/Sidebar/SidebarPlugin.py index a40bc654..230be449 100644 --- a/plugins/Sidebar/SidebarPlugin.py +++ b/plugins/Sidebar/SidebarPlugin.py @@ -409,16 +409,30 @@ class UiWebsocketPlugin(object): """)) - site_address = self.site.address - body.append(_(u""" -
  • -
    -
    - {site_address} - {_[Donate]} -
    -
  • - """)) + 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""" +
  • +
    +
    + {escaped_donate_key} +
    +
  • + """)) + else: + site_address = self.site.address + body.append(_(u""" +
  • +
    +
    + {site_address} + {_[Donate]} +
    +
  • + """)) def sidebarRenderOwnedCheckbox(self, body, site): if self.site.settings["own"]: