diff options
Diffstat (limited to 'tpl/objects/card.pug')
-rw-r--r-- | tpl/objects/card.pug | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/tpl/objects/card.pug b/tpl/objects/card.pug index d6516be..d61393d 100644 --- a/tpl/objects/card.pug +++ b/tpl/objects/card.pug | |||
@@ -1,29 +1,34 @@ | |||
1 | mixin card | 1 | mixin card |
2 | - const slots = {} | ||
3 | |||
4 | mixin slot(key) | ||
5 | - slots[key] = block | ||
6 | |||
7 | - | 2 | - |
8 | block ? block() : undefined | ||
9 | |||
10 | let classes = { | 3 | let classes = { |
11 | 'o-card': true, | 4 | 'o-card': true, |
12 | } | 5 | } |
13 | 6 | ||
14 | if attributes.href | 7 | if attributes.href |
15 | a(href=attributes.href class=classes) | 8 | a(href=attributes.href class=classes) |
16 | if slots.body | 9 | block |
17 | .o-card__body | ||
18 | - slots.body() | ||
19 | if slots.footer | ||
20 | .o-card__footer | ||
21 | - slots.footer() | ||
22 | else | 10 | else |
23 | div(class=classes) | 11 | div(class=classes) |
24 | if slots.body | 12 | block |
25 | .o-card__body | 13 | |
26 | - slots.body() | 14 | mixin card-image |
27 | if slots.footer | 15 | .o-card__image |
28 | .o-card__footer | 16 | img.o-card__image-img(src=attributes.src) |
29 | - slots.footer() | 17 | |
18 | mixin card-body | ||
19 | .o-card__body | ||
20 | block | ||
21 | |||
22 | mixin card-title | ||
23 | h1.o-card__title | ||
24 | block | ||
25 | |||
26 | mixin card-avatar | ||
27 | +avatar(class='o-card__avatar' src=attributes.src size='xl') | ||
28 | |||
29 | mixin card-content | ||
30 | .o-card__content | ||
31 | block | ||
32 | mixin card-footer | ||
33 | footer.o-card__footer | ||
34 | block | ||