<div class="list-item">
    <div class="list-item-image">
        <div class="box image is-128x128 has-text-centered has-text-white has-background-dark">
            <time datetime="[[+tVon:strtotime:date=`%Y-%m-%d`]]">
                [[+tVon:strtotime:dateLocale=`<span class="is-size-2">%d</span><br /><span class="is-size-6">%B</span>`]]
            </time>
        </div>
    </div>
    
    <div class="list-item-content">
        <div class="list-item-title">
            <div class="list-item-title is-flex is-justify-content-space-between">
                <span>
                    [[!+modx.user.id:is=`1`:then=`
                    <span class="tag is-rounded">
                        <span class="icon-text">
                            <span class="icon">
                                <ion-icon name="bus-outline"></ion-icon>
                            </span>
                            <span>
                                [[+busID]]
                            </span>
                        </span>
                    </span>
                    `]]
                    [[+ort]] 
                </span>
                <span class="has-text-weight-normal has-text-grey">
                    [[!Rowboat?
                        &table=`c103_v_busuebersicht`
                        &tpl=`rowb_fahrkartenStatus_2023`
                        &limit=`0`
                        &where=`{"busID:=":"[[!+busID]]"}`
                        &cacheTime=`0`
                    ]]
                </span>
            </div>
        </div>

        <div class="list-item-description">
            Hin: [[+busTime:strtotime:dateLocale=`%H:%M Uhr`]]
        </div>

        <div class="list-item-description">
            Zurück: [[+busTimeBack:is=`0000-00-00 00:00:00`:then=`[[+tBis:strtotime:date=`%H:%M Uhr`]]`:else=`[[+busTimeBack:is=`0000-00-00 23:59:00`:then=`1 Stunde nach unserem Umzugsende`:else=`[[+busTimeBack:strtotime:date=`%H:%M`]]`]]`]]
        </div>
    </div>
</div>

[[!+modx.user.id:memberof=`Ausschuss`:then=`
<div id="modal-fahrkarten-[[+busID]]" class="modal">
    <div class="modal-background"></div>
    <div class="modal-card">
        <header class="modal-card-head">
            <span class="modal-card-title">Teilnehmer [[+ort]]</span>
            <button class="delete" aria-label="close"></button>
        </header>
        <div class="modal-card-body">
            <ol>
                [[!Rowboat?
                    &table=`c103_v_fahrkarten`
                    &tpl=`rowb_fahrkartenTerminuebersicht_2023`
                    &limit=`0`
                    &where=`{"BusID:=":"[[+busID]]","Betrag:>":"0"}`
                    &cacheTime=`0`
                    &sortBy=`Nachname, Vorname`
                    &sortDir=`ASC`
                ]]
            </ol>
        </div>
    </div>
</div>
`]]
