mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
parent
f03fee5162
commit
9bea6a52d3
5 changed files with 17 additions and 28 deletions
|
|
@ -7,8 +7,8 @@ template(name="headerBoard")
|
||||||
unless isSandstorm
|
unless isSandstorm
|
||||||
if currentUser
|
if currentUser
|
||||||
a.board-header-btn.js-star-board(class="{{#if isStarred}}is-active{{/if}}"
|
a.board-header-btn.js-star-board(class="{{#if isStarred}}is-active{{/if}}"
|
||||||
title="{{#if currentBoard.isStarred}}{{_ 'click-to-unstar'}}{{else}}{{_ 'click-to-star'}}{{/if}} {{_ 'starred-boards-description'}}")
|
title="{{#if isStarred}}{{_ 'click-to-unstar'}}{{else}}{{_ 'click-to-star'}}{{/if}} {{_ 'starred-boards-description'}}")
|
||||||
i.fa(class="fa-star{{#unless currentBoard.isStarred}}-o{{/unless}}")
|
i.fa(class="fa-star{{#unless isStarred}}-o{{/unless}}")
|
||||||
if showStarCounter
|
if showStarCounter
|
||||||
span {{_ 'board-nb-stars' currentBoard.stars}}
|
span {{_ 'board-nb-stars' currentBoard.stars}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
isStarred: function() {
|
isStarred: function() {
|
||||||
var currentBoard = this.currentData();
|
var boardId = Session.get('currentBoard');
|
||||||
var user = Meteor.user();
|
var user = Meteor.user();
|
||||||
return currentBoard && user && user.hasStarred(currentBoard._id);
|
return user && user.hasStarred(boardId);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Only show the star counter if the number of star is greater than 2
|
// Only show the star counter if the number of star is greater than 2
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ template(name="boardList")
|
||||||
a.js-open-board(href="{{pathFor 'board' id=_id slug=slug}}")
|
a.js-open-board(href="{{pathFor 'board' id=_id slug=slug}}")
|
||||||
span.details
|
span.details
|
||||||
span.board-list-item-name= title
|
span.board-list-item-name= title
|
||||||
i.fa.fa-star-o.js-star-board(
|
i.fa.js-star-board(
|
||||||
class="{{#if isStarred}}is-star-active{{/if}}"
|
class="fa-star{{#if isStarred}} is-star-active{{else}}-o{{/if}}"
|
||||||
title="{{_ 'star-board-title'}}")
|
title="{{_ 'star-board-title'}}")
|
||||||
else
|
else
|
||||||
ul.board-list.clearfix
|
ul.board-list.clearfix
|
||||||
|
|
|
||||||
|
|
@ -9,25 +9,17 @@ BlazeComponent.extendComponent({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
starredBoards: function() {
|
|
||||||
var cursor = Boards.find({
|
|
||||||
_id: { $in: Meteor.user().profile.starredBoards || [] }
|
|
||||||
}, {
|
|
||||||
sort: ['title']
|
|
||||||
});
|
|
||||||
return cursor.count() === 0 ? null : cursor;
|
|
||||||
},
|
|
||||||
|
|
||||||
isStarred: function() {
|
isStarred: function() {
|
||||||
var user = Meteor.user();
|
var user = Meteor.user();
|
||||||
return user && user.hasStarred(this._id);
|
return user && user.hasStarred(this.currentData()._id);
|
||||||
},
|
},
|
||||||
|
|
||||||
events: function() {
|
events: function() {
|
||||||
return [{
|
return [{
|
||||||
'click .js-add-board': Popup.open('createBoard'),
|
'click .js-add-board': Popup.open('createBoard'),
|
||||||
'click .js-star-board': function(evt) {
|
'click .js-star-board': function(evt) {
|
||||||
Meteor.user().toggleBoardStar(this._id);
|
var boardId = this.currentData()._id;
|
||||||
|
Meteor.user().toggleBoardStar(boardId);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,10 @@
|
||||||
box-sizing: border-box
|
box-sizing: border-box
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
&.starred .fa-star-o
|
&.starred
|
||||||
opacity: 1
|
.fa-star,
|
||||||
|
.fa-star-o
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
a
|
a
|
||||||
background-color: #999
|
background-color: #999
|
||||||
|
|
@ -47,6 +49,7 @@
|
||||||
:hover
|
:hover
|
||||||
background-color:#939393
|
background-color:#939393
|
||||||
|
|
||||||
|
.fa-star,
|
||||||
.fa-star-o
|
.fa-star-o
|
||||||
bottom: 0
|
bottom: 0
|
||||||
font-size: 14px
|
font-size: 14px
|
||||||
|
|
@ -61,13 +64,14 @@
|
||||||
transition-property: color, font-size, background
|
transition-property: color, font-size, background
|
||||||
|
|
||||||
.is-star-active
|
.is-star-active
|
||||||
color: #e6bf00
|
color: white
|
||||||
|
|
||||||
li:hover a
|
li:hover a
|
||||||
color: #f6f6f6
|
color: #f6f6f6
|
||||||
|
|
||||||
|
.fa-star,
|
||||||
.fa-star-o
|
.fa-star-o
|
||||||
color: #fff
|
color: white
|
||||||
opacity: .75
|
opacity: .75
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
|
|
@ -75,15 +79,8 @@
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
||||||
&.is-star-active
|
&.is-star-active
|
||||||
color: #e6bf00
|
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
||||||
&:hover
|
|
||||||
color: #ffd91a
|
|
||||||
font-size: 16px
|
|
||||||
opacity: 1
|
|
||||||
|
|
||||||
|
|
||||||
.board-backgrounds-list
|
.board-backgrounds-list
|
||||||
|
|
||||||
.board-background-select
|
.board-background-select
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue