{{ template "header" . }}
<h2>Strafregister</h2>
<table>
  <thead>
    <tr>
      <th scope="col">Zeitpunkt</th>
      <th scope="col">Geschwindigkeit</th>
      <th scope="col">Foto</th>
      <th scope="col">AI Foto</th>
      <th scope="col"></th>
    </tr>
  </thead>
  <tbody>
    {{ range .SpeedingTickets }}
    <tr>
      <th scope="row">{{ .CreatedAt.Format "02.01.2006 15:04:05" }}Uhr</th>
      <td>{{ .Speed }}km/h</td>
      <td>
        {{ if ne .ImagePath "" }}
        <img src="{{ .ImagePath }}" alt="Beweisfoto" />
        {{ end }}
      </td>
      <td>
        {{ if ne .KIImagePath "" }}
        <img src="{{ .KIImagePath }}" alt="KI generiertes Foto" />
        {{ end }}
      </td>
      <td>
        <div role="group">
          <a role="button" href="/ticket/{{ .ID }}">Direktlink</a>
          <button class="secondary">Drucken</button>
          <a role="button" href="/ticket/{{ .ID }}/delete" class="contrast">Löschen</a>
        </div>
      </td>
    </tr>
    {{ end }}
  </tbody>
</table>
{{ template "footer" . }}
