mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
comment only working, naive implementation complete
This commit is contained in:
parent
ec9498fa62
commit
de10be6a21
13 changed files with 64 additions and 18 deletions
|
|
@ -65,7 +65,7 @@ template(name="boardHeaderBar")
|
||||||
if $eq watchLevel "muted"
|
if $eq watchLevel "muted"
|
||||||
i.fa.fa-bell-slash
|
i.fa.fa-bell-slash
|
||||||
span {{_ watchLevel}}
|
span {{_ watchLevel}}
|
||||||
|
|
||||||
else
|
else
|
||||||
a.board-header-btn.js-log-in(
|
a.board-header-btn.js-log-in(
|
||||||
title="{{_ 'log-in'}}")
|
title="{{_ 'log-in'}}")
|
||||||
|
|
@ -81,7 +81,7 @@ template(name="boardHeaderBar")
|
||||||
a.board-header-btn-close.js-filter-reset(title="{{_ 'filter-clear'}}")
|
a.board-header-btn-close.js-filter-reset(title="{{_ 'filter-clear'}}")
|
||||||
i.fa.fa-times-thin
|
i.fa.fa-times-thin
|
||||||
|
|
||||||
if currentUser.isBoardMember
|
if canModifyBoard
|
||||||
a.board-header-btn.js-multiselection-activate(
|
a.board-header-btn.js-multiselection-activate(
|
||||||
title="{{#if MultiSelection.isActive}}{{_ 'multi-selection-on'}}{{else}}{{_ 'multi-selection'}}{{/if}}"
|
title="{{#if MultiSelection.isActive}}{{_ 'multi-selection-on'}}{{else}}{{_ 'multi-selection'}}{{/if}}"
|
||||||
class="{{#if MultiSelection.isActive}}emphasis{{/if}}")
|
class="{{#if MultiSelection.isActive}}emphasis{{/if}}")
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,12 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('boardHeaderBar');
|
}).register('boardHeaderBar');
|
||||||
|
|
||||||
|
Template.boardHeaderBar.helpers({
|
||||||
|
canModifyBoard() {
|
||||||
|
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
backgroundColors() {
|
backgroundColors() {
|
||||||
return Boards.simpleSchema()._schema.color.allowedValues;
|
return Boards.simpleSchema()._schema.color.allowedValues;
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,12 @@ template(name="editCardDate")
|
||||||
button.js-delete-date.negate.wide.right.js-delete-date {{_ 'delete'}}
|
button.js-delete-date.negate.wide.right.js-delete-date {{_ 'delete'}}
|
||||||
|
|
||||||
template(name="dateBadge")
|
template(name="dateBadge")
|
||||||
a.js-edit-date.card-date(title="{{showTitle}}" class="{{classes}}")
|
if canModifyCard
|
||||||
time(datetime="{{showISODate}}")
|
a.js-edit-date.card-date(title="{{showTitle}}" class="{{classes}}")
|
||||||
| {{showDate}}
|
time(datetime="{{showISODate}}")
|
||||||
|
| {{showDate}}
|
||||||
|
else
|
||||||
|
a.card-date(title="{{showTitle}}" class="{{classes}}")
|
||||||
|
time(datetime="{{showISODate}}")
|
||||||
|
| {{showDate}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,12 @@ const EditCardDate = BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Template.dateBadge.helpers({
|
||||||
|
canModifyCard() {
|
||||||
|
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// editCardStartDatePopup
|
// editCardStartDatePopup
|
||||||
(class extends EditCardDate {
|
(class extends EditCardDate {
|
||||||
onCreated() {
|
onCreated() {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ template(name="cardDetails")
|
||||||
|
|
||||||
.card-details-item.card-details-item-labels
|
.card-details-item.card-details-item-labels
|
||||||
h3.card-details-item-title {{_ 'labels'}}
|
h3.card-details-item-title {{_ 'labels'}}
|
||||||
a(class="{{#if currentUser.isBoardMember}}js-add-labels{{else}}is-disabled{{/if}}" title="{{_ 'card-labels-title'}}")
|
a(class="{{#if canModifyCard}}js-add-labels{{else}}is-disabled{{/if}}" title="{{_ 'card-labels-title'}}")
|
||||||
each labels
|
each labels
|
||||||
span.card-label(class="card-label-{{color}}" title=name)= name
|
span.card-label(class="card-label-{{color}}" title=name)= name
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,10 @@ Template.cardDetailsActionsPopup.helpers({
|
||||||
isWatching() {
|
isWatching() {
|
||||||
return this.findWatcher(Meteor.userId());
|
return this.findWatcher(Meteor.userId());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
canModifyCard() {
|
||||||
|
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.cardDetailsActionsPopup.events({
|
Template.cardDetailsActionsPopup.events({
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,13 @@ template(name="checklistDetail")
|
||||||
else
|
else
|
||||||
.checklist-title
|
.checklist-title
|
||||||
.checkbox.fa.fa-check-square-o
|
.checkbox.fa.fa-check-square-o
|
||||||
a.js-delete-checklist {{_ "delete"}}...
|
if canModifyCard
|
||||||
|
a.js-delete-checklist {{_ "delete"}}...
|
||||||
span.checklist-stat(class="{{#if checklist.isFinished}}is-finished{{/if}}") {{checklist.finishedCount}}/{{checklist.itemCount}}
|
span.checklist-stat(class="{{#if checklist.isFinished}}is-finished{{/if}}") {{checklist.finishedCount}}/{{checklist.itemCount}}
|
||||||
h2.title.js-open-inlined-form.is-editable {{checklist.title}}
|
if canModifyCard
|
||||||
|
h2.title.js-open-inlined-form.is-editable {{checklist.title}}
|
||||||
|
else
|
||||||
|
h2.title {{checklist.title}}
|
||||||
+checklistItems(checklist = checklist)
|
+checklistItems(checklist = checklist)
|
||||||
|
|
||||||
template(name="addChecklistItemForm")
|
template(name="addChecklistItemForm")
|
||||||
|
|
@ -38,7 +42,7 @@ template(name="editChecklistItemForm")
|
||||||
button.primary.confirm.js-submit-edit-checklist-item-form(type="submit") {{_ 'save'}}
|
button.primary.confirm.js-submit-edit-checklist-item-form(type="submit") {{_ 'save'}}
|
||||||
a.fa.fa-times-thin.js-close-inlined-form
|
a.fa.fa-times-thin.js-close-inlined-form
|
||||||
span(title=createdAt) {{ moment createdAt }}
|
span(title=createdAt) {{ moment createdAt }}
|
||||||
if currentUser.isBoardMember
|
if canModifyCard
|
||||||
a.js-delete-checklist-item {{_ "delete"}}...
|
a.js-delete-checklist-item {{_ "delete"}}...
|
||||||
|
|
||||||
template(name="checklistItems")
|
template(name="checklistItems")
|
||||||
|
|
@ -48,7 +52,7 @@ template(name="checklistItems")
|
||||||
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
|
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
|
||||||
else
|
else
|
||||||
+itemDetail(item = item checklist = checklist)
|
+itemDetail(item = item checklist = checklist)
|
||||||
if currentUser.isBoardMember
|
if canModifyCard
|
||||||
+inlinedForm(classNames="js-add-checklist-item" checklist = checklist)
|
+inlinedForm(classNames="js-add-checklist-item" checklist = checklist)
|
||||||
+addChecklistItemForm
|
+addChecklistItemForm
|
||||||
else
|
else
|
||||||
|
|
@ -58,5 +62,10 @@ template(name="checklistItems")
|
||||||
|
|
||||||
template(name='itemDetail')
|
template(name='itemDetail')
|
||||||
.item
|
.item
|
||||||
.check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
|
if canModifyCard
|
||||||
.item-title.js-open-inlined-form.is-editable(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}}
|
.check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
|
||||||
|
.item-title.js-open-inlined-form.is-editable(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}}
|
||||||
|
else
|
||||||
|
.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
|
||||||
|
.item-title(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,12 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
}).register('checklists');
|
}).register('checklists');
|
||||||
|
|
||||||
|
Template.itemDetail.helpers({
|
||||||
|
canModifyCard() {
|
||||||
|
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
toggleItem() {
|
toggleItem() {
|
||||||
const checklist = this.currentData().checklist;
|
const checklist = this.currentData().checklist;
|
||||||
|
|
|
||||||
|
|
@ -79,10 +79,10 @@ BlazeComponent.extendComponent({
|
||||||
});
|
});
|
||||||
|
|
||||||
function userIsMember() {
|
function userIsMember() {
|
||||||
return Meteor.user() && Meteor.user().isBoardMember();
|
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable drag-dropping if the current user is not a board member
|
// Disable drag-dropping if the current user is not a board member or is comment only
|
||||||
this.autorun(() => {
|
this.autorun(() => {
|
||||||
$cards.sortable('option', 'disabled', !userIsMember());
|
$cards.sortable('option', 'disabled', !userIsMember());
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ template(name="labelsWidget")
|
||||||
.board-widget-content
|
.board-widget-content
|
||||||
each currentBoard.labels
|
each currentBoard.labels
|
||||||
a.card-label(class="card-label-{{color}}"
|
a.card-label(class="card-label-{{color}}"
|
||||||
class="{{#if currentUser.isBoardMember}}js-label{{/if}}")
|
class="{{#if currentUser.isNotCommentOnly}}js-label{{/if}}")
|
||||||
span.card-label-name= name
|
span.card-label-name= name
|
||||||
if currentUser.isBoardAdmin
|
if currentUser.isBoardAdmin
|
||||||
a.card-label.add-label.js-add-label
|
a.card-label.add-label.js-add-label
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,13 @@ Lists.attachSchema(new SimpleSchema({
|
||||||
|
|
||||||
Lists.allow({
|
Lists.allow({
|
||||||
insert(userId, doc) {
|
insert(userId, doc) {
|
||||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardMemberNonComment(userId, Boards.findOne(doc.boardId));
|
||||||
},
|
},
|
||||||
update(userId, doc) {
|
update(userId, doc) {
|
||||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardMemberNonComment(userId, Boards.findOne(doc.boardId));
|
||||||
},
|
},
|
||||||
remove(userId, doc) {
|
remove(userId, doc) {
|
||||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
return allowIsBoardMemberNonComment(userId, Boards.findOne(doc.boardId));
|
||||||
},
|
},
|
||||||
fetch: ['boardId'],
|
fetch: ['boardId'],
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,11 @@ if (Meteor.isClient) {
|
||||||
return board && board.hasMember(this._id);
|
return board && board.hasMember(this._id);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isNotCommentOnly() {
|
||||||
|
const board = Boards.findOne(Session.get('currentBoard'));
|
||||||
|
return board && board.hasMember(this._id) && !board.hasCommentOnly(this._id);
|
||||||
|
},
|
||||||
|
|
||||||
isCommentOnly() {
|
isCommentOnly() {
|
||||||
const board = Boards.findOne(Session.get('currentBoard'));
|
const board = Boards.findOne(Session.get('currentBoard'));
|
||||||
return board && board.hasCommentOnly(this._id);
|
return board && board.hasCommentOnly(this._id);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ allowIsBoardMember = function(userId, board) {
|
||||||
return board && board.hasMember(userId);
|
return board && board.hasMember(userId);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
allowIsBoardMemberNonComment = function(userId, board) {
|
||||||
|
return board && board.hasMember(userId) && !board.hasCommentOnly(userId);
|
||||||
|
};
|
||||||
|
|
||||||
allowIsBoardMemberByCard = function(userId, card) {
|
allowIsBoardMemberByCard = function(userId, card) {
|
||||||
const board = card.board();
|
const board = card.board();
|
||||||
return board && board.hasMember(userId);
|
return board && board.hasMember(userId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue