mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Add an avatar for the card creator
* Add avatar to minicard * Add field to card details * Add show option in Board / Card Settings
This commit is contained in:
parent
926f39c96b
commit
5cc6a2f7d0
14 changed files with 87 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
template(name="commentForm")
|
template(name="commentForm")
|
||||||
.new-comment.js-new-comment(
|
.new-comment.js-new-comment(
|
||||||
class="{{#if commentFormIsOpen}}is-open{{/if}}")
|
class="{{#if commentFormIsOpen}}is-open{{/if}}")
|
||||||
+userAvatar(userId=currentUser._id)
|
+userAvatar(userId=currentUser._id noRemove=true)
|
||||||
form.js-new-comment-form
|
form.js-new-comment-form
|
||||||
+editor(class="js-new-comment-input")
|
+editor(class="js-new-comment-input")
|
||||||
| {{getUnsavedValue 'cardComment' currentCard._id}}
|
| {{getUnsavedValue 'cardComment' currentCard._id}}
|
||||||
|
|
|
||||||
|
|
@ -110,9 +110,18 @@ template(name="cardDetails")
|
||||||
a.card-label.add-label.js-end-date
|
a.card-label.add-label.js-end-date
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
|
|
||||||
|
hr
|
||||||
|
if currentBoard.allowsCreator
|
||||||
|
.card-details-item.card-details-item-creator
|
||||||
|
h3.card-details-item-title
|
||||||
|
i.fa.fa-user
|
||||||
|
| {{_ 'creator'}}
|
||||||
|
|
||||||
|
+userAvatar(userId=userId noRemove=true)
|
||||||
|
| {{! XXX Hack to hide syntaxic coloration /// }}
|
||||||
|
|
||||||
//.card-details-items
|
//.card-details-items
|
||||||
if currentBoard.allowsMembers
|
if currentBoard.allowsMembers
|
||||||
hr
|
|
||||||
.card-details-item.card-details-item-members
|
.card-details-item.card-details-item-members
|
||||||
h3.card-details-item-title
|
h3.card-details-item-title
|
||||||
i.fa.fa-users
|
i.fa.fa-users
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ BlazeComponent.extendComponent({
|
||||||
'click .js-go-to-linked-card'() {
|
'click .js-go-to-linked-card'() {
|
||||||
Utils.goCardId(this.data().linkedId);
|
Utils.goCardId(this.data().linkedId);
|
||||||
},
|
},
|
||||||
'click .js-member': Popup.open('cardMember'),
|
// 'click .js-member': Popup.open('cardMember'),
|
||||||
'click .js-add-members': Popup.open('cardMembers'),
|
'click .js-add-members': Popup.open('cardMembers'),
|
||||||
'click .js-assignee': Popup.open('cardAssignee'),
|
'click .js-assignee': Popup.open('cardAssignee'),
|
||||||
'click .js-add-assignees': Popup.open('cardAssignees'),
|
'click .js-add-assignees': Popup.open('cardAssignees'),
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,7 @@ avatar-radius = 50%
|
||||||
word-wrap: break-word
|
word-wrap: break-word
|
||||||
max-width: 36%
|
max-width: 36%
|
||||||
flex-grow: 1
|
flex-grow: 1
|
||||||
|
&.card-details-item-creator,
|
||||||
&.card-details-item-received,
|
&.card-details-item-received,
|
||||||
&.card-details-item-start,
|
&.card-details-item-start,
|
||||||
&.card-details-item-due,
|
&.card-details-item-due,
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,10 @@ template(name="minicard")
|
||||||
each getMembers
|
each getMembers
|
||||||
+userAvatar(userId=this)
|
+userAvatar(userId=this)
|
||||||
|
|
||||||
|
if showCreator
|
||||||
|
.minicard-creator
|
||||||
|
+userAvatar(userId=this.userId noRemove=true)
|
||||||
|
|
||||||
.badges
|
.badges
|
||||||
unless currentUser.isNoComments
|
unless currentUser.isNoComments
|
||||||
if comments.count
|
if comments.count
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,18 @@ BlazeComponent.extendComponent({
|
||||||
}).format(customFieldTrueValue);
|
}).format(customFieldTrueValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showCreator() {
|
||||||
|
if (this.data().board()) {
|
||||||
|
return (
|
||||||
|
this.data().board.allowsCreator === null ||
|
||||||
|
this.data().board().allowsCreator === undefined ||
|
||||||
|
this.data().board().allowsCreator
|
||||||
|
);
|
||||||
|
// return this.data().board().allowsCreator;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
border-radius: 2px
|
border-radius: 2px
|
||||||
margin-right: 3px
|
margin-right: 3px
|
||||||
margin-bottom: 3px
|
margin-bottom: 3px
|
||||||
|
|
||||||
.minicard-custom-fields
|
.minicard-custom-fields
|
||||||
display:block;
|
display:block;
|
||||||
.minicard-custom-field
|
.minicard-custom-field
|
||||||
|
|
@ -163,7 +163,8 @@
|
||||||
line-height: 12px
|
line-height: 12px
|
||||||
|
|
||||||
.minicard-members,
|
.minicard-members,
|
||||||
.minicard-assignees
|
.minicard-assignees,
|
||||||
|
.minicard-creator
|
||||||
float: right
|
float: right
|
||||||
margin-left: 5px
|
margin-left: 5px
|
||||||
margin-bottom: 4px
|
margin-bottom: 4px
|
||||||
|
|
@ -187,6 +188,9 @@
|
||||||
.minicard-assignees
|
.minicard-assignees
|
||||||
border-bottom: 1px solid red
|
border-bottom: 1px solid red
|
||||||
|
|
||||||
|
.minicard-creator
|
||||||
|
border-bottom: 1px solid green
|
||||||
|
|
||||||
.minicard-members:empty,
|
.minicard-members:empty,
|
||||||
.minicard-assignees:empty
|
.minicard-assignees:empty
|
||||||
display: none
|
display: none
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,14 @@ template(name="boardCardSettingsPopup")
|
||||||
span
|
span
|
||||||
i.fa.fa-users
|
i.fa.fa-users
|
||||||
| {{_ 'members'}}
|
| {{_ 'members'}}
|
||||||
|
|
||||||
|
div.check-div
|
||||||
|
a.flex.js-field-has-creator(class="{{#if allowsCreator}}is-checked{{/if}}")
|
||||||
|
.materialCheckBox(class="{{#if allowsCreator}}is-checked{{/if}}")
|
||||||
|
span
|
||||||
|
i.fa.fa-user
|
||||||
|
| {{_ 'creator'}}
|
||||||
|
|
||||||
div.check-div
|
div.check-div
|
||||||
a.flex.js-field-has-assignee(class="{{#if allowsAssignee}}is-checked{{/if}}")
|
a.flex.js-field-has-assignee(class="{{#if allowsAssignee}}is-checked{{/if}}")
|
||||||
.materialCheckBox(class="{{#if allowsAssignee}}is-checked{{/if}}")
|
.materialCheckBox(class="{{#if allowsAssignee}}is-checked{{/if}}")
|
||||||
|
|
|
||||||
|
|
@ -730,6 +730,14 @@ BlazeComponent.extendComponent({
|
||||||
return this.currentBoard.allowsSubtasks;
|
return this.currentBoard.allowsSubtasks;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
allowsCreator() {
|
||||||
|
return (
|
||||||
|
this.currentBoard.allowsCreator === null ||
|
||||||
|
this.currentBoard.allowsCreator === undefined ||
|
||||||
|
this.currentBoard.allowsCreator
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
allowsMembers() {
|
allowsMembers() {
|
||||||
return this.currentBoard.allowsMembers;
|
return this.currentBoard.allowsMembers;
|
||||||
},
|
},
|
||||||
|
|
@ -889,6 +897,19 @@ BlazeComponent.extendComponent({
|
||||||
this.currentBoard.allowsSubtasks,
|
this.currentBoard.allowsSubtasks,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
'click .js-field-has-creator'(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
this.currentBoard.allowsCreator = !this.currentBoard.allowsCreator;
|
||||||
|
this.currentBoard.setAllowsCreator(this.currentBoard.allowsCreator);
|
||||||
|
$(`.js-field-has-creator ${MCB}`).toggleClass(
|
||||||
|
CKCLS,
|
||||||
|
this.currentBoard.allowsCreator,
|
||||||
|
);
|
||||||
|
$('.js-field-has-creator').toggleClass(
|
||||||
|
CKCLS,
|
||||||
|
this.currentBoard.allowsCreator,
|
||||||
|
);
|
||||||
|
},
|
||||||
'click .js-field-has-members'(evt) {
|
'click .js-field-has-members'(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
this.currentBoard.allowsMembers = !this.currentBoard.allowsMembers;
|
this.currentBoard.allowsMembers = !this.currentBoard.allowsMembers;
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,10 @@ template(name="cardMemberPopup")
|
||||||
h3= user.profile.fullname
|
h3= user.profile.fullname
|
||||||
p.quiet @{{ user.username }}
|
p.quiet @{{ user.username }}
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
if currentUser.isNotCommentOnly
|
unless noRemove
|
||||||
if currentUser.isNotWorker
|
if currentUser.isNotCommentOnly
|
||||||
li: a.js-remove-member {{_ 'remove-member-from-card'}}
|
if currentUser.isNotWorker
|
||||||
|
li: a.js-remove-member {{_ 'remove-member-from-card'}}
|
||||||
|
|
||||||
if $eq currentUser._id user._id
|
if $eq currentUser._id user._id
|
||||||
with currentUser
|
with currentUser
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ Template.userAvatar.helpers({
|
||||||
|
|
||||||
Template.userAvatar.events({
|
Template.userAvatar.events({
|
||||||
'click .js-change-avatar': Popup.open('changeAvatar'),
|
'click .js-change-avatar': Popup.open('changeAvatar'),
|
||||||
|
'click .js-member': Popup.open('cardMember'),
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.userAvatarInitials.helpers({
|
Template.userAvatarInitials.helpers({
|
||||||
|
|
|
||||||
|
|
@ -988,5 +988,6 @@
|
||||||
"hide-system-messages-of-all-users": "Hide system messages of all users",
|
"hide-system-messages-of-all-users": "Hide system messages of all users",
|
||||||
"now-system-messages-of-all-users-are-hidden": "Now system messages of all users are hidden",
|
"now-system-messages-of-all-users-are-hidden": "Now system messages of all users are hidden",
|
||||||
"move-swimlane": "Move Swimlane",
|
"move-swimlane": "Move Swimlane",
|
||||||
"moveSwimlanePopup-title": "Move Swimlane"
|
"moveSwimlanePopup-title": "Move Swimlane",
|
||||||
|
"creator": "Creator"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -372,6 +372,14 @@ Boards.attachSchema(
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
allowsCreator: {
|
||||||
|
/**
|
||||||
|
* Does the board allow creator?
|
||||||
|
*/
|
||||||
|
type: Boolean,
|
||||||
|
defaultValue: true,
|
||||||
|
},
|
||||||
|
|
||||||
allowsAssignee: {
|
allowsAssignee: {
|
||||||
/**
|
/**
|
||||||
* Does the board allows assignee?
|
* Does the board allows assignee?
|
||||||
|
|
@ -1187,6 +1195,10 @@ Boards.mutations({
|
||||||
return { $set: { allowsSubtasks } };
|
return { $set: { allowsSubtasks } };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setAllowsCreator(allowsCreator) {
|
||||||
|
return { $set: { allowsCreator } };
|
||||||
|
},
|
||||||
|
|
||||||
setAllowsMembers(allowsMembers) {
|
setAllowsMembers(allowsMembers) {
|
||||||
return { $set: { allowsMembers } };
|
return { $set: { allowsMembers } };
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -488,6 +488,7 @@ function buildProjection(query) {
|
||||||
modifiedAt: 1,
|
modifiedAt: 1,
|
||||||
labelIds: 1,
|
labelIds: 1,
|
||||||
customFields: 1,
|
customFields: 1,
|
||||||
|
userId: 1,
|
||||||
},
|
},
|
||||||
sort: {
|
sort: {
|
||||||
boardId: 1,
|
boardId: 1,
|
||||||
|
|
@ -658,6 +659,9 @@ function findCards(sessionId, query) {
|
||||||
if (card.boardId) boards.push(card.boardId);
|
if (card.boardId) boards.push(card.boardId);
|
||||||
if (card.swimlaneId) swimlanes.push(card.swimlaneId);
|
if (card.swimlaneId) swimlanes.push(card.swimlaneId);
|
||||||
if (card.listId) lists.push(card.listId);
|
if (card.listId) lists.push(card.listId);
|
||||||
|
if (card.userId) {
|
||||||
|
users.push(card.userId);
|
||||||
|
}
|
||||||
if (card.members) {
|
if (card.members) {
|
||||||
card.members.forEach(userId => {
|
card.members.forEach(userId => {
|
||||||
users.push(userId);
|
users.push(userId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue