Skip to content

Commit dcbfb8a

Browse files
committed
Fix browse files link for not installed domain plugins
1 parent 4b8dfc5 commit dcbfb8a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

plugins/Sidebar/SidebarPlugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,11 @@ def sidebarRenderTransferStats(self, body, site):
169169
"""))
170170

171171
def sidebarRenderFileStats(self, body, site):
172-
site_address = site.content_manager.contents.get("content.json", {}).get("domain", site.address)
173172
body.append(_("""
174173
<li>
175174
<label>
176175
{_[Files]}
177-
<a href='/list/{site_address}' class='link-right link-outline'>{_[Browse files]}</a>
176+
<a href='/list/{site.address}' class='link-right link-outline' id="browse-files">{_[Browse files]}</a>
178177
<small class="label-right">
179178
<a href='/ZeroNet-Internal/Zip?address={site.address}' id='link-zip' class='link-right' download='site.zip'>{_[Save as .zip]}</a>
180179
</small>

plugins/Sidebar/media/Sidebar.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ class Sidebar extends Class
219219
@wrapper.notifications.add "privatekey", "done", "Saved private key removed", 5000
220220
return false
221221

222+
# Use requested address for browse files urls
223+
@tag.find("#browse-files").attr("href", document.location.pathname.replace(/(\/.*?(\/|$)).*$/, "/list$1"))
224+
222225

223226

224227
animDrag: (e) =>

plugins/Sidebar/media/all.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@
359359

360360
}).call(this);
361361

362-
363362
/* ---- Menu.coffee ---- */
364363

365364

@@ -851,7 +850,7 @@ window.initScrollable = function () {
851850
return false;
852851
};
853852
})(this));
854-
return this.tag.find("#privatekey-forget").off("click, touchend").on("click touchend", (function(_this) {
853+
this.tag.find("#privatekey-forget").off("click, touchend").on("click touchend", (function(_this) {
855854
return function(e) {
856855
_this.wrapper.displayConfirm("Remove saved private key for this site?", "Forget", function(res) {
857856
if (!res) {
@@ -864,6 +863,7 @@ window.initScrollable = function () {
864863
return false;
865864
};
866865
})(this));
866+
return this.tag.find("#browse-files").attr("href", document.location.pathname.replace(/(\/.*?(\/|$)).*$/, "/list$1"));
867867
};
868868

869869
Sidebar.prototype.animDrag = function(e) {
@@ -1424,6 +1424,7 @@ window.initScrollable = function () {
14241424

14251425
}).call(this);
14261426

1427+
14271428
/* ---- morphdom.js ---- */
14281429

14291430

0 commit comments

Comments
 (0)