mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
parent
6a92963e2a
commit
82b3227778
11 changed files with 57 additions and 35 deletions
|
|
@ -18,7 +18,7 @@ setBoardColor(color)
|
||||||
button[type=submit].primary, input[type=submit].primary
|
button[type=submit].primary, input[type=submit].primary
|
||||||
background-color: darken(color, 20%)
|
background-color: darken(color, 20%)
|
||||||
|
|
||||||
&.pop-over .pop-over-list li a:hover,
|
&.pop-over .pop-over-list li a:not(.disabled):hover,
|
||||||
.sidebar .sidebar-content .sidebar-btn:hover,
|
.sidebar .sidebar-content .sidebar-btn:hover,
|
||||||
.sidebar-list li a:hover
|
.sidebar-list li a:hover
|
||||||
background-color: lighten(color, 10%)
|
background-color: lighten(color, 10%)
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,10 @@ $spaceBetweenTiles = 16px
|
||||||
color: white
|
color: white
|
||||||
|
|
||||||
li:hover a
|
li:hover a
|
||||||
color: #f6f6f6
|
&:hover
|
||||||
|
.fa-star,
|
||||||
|
.fa-star-o
|
||||||
|
color: white
|
||||||
|
|
||||||
.fa-star,
|
.fa-star,
|
||||||
.fa-star-o
|
.fa-star-o
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ template(name="moveCardPopup")
|
||||||
+boardLists
|
+boardLists
|
||||||
|
|
||||||
template(name="cardMembersPopup")
|
template(name="cardMembersPopup")
|
||||||
ul.pop-over-list.pop-over-member-list
|
ul.pop-over-list.js-card-member-list
|
||||||
each board.members
|
each board.members
|
||||||
li.item(class="{{#if isCardMember}}active{{/if}}")
|
li.item(class="{{#if isCardMember}}active{{/if}}")
|
||||||
a.name.js-select-member(href="#")
|
a.name.js-select-member(href="#")
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@ body
|
||||||
flex: 1
|
flex: 1
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
|
|
||||||
|
.sk-spinner
|
||||||
|
margin-top: 30vh
|
||||||
|
|
||||||
#modal
|
#modal
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
|
|
@ -267,7 +270,7 @@ dd
|
||||||
.fa.fa-lock.colorful
|
.fa.fa-lock.colorful
|
||||||
color: #f44336
|
color: #f44336
|
||||||
|
|
||||||
.pop-over .pop-over-list li a:hover
|
.pop-over .pop-over-list li a:not(.disabled):hover
|
||||||
.fa, .fa.colorful
|
.fa, .fa.colorful
|
||||||
color: white
|
color: white
|
||||||
|
|
||||||
|
|
@ -278,7 +281,7 @@ a
|
||||||
&.fa, i.fa
|
&.fa, i.fa
|
||||||
color: darken(white, 35%)
|
color: darken(white, 35%)
|
||||||
|
|
||||||
&:hover, &.is-active
|
&:not(.disabled):hover, &:not(.disabled).is-active
|
||||||
&.fa, i.fa
|
&.fa, i.fa
|
||||||
color: darken(white, 60%)
|
color: darken(white, 60%)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,9 @@ $popupWidth = 300px
|
||||||
.at-result
|
.at-result
|
||||||
background: #b2dfdb
|
background: #b2dfdb
|
||||||
|
|
||||||
|
.sk-spinner
|
||||||
|
margin: 40px auto
|
||||||
|
|
||||||
for depth in (1..6)
|
for depth in (1..6)
|
||||||
.popup-container-depth-{depth}
|
.popup-container-depth-{depth}
|
||||||
transform: translateX(- depth * $popupWidth)
|
transform: translateX(- depth * $popupWidth)
|
||||||
|
|
@ -133,7 +136,7 @@ $popupWidth = 300px
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
display: block
|
display: block
|
||||||
font-weight: 700
|
font-weight: 700
|
||||||
padding: 0px 10px
|
padding: 1.5px 10px
|
||||||
position: relative
|
position: relative
|
||||||
margin: 0 -10px
|
margin: 0 -10px
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
|
|
@ -145,7 +148,7 @@ $popupWidth = 300px
|
||||||
width: auto
|
width: auto
|
||||||
padding-right: 22px
|
padding-right: 22px
|
||||||
|
|
||||||
&:hover
|
&:not(.disabled):hover
|
||||||
background-color: #005377
|
background-color: #005377
|
||||||
color: #fff
|
color: #fff
|
||||||
|
|
||||||
|
|
@ -162,7 +165,6 @@ $popupWidth = 300px
|
||||||
font-size: 12px
|
font-size: 12px
|
||||||
font-weight: 400
|
font-weight: 400
|
||||||
line-height: 15px
|
line-height: 15px
|
||||||
margin-top: 4px
|
|
||||||
|
|
||||||
&.current
|
&.current
|
||||||
background-color: #e2e6e9
|
background-color: #e2e6e9
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.sk-spinner-wave {
|
.sk-spinner {
|
||||||
|
width: 50px;
|
||||||
&.sk-spinner {
|
height: 50px;
|
||||||
width: 50px;
|
margin: auto;
|
||||||
height: 50px;
|
text-align: center;
|
||||||
margin: auto;
|
font-size: 10px;
|
||||||
margin-top: 30vh;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div {
|
div {
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ template(name="membersWidget")
|
||||||
i.fa.fa-user
|
i.fa.fa-user
|
||||||
| {{_ 'members'}}
|
| {{_ 'members'}}
|
||||||
.board-widget-content
|
.board-widget-content
|
||||||
each currentBoard.members
|
each currentBoard.activeMembers
|
||||||
+userAvatar(userId=this.userId showStatus=true)
|
+userAvatar(userId=this.userId showStatus=true)
|
||||||
unless isSandstorm
|
unless isSandstorm
|
||||||
if currentUser.isBoardAdmin
|
if currentUser.isBoardAdmin
|
||||||
|
|
@ -50,7 +50,7 @@ template(name="labelsWidget")
|
||||||
template(name="memberPopup")
|
template(name="memberPopup")
|
||||||
.board-member-menu
|
.board-member-menu
|
||||||
.miniprofile-header
|
.miniprofile-header
|
||||||
+userAvatar(userId=user._id)
|
+userAvatar(userId=user._id showEdit=true)
|
||||||
.info
|
.info
|
||||||
h3
|
h3
|
||||||
.js-profile= user.profile.fullname
|
.js-profile= user.profile.fullname
|
||||||
|
|
@ -67,10 +67,12 @@ template(name="memberPopup")
|
||||||
| {{_ 'change-permissions'}}
|
| {{_ 'change-permissions'}}
|
||||||
span.quiet (#{memberType})
|
span.quiet (#{memberType})
|
||||||
li
|
li
|
||||||
if currentUser.isBoardAdmin
|
if $eq currentUser._id userId
|
||||||
a.js-remove-member {{_ 'remove-from-board'}}
|
//-
|
||||||
|
XXX Not implemented!
|
||||||
|
// a.js-leave-member {{_ 'leave-board'}}
|
||||||
else
|
else
|
||||||
a.js-leave-member {{_ 'leave-board'}}
|
a.js-remove-member {{_ 'remove-from-board'}}
|
||||||
|
|
||||||
|
|
||||||
template(name="removeMemberPopup")
|
template(name="removeMemberPopup")
|
||||||
|
|
@ -81,16 +83,16 @@ template(name="addMemberPopup")
|
||||||
.js-search-member
|
.js-search-member
|
||||||
+esInput(index="users")
|
+esInput(index="users")
|
||||||
|
|
||||||
ul.pop-over-member-list
|
ul.pop-over-list
|
||||||
+esEach(index="users")
|
+esEach(index="users")
|
||||||
li.item.js-member-item(class="{{#if isBoardMember }}disabled{{/if}}")
|
li.item.js-member-item(class="{{#if isBoardMember}}disabled{{/if}}")
|
||||||
a.name.js-select-member(title="{{ profile.name }} ({{ username }})")
|
a.name.js-select-member(title="{{profile.name}} ({{username}})")
|
||||||
+userAvatar(userId=_id)
|
+userAvatar(userId=_id)
|
||||||
span.full-name
|
span.full-name
|
||||||
= profile.name
|
= profile.name
|
||||||
| (<span class="username">{{ username }}</span>)
|
| (<span class="username">{{username}}</span>)
|
||||||
if isBoardMember
|
if isBoardMember
|
||||||
.extra-text.quiet ({{_ 'joined'}})
|
.quiet ({{_ 'joined'}})
|
||||||
|
|
||||||
+ifEsIsSearching(index='users')
|
+ifEsIsSearching(index='users')
|
||||||
+spinner
|
+spinner
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ Template.addMemberPopup.helpers({
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.addMemberPopup.events({
|
Template.addMemberPopup.events({
|
||||||
'click .pop-over-member-list li:not(.disabled)'() {
|
'click .js-select-member'() {
|
||||||
const userId = this._id;
|
const userId = this._id;
|
||||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
const currentMembersIds = _.pluck(currentBoard.members, 'userId');
|
const currentMembersIds = _.pluck(currentBoard.members, 'userId');
|
||||||
|
|
@ -233,14 +233,14 @@ Template.addMemberPopup.events({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.addMemberPopup.onRendered(() => {
|
Template.addMemberPopup.onRendered(function() {
|
||||||
this.find('.js-search-member input').focus();
|
this.find('.js-search-member input').focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.changePermissionsPopup.events({
|
Template.changePermissionsPopup.events({
|
||||||
'click .js-set-admin, click .js-set-normal'(event) {
|
'click .js-set-admin, click .js-set-normal'(event) {
|
||||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
const memberIndex = getMemberIndex(currentBoard, this.user._id);
|
const memberIndex = getMemberIndex(currentBoard, this.userId);
|
||||||
const isAdmin = $(event.currentTarget).hasClass('js-set-admin');
|
const isAdmin = $(event.currentTarget).hasClass('js-set-admin');
|
||||||
|
|
||||||
Boards.update(currentBoard._id, {
|
Boards.update(currentBoard._id, {
|
||||||
|
|
@ -254,10 +254,13 @@ Template.changePermissionsPopup.events({
|
||||||
|
|
||||||
Template.changePermissionsPopup.helpers({
|
Template.changePermissionsPopup.helpers({
|
||||||
isAdmin() {
|
isAdmin() {
|
||||||
return this.user.isBoardAdmin();
|
const user = Users.findOne(this.userId);
|
||||||
|
return user.isBoardAdmin();
|
||||||
},
|
},
|
||||||
|
|
||||||
isLastAdmin() {
|
isLastAdmin() {
|
||||||
if (!this.user.isBoardAdmin())
|
const user = Users.findOne(this.userId);
|
||||||
|
if (!user.isBoardAdmin())
|
||||||
return false;
|
return false;
|
||||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||||
const nbAdmins = _.where(currentBoard.members, { isAdmin: true }).length;
|
const nbAdmins = _.where(currentBoard.members, { isAdmin: true }).length;
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ Template.cardMembersPopup.helpers({
|
||||||
const cardMembers = Cards.findOne(cardId).members || [];
|
const cardMembers = Cards.findOne(cardId).members || [];
|
||||||
return _.contains(cardMembers, this.userId);
|
return _.contains(cardMembers, this.userId);
|
||||||
},
|
},
|
||||||
|
|
||||||
user() {
|
user() {
|
||||||
return Users.findOne(this.userId);
|
return Users.findOne(this.userId);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -123,16 +123,24 @@ Boards.helpers({
|
||||||
isPublic() {
|
isPublic() {
|
||||||
return this.permission === 'public';
|
return this.permission === 'public';
|
||||||
},
|
},
|
||||||
|
|
||||||
lists() {
|
lists() {
|
||||||
return Lists.find({ boardId: this._id, archived: false },
|
return Lists.find({ boardId: this._id, archived: false },
|
||||||
{ sort: { sort: 1 }});
|
{ sort: { sort: 1 }});
|
||||||
},
|
},
|
||||||
|
|
||||||
activities() {
|
activities() {
|
||||||
return Activities.find({ boardId: this._id }, { sort: { createdAt: -1 }});
|
return Activities.find({ boardId: this._id }, { sort: { createdAt: -1 }});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
activeMembers() {
|
||||||
|
return _.where(this.members, {isActive: true});
|
||||||
|
},
|
||||||
|
|
||||||
absoluteUrl() {
|
absoluteUrl() {
|
||||||
return FlowRouter.path('board', { id: this._id, slug: this.slug });
|
return FlowRouter.path('board', { id: this._id, slug: this.slug });
|
||||||
},
|
},
|
||||||
|
|
||||||
colorClass() {
|
colorClass() {
|
||||||
return `board-color-${this.color}`;
|
return `board-color-${this.color}`;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,23 +12,27 @@ Users.helpers({
|
||||||
boards() {
|
boards() {
|
||||||
return Boards.find({ userId: this._id });
|
return Boards.find({ userId: this._id });
|
||||||
},
|
},
|
||||||
|
|
||||||
starredBoards() {
|
starredBoards() {
|
||||||
const starredBoardIds = this.profile.starredBoards || [];
|
const starredBoardIds = this.profile.starredBoards || [];
|
||||||
return Boards.find({archived: false, _id: {$in: starredBoardIds}});
|
return Boards.find({archived: false, _id: {$in: starredBoardIds}});
|
||||||
},
|
},
|
||||||
|
|
||||||
hasStarred(boardId) {
|
hasStarred(boardId) {
|
||||||
const starredBoardIds = this.profile.starredBoards || [];
|
const starredBoardIds = this.profile.starredBoards || [];
|
||||||
return _.contains(starredBoardIds, boardId);
|
return _.contains(starredBoardIds, boardId);
|
||||||
},
|
},
|
||||||
|
|
||||||
isBoardMember() {
|
isBoardMember() {
|
||||||
const board = Boards.findOne(Session.get('currentBoard'));
|
const board = Boards.findOne(Session.get('currentBoard'));
|
||||||
return board && _.contains(_.pluck(board.members, 'userId'), this._id) &&
|
return board && _.contains(_.pluck(board.members, 'userId'), this._id) &&
|
||||||
_.where(board.members, {userId: this._id})[0].isActive;
|
_.where(board.members, {userId: this._id})[0].isActive;
|
||||||
},
|
},
|
||||||
|
|
||||||
isBoardAdmin() {
|
isBoardAdmin() {
|
||||||
const board = Boards.findOne(Session.get('currentBoard'));
|
const board = Boards.findOne(Session.get('currentBoard'));
|
||||||
if (this.isBoardMember(board))
|
return board && this.isBoardMember(board) &&
|
||||||
return _.where(board.members, {userId: this._id})[0].isAdmin;
|
_.where(board.members, {userId: this._id})[0].isAdmin;
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitials() {
|
getInitials() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue