summaryrefslogtreecommitdiffstats
path: root/tpl/objects/bubble.pug
blob: 681661cd6c5531726124299d910f4e16cf69ba57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
mixin bubble(user)
    - const slots = {}

    mixin slot(key)
        - slots[key] = block

    -
        block ? block() : undefined

        let classes = {
            'o-bubble':          true,
            'o-bubble--compact': attributes.compact,
            't-raised':          !attributes.theme
        }
        if (attributes.class) {
            classes[attributes.class] = true
        }
        if (attributes.theme) {
            classes[attributes.theme] = true
        }

    article(class=classes)
        if slots.header
            header.o-bubble__header
                - slots.header()
        else if user
            header.o-bubble__header
                strong= user
        div.o-bubble__body.s-colored-links
            - slots.body()
            if slots.time
                small.o-bubble__time
                    - slots.time()
        if slots.footer
            footer.o-bubble__footer
                - slots.footer()