Przeglądaj źródła

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}'
John R. Supplee 4 lat temu
rodzic
commit
e793e71163

+ 1 - 1
client/components/lists/listHeader.jade

@@ -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

+ 16 - 14
client/components/main/myCards.jade

@@ -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
-        | {{_ 'board' }}:
-        = board.title
-      each swimlane in board.swimlanes
-        .swimlane-title
-          | {{_ 'swimlane' }}:
-          = swimlane.title
-        each list in swimlane.lists
-          .list-title
-            | {{_ 'list' }}:
-            = list.title
-          each card in list.cards
-            a.minicard-wrapper.card-title(href="{{pathFor 'card' boardId=board.id slug=board.slug cardId=card._id }}")
-              +minicard(card)
+      .my-cards-board-wrapper
+        .board-title
+          +viewer
+            = board.title
+        each swimlane in board.swimlanes
+          .swimlane-title(class=swimlane.colorClass)
+            +viewer
+              = swimlane.title
+          each list in swimlane.lists
+            .my-cards-list-wrapper
+              .list-title(class=list.colorClass)
+                +viewer
+                  = list.title
+              each card in list.cards
+                a.minicard-wrapper.card-title(href=card.absoluteUrl)
+                  +minicard(card)

+ 7 - 0
client/components/main/myCards.js

@@ -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],

+ 43 - 7
client/components/main/myCards.styl

@@ -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
-  margin-top: 10px
+  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
 
 
 .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;

+ 1 - 1
models/lists.js

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

+ 1 - 1
models/swimlanes.js

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

+ 6 - 0
server/publications/boards.js

@@ -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,
       },
       },