From 3bfe0bdcb79b398a387e202c5150b5e6fd230d3a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Mar 2017 01:19:07 +0100 Subject: More complicated date handling --- templates/default-layout.cassius | 2 +- templates/inventoryListing.cassius | 3 +++ templates/inventoryListing.hamlet | 33 +++++++++++++++++++-------------- 3 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 templates/inventoryListing.cassius (limited to 'templates') diff --git a/templates/default-layout.cassius b/templates/default-layout.cassius index bd76a01..50aab3f 100644 --- a/templates/default-layout.cassius +++ b/templates/default-layout.cassius @@ -33,7 +33,7 @@ color: #aaa .table .table .td, .table .table .tc, .table .table .th, .table .table .kind padding: 0 -table table td, table table th +table table td, table table th, .table table td, .table table th padding: 0 #messages list-style-type: none diff --git a/templates/inventoryListing.cassius b/templates/inventoryListing.cassius new file mode 100644 index 0000000..9a7459e --- /dev/null +++ b/templates/inventoryListing.cassius @@ -0,0 +1,3 @@ +.expired + color: #800 + font-weight: bold \ No newline at end of file diff --git a/templates/inventoryListing.hamlet b/templates/inventoryListing.hamlet index 3be43db..39758bb 100644 --- a/templates/inventoryListing.hamlet +++ b/templates/inventoryListing.hamlet @@ -26,22 +26,27 @@
#{itemKind}
#{itemType}
- $maybe bought <- itemBought - #{dayFormat bought} - $nothing -
+ $case itemBought + $of DateUnknown +
+ $of DateKnown d + #{dayFormat d}
- $maybe expires <- itemExpires - #{dayFormat expires} - $nothing -
+ $case itemExpires + $of DateNever +
+ $of DateKnown d + #{dayFormat d}
- $maybe opened <- itemOpened - #{dayFormat opened} - $nothing -
-