Fix browse files link for not installed domain plugins

This commit is contained in:
Tamas Kocsis 2020-10-01 17:17:51 +02:00
parent 4b8dfc5114
commit dcbfb8afe0
3 changed files with 7 additions and 4 deletions

View File

@ -169,12 +169,11 @@ class UiWebsocketPlugin(object):
"""))
def sidebarRenderFileStats(self, body, site):
site_address = site.content_manager.contents.get("content.json", {}).get("domain", site.address)
body.append(_("""
<li>
<label>
{_[Files]}
<a href='/list/{site_address}' class='link-right link-outline'>{_[Browse files]}</a>
<a href='/list/{site.address}' class='link-right link-outline' id="browse-files">{_[Browse files]}</a>
<small class="label-right">
<a href='/ZeroNet-Internal/Zip?address={site.address}' id='link-zip' class='link-right' download='site.zip'>{_[Save as .zip]}</a>
</small>

View File

@ -219,6 +219,9 @@ class Sidebar extends Class
@wrapper.notifications.add "privatekey", "done", "Saved private key removed", 5000
return false
# Use requested address for browse files urls
@tag.find("#browse-files").attr("href", document.location.pathname.replace(/(\/.*?(\/|$)).*$/, "/list$1"))
animDrag: (e) =>

View File

@ -359,7 +359,6 @@
}).call(this);
/* ---- Menu.coffee ---- */
@ -851,7 +850,7 @@ window.initScrollable = function () {
return false;
};
})(this));
return this.tag.find("#privatekey-forget").off("click, touchend").on("click touchend", (function(_this) {
this.tag.find("#privatekey-forget").off("click, touchend").on("click touchend", (function(_this) {
return function(e) {
_this.wrapper.displayConfirm("Remove saved private key for this site?", "Forget", function(res) {
if (!res) {
@ -864,6 +863,7 @@ window.initScrollable = function () {
return false;
};
})(this));
return this.tag.find("#browse-files").attr("href", document.location.pathname.replace(/(\/.*?(\/|$)).*$/, "/list$1"));
};
Sidebar.prototype.animDrag = function(e) {
@ -1424,6 +1424,7 @@ window.initScrollable = function () {
}).call(this);
/* ---- morphdom.js ---- */