diff options
Diffstat (limited to 'tpl/objects/bubble.pug')
| -rw-r--r-- | tpl/objects/bubble.pug | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/tpl/objects/bubble.pug b/tpl/objects/bubble.pug index a79f119..681661c 100644 --- a/tpl/objects/bubble.pug +++ b/tpl/objects/bubble.pug | |||
| @@ -1,21 +1,36 @@ | |||
| 1 | mixin bubble(time, user) | 1 | mixin bubble(user) |
| 2 | - const slots = {} | ||
| 3 | |||
| 4 | mixin slot(key) | ||
| 5 | - slots[key] = block | ||
| 6 | |||
| 2 | - | 7 | - |
| 8 | block ? block() : undefined | ||
| 9 | |||
| 3 | let classes = { | 10 | let classes = { |
| 4 | 'o-bubble': true, | 11 | 'o-bubble': true, |
| 5 | 't-raised': true | 12 | 'o-bubble--compact': attributes.compact, |
| 13 | 't-raised': !attributes.theme | ||
| 6 | } | 14 | } |
| 7 | if (attributes.class) { | 15 | if (attributes.class) { |
| 8 | classes[attributes.class] = true | 16 | classes[attributes.class] = true |
| 9 | } | 17 | } |
| 18 | if (attributes.theme) { | ||
| 19 | classes[attributes.theme] = true | ||
| 20 | } | ||
| 10 | 21 | ||
| 11 | article(class=classes) | 22 | article(class=classes) |
| 12 | if user | 23 | if slots.header |
| 13 | header.o-bubble__user | 24 | header.o-bubble__header |
| 25 | - slots.header() | ||
| 26 | else if user | ||
| 27 | header.o-bubble__header | ||
| 14 | strong= user | 28 | strong= user |
| 15 | span.s-colored-links | 29 | div.o-bubble__body.s-colored-links |
| 16 | block | 30 | - slots.body() |
| 17 | small.o-bubble__time | 31 | if slots.time |
| 18 | = time | 32 | small.o-bubble__time |
| 19 | if attributes.scope | 33 | - slots.time() |
| 20 | = ' ' | 34 | if slots.footer |
| 21 | +icon(attributes.scope) | 35 | footer.o-bubble__footer |
| 36 | - slots.footer() | ||
