Display possible content.jsons on sidebar

This commit is contained in:
HelloZeroNet 2016-04-25 02:17:28 +02:00
parent 11f84d7bac
commit f405e702ba
3 changed files with 25 additions and 2 deletions

View file

@ -389,6 +389,19 @@ class UiWebsocketPlugin(object):
body.append("""
<li>
<label>Content publishing</label>
""")
# 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("<div class='contents'>Choose: ")
for content in contents:
content = cgi.escape(content, True)
body.append("<a href='#{content}' onclick='$(\"#input-contents\").val(\"{content}\"); return false'>{content}</a> ".format(**locals()))
body.append("</div>")
body.append("""
<input type='text' class='text' value="content.json" id='input-contents' style='width: 201px'/>
<a href='#Sign' class='button' id='button-sign'>Sign</a>
<a href='#Publish' class='button' id='button-publish'>Publish</a>

View file

@ -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; }
.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 }

View file

@ -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; }
.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 }