summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-03-28 14:56:52 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-03-28 14:56:52 +0200
commitd28c483bdba02cf4163e99efcb07f2ee525ddda1 (patch)
treef9becdc79bcb6495e462ec2f17762a63182dbc2a /templates
parentde1513a40da72632b500c710c5254c8e3639b7bd (diff)
downloadbar-d28c483bdba02cf4163e99efcb07f2ee525ddda1.tar
bar-d28c483bdba02cf4163e99efcb07f2ee525ddda1.tar.gz
bar-d28c483bdba02cf4163e99efcb07f2ee525ddda1.tar.bz2
bar-d28c483bdba02cf4163e99efcb07f2ee525ddda1.tar.xz
bar-d28c483bdba02cf4163e99efcb07f2ee525ddda1.zip
Implement list view
Diffstat (limited to 'templates')
-rw-r--r--templates/inventoryList.cassius51
-rw-r--r--templates/inventoryList.hamlet33
2 files changed, 84 insertions, 0 deletions
diff --git a/templates/inventoryList.cassius b/templates/inventoryList.cassius
new file mode 100644
index 0000000..edb9feb
--- /dev/null
+++ b/templates/inventoryList.cassius
@@ -0,0 +1,51 @@
1body > ul
2 list-style-type: none
3 margin: 0
4 padding: 0
5 li
6 padding: 0.25em
7 margin: 0
8 .kindType
9 color: inherit
10 .type
11 color: #aaa
12 .type::before
13 content: "("
14 .type::after
15 content: ")"
16 .info
17 list-style-type: none
18 margin: 0
19 padding: 0
20 li
21 display:inline-table
22 border-collapse: collapse
23 div
24 display: table-row
25 div
26 display: table-cell
27 background-color: #ddd
28 border-right:1px solid #999
29 padding: 0.25em
30 div:first-child
31 border-radius: 0.5em 0 0 0.25em
32 div:last-child
33 border-right-style: none
34 border-radius: 0 0.25em 0.5em 0
35 li.content
36 display:inline-block
37 background-color: #ddd
38 padding: 0.25em
39 border-radius: 0.5em 0.25em
40 li
41 margin-bottom:0.5em
42 li:last-child
43 margin-bottom:0
44
45.expireMonth
46 color: #995e00
47.expireWeek
48 color: #994000
49.expired
50 color: #990000
51 text-decoration: line-through
diff --git a/templates/inventoryList.hamlet b/templates/inventoryList.hamlet
new file mode 100644
index 0000000..9bf48f1
--- /dev/null
+++ b/templates/inventoryList.hamlet
@@ -0,0 +1,33 @@
1<ul>
2 $forall WithType (Entity itemId Item{..}) itemType <- stock
3 <li .color>
4 <div .kindType>
5 <span .kind>#{itemKind}
6 <span .type>#{itemType}
7 <ul .info>
8 $case itemBought
9 $of DateKnown d
10 <li>
11 <div>
12 <div>Bought
13 <div>#{dayFormat d}
14 $of _
15 $case itemExpires
16 $of DateKnown d
17 <li>
18 <div>
19 <div>Expires
20 <div :d < today:.expired :d < addDays 7 today:.expireWeek :d < addGregorianMonthsRollOver 1 today:.expireMonth>
21 #{dayFormat d}
22 $of _
23 $case itemOpened
24 $of DateKnown d
25 <li>
26 <div>
27 <div>Opened
28 <div>#{dayFormat d}
29 $of DateUnknown
30 <li .content>Open
31 $of _
32 $if itemRunningLow
33 <li .content>Running low