<h2>Alle Aktivitäten der letzten 7 Tage, erstellt am {{date[datetime:dd.MM.yyyy]}}:</h2>
<br />
<!--Gmail seems to need inline css styling, so we repeat this here-->
<table style="border:1px solid black;border-collapse:collapse;">
    <tr style="border:1px solid black;">
        <th style="background: #CCC;text-align:left;border:1px solid black;">Datum</th>
        <th style="background: #CCC;text-align:left;border:1px solid black;">Adresseintrag</th>
        <th style="background: #CCC;text-align:left;border:1px solid black;">Projekt</th>
        <th style="background: #CCC;text-align:left;border:1px solid black;">Bearbeiter</th>
        <th style="background: #CCC;text-align:left;border:1px solid black;">Termin</th>
        <th style="background: #CCC;text-align:left;border:1px solid black;">Titel</th>
    </tr>
    {{@foreach(Aktivitaet.allInstances->select(datum>=date.incDay(-7))->select(datum<=date)->orderby(datum))}}

    <tr style="border:1px solid black;">
        <td style="border:1px solid black;">{{datum[datetime:dd.MM.yyyy]}}</td>
        <td style="border:1px solid black;">{{if not adresseintrag.isnull then adresseintrag.asString else '' endif}}</td>
        <td style="border:1px solid black;">{{if not projekt.isnull then projekt.asString else '' endif}}</td>
        <td style="border:1px solid black;">{{if not zustaendig.isnull then zustaendig.asString else erfasser.asString endif}}</td>
        <td style="border:1px solid black;">{{termin[datetime:dd.MM.yyyy]}}</td>
        <td style="border:1px solid black;">{{titel}}</td>
    </tr>

    {{@endforeach}}
</table>
