mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Fix allow normal user to view subtasks.
Thanks to xet7 !
This commit is contained in:
parent
870fd3d526
commit
22d98fec38
2 changed files with 23 additions and 5 deletions
|
@ -26,7 +26,6 @@ template(name="subtaskDetail")
|
|||
.subtask-title
|
||||
span
|
||||
if canModifyCard
|
||||
if currentUser.isBoardAdmin
|
||||
a.fa.fa-navicon.subtask-details-menu.js-open-subtask-details-menu(title="{{_ 'subtaskActionsPopup-title'}}")
|
||||
if canModifyCard
|
||||
h2.title.js-open-inlined-form.is-editable
|
||||
|
@ -95,6 +94,7 @@ template(name="subtaskActionsPopup")
|
|||
a.js-view-subtask(title="{{ subtask.title }}")
|
||||
i.fa.fa-eye
|
||||
| {{_ "view-it"}}
|
||||
if currentUser.isBoardAdmin
|
||||
a.js-delete-subtask.delete-subtask
|
||||
i.fa.fa-trash
|
||||
| {{_ "delete"}} ...
|
||||
|
|
|
@ -68,6 +68,10 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
},
|
||||
|
||||
isBoardAdmin() {
|
||||
return ReactiveCache.getCurrentUser().isBoardAdmin();
|
||||
},
|
||||
|
||||
editSubtask(event) {
|
||||
event.preventDefault();
|
||||
const textarea = this.find('textarea.js-edit-subtask-item');
|
||||
|
@ -104,6 +108,9 @@ BlazeComponent.extendComponent({
|
|||
}).register('subtaskItemDetail');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
isBoardAdmin() {
|
||||
return ReactiveCache.getCurrentUser().isBoardAdmin();
|
||||
},
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
|
@ -129,3 +136,14 @@ BlazeComponent.extendComponent({
|
|||
]
|
||||
}
|
||||
}).register('subtaskActionsPopup');
|
||||
|
||||
Template.editSubtaskItemForm.helpers({
|
||||
user() {
|
||||
return ReactiveCache.getUser(this.userId);
|
||||
},
|
||||
isBoardAdmin() {
|
||||
return ReactiveCache.getCurrentUser().isBoardAdmin();
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue