diff options
Diffstat (limited to 'tpl/objects')
| -rw-r--r-- | tpl/objects/bubble-group.pug | 13 | ||||
| -rw-r--r-- | tpl/objects/bubble.pug | 39 | 
2 files changed, 30 insertions, 22 deletions
diff --git a/tpl/objects/bubble-group.pug b/tpl/objects/bubble-group.pug index c2e502a..2b960f0 100644 --- a/tpl/objects/bubble-group.pug +++ b/tpl/objects/bubble-group.pug  | |||
| @@ -1,16 +1,9 @@ | |||
| 1 | mixin bubble-group(user) | 1 | mixin bubble-group(user) | 
| 2 | - | 2 | - | 
| 3 | let first = true | ||
| 4 | |||
| 5 | mixin bubble-group-bubble(time) | ||
| 6 | +bubble(time, first ? user : undefined)(class='l-bubble-group__bubble') | ||
| 7 | block | ||
| 8 | - | ||
| 9 | first = false | ||
| 10 | |||
| 11 | - | ||
| 12 | let classes = { | 3 | let classes = { | 
| 13 | 'l-bubble-group': true | 4 | 'l-bubble-group': true, | 
| 5 | 'l-bubble-group--compact': attributes.compact, | ||
| 6 | 'l-bubble-group--arrow': attributes.arrow | ||
| 14 | } | 7 | } | 
| 15 | if (attributes.class) { | 8 | if (attributes.class) { | 
| 16 | classes[attributes.class] = true | 9 | classes[attributes.class] = true | 
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() | ||
