mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 14:08:31 -04:00
Broken Cards development
* fix CSS and formatting * refine selection criteria
This commit is contained in:
parent
4679db6ec4
commit
986ab29676
4 changed files with 26 additions and 96 deletions
|
@ -4,11 +4,11 @@ template(name="brokenCardsHeaderBar")
|
|||
|
||||
template(name="brokenCards")
|
||||
.wrapper
|
||||
.broken-cards-dueat-list-wrapper
|
||||
.broken-cards-wrapper
|
||||
each card in brokenCardsList
|
||||
.broken-cards-card-wrapper
|
||||
a.minicard-wrapper.card-title(href=card.absoluteUrl)
|
||||
+minicard(card)
|
||||
.broken-cards-card-title
|
||||
= card.title
|
||||
ul.broken-cards-context-list
|
||||
li.broken-cards-context(title="{{_ 'board'}}")
|
||||
if card.boardId
|
||||
|
|
|
@ -13,46 +13,14 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
brokenCardsList() {
|
||||
const user = Meteor.user();
|
||||
|
||||
const permiitedBoards = [null];
|
||||
let selector = {};
|
||||
// if user is not an admin allow her to see cards only from boards where
|
||||
// she is a member
|
||||
if (!user.isAdmin) {
|
||||
selector.$or = [
|
||||
{ permission: 'public' },
|
||||
{ members: { $elemMatch: { userId: user._id, isActive: true } } },
|
||||
];
|
||||
}
|
||||
Boards.find(selector).forEach(board => {
|
||||
permiitedBoards.push(board._id);
|
||||
});
|
||||
|
||||
selector = {
|
||||
boardId: { $in: permiitedBoards },
|
||||
$or: [{ boardId: null }, { swimlaneId: null }, { listId: null }],
|
||||
const selector = {
|
||||
$or: [
|
||||
{ boardId: { $in: [null, ''] } },
|
||||
{ swimlaneId: { $in: [null, ''] } },
|
||||
{ listId: { $in: [null, ''] } },
|
||||
],
|
||||
};
|
||||
|
||||
const cards = Cards.find(selector, {
|
||||
fields: {
|
||||
_id: 1,
|
||||
archived: 1,
|
||||
boardId: 1,
|
||||
swimlaneId: 1,
|
||||
listId: 1,
|
||||
title: 1,
|
||||
type: 1,
|
||||
sort: 1,
|
||||
members: 1,
|
||||
assignees: 1,
|
||||
colors: 1,
|
||||
dueAt: 1,
|
||||
},
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
// console.log('cards:', cards);
|
||||
return cards;
|
||||
return Cards.find(selector);
|
||||
},
|
||||
}).register('brokenCards');
|
||||
|
|
|
@ -1,63 +1,21 @@
|
|||
.broken-cards-board-wrapper
|
||||
border-radius: 8px
|
||||
//padding: 0.5rem
|
||||
min-width: 400px
|
||||
border-width: 8px
|
||||
border-color: grey
|
||||
border-style: solid
|
||||
margin-bottom: 2rem
|
||||
margin-right: auto
|
||||
margin-left: auto
|
||||
|
||||
.broken-cards-board-title
|
||||
font-size: 1.4rem
|
||||
font-weight: bold
|
||||
padding: 0.5rem
|
||||
background-color: grey
|
||||
color: white
|
||||
|
||||
.broken-cards-swimlane-title
|
||||
font-size: 1.1rem
|
||||
font-weight: bold
|
||||
padding: 0.5rem
|
||||
padding-bottom: 0.4rem
|
||||
margin-top: 0
|
||||
margin-bottom: 0.5rem
|
||||
//border-top: black 1px solid
|
||||
//border-bottom: black 1px solid
|
||||
text-align: center
|
||||
|
||||
.swimlane-default-color
|
||||
background-color: lightgrey
|
||||
|
||||
.broken-cards-list-title
|
||||
font-weight: bold
|
||||
font-size: 1.1rem
|
||||
//padding-bottom: 0
|
||||
//margin-bottom: 0
|
||||
text-align: center
|
||||
margin-bottom: 0.7rem
|
||||
|
||||
.broken-cards-list-wrapper
|
||||
margin: 1rem
|
||||
border-radius: 5px
|
||||
padding: 1.5rem
|
||||
padding-top: 0.75rem
|
||||
display: inline-block
|
||||
min-width: 250px
|
||||
max-width: 350px
|
||||
|
||||
.broken-cards-card-wrapper
|
||||
margin-top: 0
|
||||
margin-bottom: 10px
|
||||
border-width: 3px !important
|
||||
border-color: grey !important
|
||||
border-style: solid
|
||||
border-radius: 5px
|
||||
padding: 1.5rem
|
||||
background-color: white
|
||||
|
||||
.broken-cards-dueat-list-wrapper
|
||||
.broken-cards-wrapper
|
||||
max-width: 500px
|
||||
margin-right: auto
|
||||
margin-left: auto
|
||||
|
||||
.broken-cards-field-name
|
||||
.broken-cards-card-title
|
||||
font-weight: bold
|
||||
//padding: 10px
|
||||
|
||||
.broken-cards-context
|
||||
display: inline-block
|
||||
|
@ -66,8 +24,8 @@
|
|||
font-weight: bold
|
||||
|
||||
.broken-cards-context-list
|
||||
margin-bottom: 0.7rem
|
||||
//margin-bottom: 0.7rem
|
||||
|
||||
.broken-cards-null
|
||||
//font-weight: bold
|
||||
color: darkred
|
||||
font-style: italic
|
||||
|
|
|
@ -139,7 +139,11 @@ Meteor.publish('brokenCards', function() {
|
|||
|
||||
selector = {
|
||||
boardId: { $in: permiitedBoards },
|
||||
$or: [{ boardId: null }, { swimlaneId: null }, { listId: null }],
|
||||
$or: [
|
||||
{ boardId: { $in: [null, ''] } },
|
||||
{ swimlaneId: { $in: [null, ''] } },
|
||||
{ listId: { $in: [null, ''] } },
|
||||
],
|
||||
};
|
||||
|
||||
const cards = Cards.find(selector, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue