<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <title>Trikotwaschliste</title>
    <link rel="stylesheet" type="text/css" href="/static/semantic.min.css">
    <link rel="stylesheet" type="text/css" href="/static/style.css">
</head>
<body>

{{template "navbar"}}
<div class="ui center">
    <h1 class="">Trikotwaschliste</h1>
    <table class="ui celled table">
        <thead>
        <tr>
            <th>Person</th>
            <th>Datum</th>
            <th>Waschperson</th>
        </tr>
        </thead>
        <tbody>
        {{ $items := .items}}
        {{ $persons := .persons}}
        {{range $item := $items}}
            <tr>
                <td>{{$item.Person}}</td>
                <td>{{$item.DateString}}</td>
                <td>
                    <div class="center">
                        <form class="ui form" action="/uploadname" method="POST">
                            <input type="hidden" id="washid" name="washid" value="{{ $item.Id}}">
                            <select name="names" id="names">
                                    <!--<option value="-1" selected disabled hidden>Choose here</option>-->
                                {{range $person := $persons}}
                                    {{if eq $item.Washed $person.Id}}
                                        <option value="{{$person.Id}}" selected>{{$person.Name}}</option>
                                    {{else}}
                                        <option value="{{$person.Id}}">{{$person.Name}}</option>
                                    {{end}}
                                {{end}}
                            </select>
                            <input class="button" type="submit" value="Speichern">
                        </form>
                    </div>

                </td>
            </tr>
        {{end}}
        </tbody>
    </table>

</div>

</body>
</html>