{{ define "admin_categoryList" }}
<section class="breadcrumb-section pb-3 pt-3">
    <div class="container">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="/">Home</a></li>
            <li class="breadcrumb-item"><a href="/section/{{ .spiel.ID }}">{{ .spiel.Name }}</a></li>
            <!--<li class="breadcrumb-item active" aria-current="page">{{ .product.Name}}</li>-->
        </ol>
    </div>
</section>
<section class="pb-4 pt-4">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-md-4">
                <div class="sidebar">
                    <div class="sidebar-widget">
                        <div class="widget-title">
                            <h3>Admin page vom {{ .spiel.Name }}</h3>
                        </div>
                        <div class="widget-content">
                            {{ if .error }}
                            <div class="alert alert-warning">
                                {{ range $i, $msg := .error }}
                                {{ $msg }}<br/>
                                {{ end }}
                            </div>
                            {{ end }}
                            <ul>
                                {{ range $i, $category := .categories }}
                                <li>{{ $category.Name }}</li>
                                {{ end }}
                            </ul>
                            {{ template "admin_categoryAdd" $d := .spiel.ID }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
{{ end }}


{{ define "admin_categoryAdd"  }}
<form role="form" action="/admin/category" method="POST">
    <div class="form-group mb-3">
        <div class="input-group input-group-alternative">
            <div class="input-group-prepend">
                <span class="input-group-text"><i class="ni ni-box-2"></i></span>
            </div>
            <input name="spielid" type="hidden" value="{{ . }}" />
            <input class="form-control" name="katname" placeholder="Kategorie Name" type="text" />
        </div>
    </div>
    <div class="text-center">
        <button type="submit" class="btn btn-primary my-4">Speichern</button>
    </div>
</form>
{{ end }}


