Selaa lähdekoodia

different icons for start and due date

Matthias Marschall 7 vuotta sitten
vanhempi
sitoutus
cd4062c9f1
2 muutettua tiedostoa jossa 20 lisäystä ja 8 poistoa
  1. 8 6
      client/components/cards/cardDate.js
  2. 12 2
      client/components/cards/cardDate.styl

+ 8 - 6
client/components/cards/cardDate.js

@@ -171,11 +171,12 @@ class CardStartDate extends CardDate {
   }
 
   classes() {
+    let classes = 'start-date' + ' ';
     if (this.date.get().isBefore(this.now.get(), 'minute') &&
         this.now.get().isBefore(this.data().dueAt)) {
-      return 'current';
+      classes += 'current';
     }
-    return '';
+    return classes;
   }
 
   showTitle() {
@@ -200,13 +201,14 @@ class CardDueDate extends CardDate {
   }
 
   classes() {
+    let classes = 'due-date' + ' ';
     if (this.now.get().diff(this.date.get(), 'days') >= 2)
-      return 'long-overdue';
+      classes += 'long-overdue';
     else if (this.now.get().diff(this.date.get(), 'minute') >= 0)
-      return 'due';
+      classes += 'due';
     else if (this.now.get().diff(this.date.get(), 'days') >= -1)
-      return 'almost-due';
-    return '';
+      classes += 'almost-due';
+    return classes;
   }
 
   showTitle() {

+ 12 - 2
client/components/cards/cardDate.styl

@@ -49,10 +49,20 @@
     &:hover, &.is-active
       background-color: darken(#fd5d47, 7)
 
+  &.due-date
+    time
+      &::before
+        content: "\f090"  // symbol: fa-sign-in
+
+  &.start-date
+    time
+      &::before
+        content: "\f08b"  // symbol: fa-sign-out
+
   time
     &::before
       font: normal normal normal 14px/1 FontAwesome
       font-size: inherit
       -webkit-font-smoothing: antialiased
-      content: "\f017"  // clock symbol
-      margin-right: 0.3em
+      margin-right: 0.3em
+