Reformat My Cards page

* make the page more visually pleasing
* user +viewer to display Markdown in titles
* modify `colorClass()` in Lists model to return 'list-header-{color}'
* modify `colorClass()` of Swimlanes model to return 'swimlane-{color}'
This commit is contained in:
John R. Supplee 2021-01-04 13:53:08 +02:00
parent a0b72d0287
commit e793e71163
7 changed files with 75 additions and 24 deletions

View file

@ -1,7 +1,7 @@
template(name="listHeader") template(name="listHeader")
.list-header.js-list-header( .list-header.js-list-header(
class="{{#if limitToShowCardsCount}}list-header-card-count{{/if}}" class="{{#if limitToShowCardsCount}}list-header-card-count{{/if}}"
class="{{#if colorClass}}list-header-{{colorClass}}{{/if}}") class=colorClass)
+inlinedForm +inlinedForm
+editListTitleForm +editListTitleForm
else else

View file

@ -12,17 +12,19 @@ template(name="myCardsModalTitle")
template(name="myCards") template(name="myCards")
.wrapper .wrapper
each board in cardsFind each board in cardsFind
.board-title .my-cards-board-wrapper
| {{_ 'board' }}: .board-title
= board.title +viewer
each swimlane in board.swimlanes = board.title
.swimlane-title each swimlane in board.swimlanes
| {{_ 'swimlane' }}: .swimlane-title(class=swimlane.colorClass)
= swimlane.title +viewer
each list in swimlane.lists = swimlane.title
.list-title each list in swimlane.lists
| {{_ 'list' }}: .my-cards-list-wrapper
= list.title .list-title(class=list.colorClass)
each card in list.cards +viewer
a.minicard-wrapper.card-title(href="{{pathFor 'card' boardId=board.id slug=board.slug cardId=card._id }}") = list.title
+minicard(card) each card in list.cards
a.minicard-wrapper.card-title(href=card.absoluteUrl)
+minicard(card)

View file

@ -69,6 +69,7 @@ BlazeComponent.extendComponent({
l = { l = {
_id: card.listId, _id: card.listId,
title: 'undefined list', title: 'undefined list',
colorClass: '',
}; };
} }
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
@ -76,6 +77,7 @@ BlazeComponent.extendComponent({
list = { list = {
id: l._id, id: l._id,
title: l.title, title: l.title,
colorClass: l.colorClass(),
cards: [card], cards: [card],
}; };
newList = true; newList = true;
@ -87,6 +89,7 @@ BlazeComponent.extendComponent({
if (!s) { if (!s) {
s = { s = {
_id: card.swimlaneId, _id: card.swimlaneId,
colorClass: '',
title: 'undefined swimlane', title: 'undefined swimlane',
}; };
} }
@ -94,6 +97,9 @@ BlazeComponent.extendComponent({
// console.log('swimlane:', s); // console.log('swimlane:', s);
swimlane = { swimlane = {
id: s._id, id: s._id,
colorClass: s.colorClass()
? s.colorClass()
: 'swimlane-default-color',
title: s.title, title: s.title,
lists: [list], lists: [list],
}; };
@ -107,6 +113,7 @@ BlazeComponent.extendComponent({
// console.log('board:', b, b._id, b.title); // console.log('board:', b, b._id, b.title);
board = { board = {
id: b._id, id: b._id,
colorClass: b.colorClass(),
title: b.title, title: b.title,
slug: b.slug, slug: b.slug,
swimlanes: [swimlane], swimlanes: [swimlane],

View file

@ -19,22 +19,58 @@
font-size: 1.4em font-size: 1.4em
margin: 5px margin: 5px
.my-cards-board-wrapper
border-radius: 8px
//padding: 0.5rem
max-width: 400px
border-width: 8px
border-color: grey
border-style: solid
margin-bottom: 2rem
margin-right: auto
margin-left: auto
.board-title .board-title
font-size: 1.4rem font-size: 1.4rem
font-weight: bold font-weight: bold
padding: 0.5rem
background-color: grey
color: white
.swimlane-title .swimlane-title
font-size: 1.2rem font-size: 1.1rem
font-weight: bold font-weight: bold
margin-left: 1em padding: 0.5rem
margin-top: 10px 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
.list-title .list-title
margin-top: 5px
font-weight: bold font-weight: bold
margin-left: 1.6rem font-size: 1.1rem
//padding-bottom: 0
//margin-bottom: 0
text-align: center
margin-bottom: 0.7rem
.list-color-bar
//height: 0.3rem
margin-bottom: 0.3rem
margin-top: 0
padding-top: 0
.my-cards-list-wrapper
margin: 1rem
margin-top: 1rem
border-radius: 5px
padding: 1.5rem
padding-top: 0.75rem
.card-title .card-title
margin-top: 5px margin-top: 5px
margin-left: 1.8rem
max-width: 350px;

View file

@ -257,7 +257,7 @@ Lists.helpers({
}, },
colorClass() { colorClass() {
if (this.color) return this.color; if (this.color) return `list-header-${this.color}`;
return ''; return '';
}, },

View file

@ -216,7 +216,7 @@ Swimlanes.helpers({
}, },
colorClass() { colorClass() {
if (this.color) return this.color; if (this.color) return `swimlane-${this.color}`;
return ''; return '';
}, },

View file

@ -27,6 +27,7 @@ Meteor.publish('boards', function() {
{ {
fields: { fields: {
_id: 1, _id: 1,
boardId: 1,
archived: 1, archived: 1,
slug: 1, slug: 1,
title: 1, title: 1,
@ -62,7 +63,9 @@ Meteor.publish('mySwimlanes', function() {
fields: { fields: {
_id: 1, _id: 1,
title: 1, title: 1,
boardId: 1,
type: 1, type: 1,
color: 1,
sort: 1, sort: 1,
}, },
// sort: { // sort: {
@ -91,7 +94,10 @@ Meteor.publish('myLists', function() {
{ {
fields: { fields: {
_id: 1, _id: 1,
boardId: 1,
swimlaneId: 1,
title: 1, title: 1,
color: 1,
type: 1, type: 1,
sort: 1, sort: 1,
}, },