From f405e702baa42617612c68dde0a9d948baff54d1 Mon Sep 17 00:00:00 2001 From: HelloZeroNet Date: Mon, 25 Apr 2016 02:17:28 +0200 Subject: [PATCH] Display possible content.jsons on sidebar --- plugins/Sidebar/SidebarPlugin.py | 13 +++++++++++++ plugins/Sidebar/media/Sidebar.css | 7 ++++++- plugins/Sidebar/media/all.css | 7 ++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/plugins/Sidebar/SidebarPlugin.py b/plugins/Sidebar/SidebarPlugin.py index b7451427..cb68e5c8 100644 --- a/plugins/Sidebar/SidebarPlugin.py +++ b/plugins/Sidebar/SidebarPlugin.py @@ -389,6 +389,19 @@ class UiWebsocketPlugin(object): body.append("""
  • + """) + + # Choose content you want to sign + contents = ["content.json"] + contents += site.content_manager.contents.get("content.json", {}).get("includes", {}).keys() + if len(contents) > 1: + body.append("
    Choose: ") + for content in contents: + content = cgi.escape(content, True) + body.append("{content} ".format(**locals())) + body.append("
    ") + + body.append(""" Sign Publish diff --git a/plugins/Sidebar/media/Sidebar.css b/plugins/Sidebar/media/Sidebar.css index 1bf834da..f30cba67 100644 --- a/plugins/Sidebar/media/Sidebar.css +++ b/plugins/Sidebar/media/Sidebar.css @@ -103,4 +103,9 @@ /* Globe */ .globe { width: 360px; height: 360px } .globe.loading { background: url(/uimedia/img/loading-circle.gif) center center no-repeat } -.globe.error { text-align: center; padding-top: 156px; box-sizing: border-box; opacity: 0.2; } \ No newline at end of file +.globe.error { text-align: center; padding-top: 156px; box-sizing: border-box; opacity: 0.2; } + +/* Sign publish */ +.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; } +.contents a { color: white } +.contents a:active { background-color: #6B6B6B } \ No newline at end of file diff --git a/plugins/Sidebar/media/all.css b/plugins/Sidebar/media/all.css index 7852486b..3fd3576c 100644 --- a/plugins/Sidebar/media/all.css +++ b/plugins/Sidebar/media/all.css @@ -157,4 +157,9 @@ /* Globe */ .globe { width: 360px; height: 360px } .globe.loading { background: url(/uimedia/img/loading-circle.gif) center center no-repeat } -.globe.error { text-align: center; padding-top: 156px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; opacity: 0.2; } \ No newline at end of file +.globe.error { text-align: center; padding-top: 156px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box ; opacity: 0.2; } + +/* Sign publish */ +.contents { background-color: #3B3B3B; color: white; padding: 7px 10px; font-family: Consolas; font-size: 11px; display: inline-block; margin-bottom: 6px; } +.contents a { color: white } +.contents a:active { background-color: #6B6B6B } \ No newline at end of file