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