mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Added red-green circle to board lists item for indicating board which has overtime logs or normal spent time log
This commit is contained in:
parent
d38071457c
commit
6dba4ccd4d
5 changed files with 47 additions and 0 deletions
|
|
@ -20,6 +20,12 @@ template(name="boardList")
|
||||||
i.fa.js-star-board(
|
i.fa.js-star-board(
|
||||||
class="fa-star{{#if isStarred}} is-star-active{{else}}-o{{/if}}"
|
class="fa-star{{#if isStarred}} is-star-active{{else}}-o{{/if}}"
|
||||||
title="{{_ 'star-board-title'}}")
|
title="{{_ 'star-board-title'}}")
|
||||||
|
|
||||||
|
if hasSpentTimeCards
|
||||||
|
i.fa.js-has-spenttime-cards(
|
||||||
|
class="fa-circle{{#if hasOvertimeCards}} has-overtime-card-active{{else}} no-overtime-card-active{{/if}}"
|
||||||
|
title="{{#if hasOvertimeCards}}{{_ 'has-overtime-cards'}}{{else}}{{_ 'has-spenttime-cards'}}{{/if}}")
|
||||||
|
|
||||||
p.board-list-item-desc= description
|
p.board-list-item-desc= description
|
||||||
li.js-add-board
|
li.js-add-board
|
||||||
a.board-list-item.label {{_ 'add-board'}}
|
a.board-list-item.label {{_ 'add-board'}}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
const subManager = new SubsManager();
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
boards() {
|
boards() {
|
||||||
return Boards.find({
|
return Boards.find({
|
||||||
|
|
@ -13,6 +15,16 @@ BlazeComponent.extendComponent({
|
||||||
return user && user.hasStarred(this.currentData()._id);
|
return user && user.hasStarred(this.currentData()._id);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hasOvertimeCards() {
|
||||||
|
subManager.subscribe('board', this.currentData()._id);
|
||||||
|
return this.currentData().hasOvertimeCards();
|
||||||
|
},
|
||||||
|
|
||||||
|
hasSpentTimeCards() {
|
||||||
|
subManager.subscribe('board', this.currentData()._id);
|
||||||
|
return this.currentData().hasSpentTimeCards();
|
||||||
|
},
|
||||||
|
|
||||||
isInvited() {
|
isInvited() {
|
||||||
const user = Meteor.user();
|
const user = Meteor.user();
|
||||||
return user && user.isInvitedTo(this.currentData()._id);
|
return user && user.isInvitedTo(this.currentData()._id);
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,23 @@ $spaceBetweenTiles = 16px
|
||||||
transition-duration: .15s
|
transition-duration: .15s
|
||||||
transition-property: color, font-size, background
|
transition-property: color, font-size, background
|
||||||
|
|
||||||
|
.fa-circle
|
||||||
|
bottom: 0;
|
||||||
|
font-size: 10px;
|
||||||
|
height: 10px;
|
||||||
|
line-height: 10px;
|
||||||
|
padding: 9px 9px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
transition-duration: .15s
|
||||||
|
transition-property: color, font-size, background
|
||||||
|
|
||||||
|
.has-overtime-card-active
|
||||||
|
color: #eb4646 !important
|
||||||
|
|
||||||
|
.no-overtime-card-active
|
||||||
|
color: #3cb500 !important
|
||||||
|
|
||||||
.is-star-active
|
.is-star-active
|
||||||
color: white
|
color: white
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,8 @@
|
||||||
"spent-time-hours": "Spent time (hours)",
|
"spent-time-hours": "Spent time (hours)",
|
||||||
"overtime-hours": "Overtime (hours)",
|
"overtime-hours": "Overtime (hours)",
|
||||||
"overtime": "Overtime",
|
"overtime": "Overtime",
|
||||||
|
"has-overtime-cards": "Has overtime cards",
|
||||||
|
"has-spenttime-cards": "Has spenttime cards",
|
||||||
"time": "Time",
|
"time": "Time",
|
||||||
"title": "Title",
|
"title": "Title",
|
||||||
"tracking": "Tracking",
|
"tracking": "Tracking",
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,16 @@ Boards.helpers({
|
||||||
return Lists.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } });
|
return Lists.find({ boardId: this._id, archived: false }, { sort: { sort: 1 } });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hasOvertimeCards(){
|
||||||
|
const card = Cards.findOne({isOvertime: true, boardId: this._id, archived: false} );
|
||||||
|
return card !== undefined;
|
||||||
|
},
|
||||||
|
|
||||||
|
hasSpentTimeCards(){
|
||||||
|
const card = Cards.findOne({spentTime: { $gt: 0 }, boardId: this._id, archived: false} );
|
||||||
|
return card !== undefined;
|
||||||
|
},
|
||||||
|
|
||||||
activities() {
|
activities() {
|
||||||
return Activities.find({ boardId: this._id }, { sort: { createdAt: -1 } });
|
return Activities.find({ boardId: this._id }, { sort: { createdAt: -1 } });
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue