1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-06 15:30:26 +00:00

#8850 relocate Manage ACL button (#8852)

This commit is contained in:
webplusai 2024-12-23 10:25:33 +00:00 committed by GitHub
parent faf5d6982e
commit ddfc8c469c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 70 additions and 40 deletions

View File

@ -44,8 +44,7 @@ NavigatorWidget.prototype.render = function(parent,nextSibling) {
{type: "tm-fold-tiddler", handler: "handleFoldTiddlerEvent"},
{type: "tm-fold-other-tiddlers", handler: "handleFoldOtherTiddlersEvent"},
{type: "tm-fold-all-tiddlers", handler: "handleFoldAllTiddlersEvent"},
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"},
{type: "tm-manage-acl", handler: "handleManageACLTiddlersEvent"}
{type: "tm-unfold-all-tiddlers", handler: "handleUnfoldAllTiddlersEvent"}
]);
this.parentDomNode = parent;
this.computeAttributes();
@ -639,14 +638,6 @@ NavigatorWidget.prototype.handleUnfoldAllTiddlersEvent = function(event) {
});
};
NavigatorWidget.prototype.handleManageACLTiddlersEvent = function() {
var pathname = window.location.pathname;
var paths = pathname.split("/");
var recipeName = paths[paths.length - 1];
var bagName = document.querySelector("h1.tc-site-title").innerHTML;
window.location.href = "/admin/acl/"+recipeName+"/"+bagName
};
exports.navigator = NavigatorWidget;
})();

View File

@ -0,0 +1,2 @@
list: GettingStarted
title: $:/StoryList

View File

@ -1,16 +0,0 @@
title: $:/core/ui/Buttons/manage-acl
tags: $:/tags/PageControls
caption: {{$:/core/images/globe}} manage access control
description: Manage access control configuration for this wiki
list-after: $:/core/ui/Buttons/encryption
\whitespace trim
<$button tooltip="Manage access control configuration for this wiki" aria-label="manage access control" class=<<tv-config-toolbar-class>>>
<$action-managetiddler tiddler=<<currentTiddler>>/>
{{$:/core/images/globe}}
<%if [<tv-config-toolbar-text>match[yes]] %>
<span class="tc-btn-text">
<$text text={{$:/language/Buttons/ManageACL/Caption}}/>
</span>
<%endif%>
</$button>

View File

@ -88,6 +88,20 @@ title: $:/plugins/tiddlywiki/multiwikiserver/templates/get-index
<$text text={{{ [<recipe-info>jsonget[description]] }}}/>
</div>
</div>
<div class="mws-wiki-card-actions">
<$set name="last-bag" value={{{ [<recipe-info>jsonget[bag_names]last[]] }}}>
<a
href={{{ [<recipe-name>addprefix[/admin/acl/]addsuffix[/]addsuffix<last-bag>] }}}
class="mws-wiki-card-action"
title="Manage ACL"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
</svg>
</a>
</$set>
</div>
</div>
</$let>
</li>
@ -320,34 +334,73 @@ title: $:/plugins/tiddlywiki/multiwikiserver/templates/get-index
}
.mws-config-button:hover {
background-color: #45a049;
background-color: #45a049;
}
.mws-modal-content {
padding: 20px;
padding: 20px;
}
.mws-modal-section {
margin-bottom: 15px;
margin-bottom: 15px;
}
.mws-modal-buttons {
display: flex;
gap: 10px;
justify-content: flex-end;
margin-top: 20px;
display: flex;
gap: 10px;
justify-content: flex-end;
margin-top: 20px;
}
.mws-modal-button-primary {
background-color: #4CAF50;
color: white;
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
background-color: #4CAF50;
color: white;
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
}
.mws-modal-button-primary:hover {
background-color: #45a049;
background-color: #45a049;
}
.mws-wiki-card {
display: flex;
flex-direction: row;
}
.mws-wiki-card-content {
}
.mws-wiki-card-actions {
padding: 10px;
display: flex;
justify-content: flex-end;
margin-left: auto;
height: 50px;
width: 50px;
}
.mws-wiki-card-action {
display: inline-flex;
align-items: center;
padding: 8px 16px;
background-color: white;
border-radius: 6px;
text-decoration: none;
color: #333;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: all 0.2s ease;
}
.mws-wiki-card-action:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
transform: translateY(-1px);
}
.mws-wiki-card-action svg {
width: 16px;
height: 16px;
}
</style>