{{define "body"}}
<div class="page-header">
    <div class="row">
        <h2>{{.BodyTitle}}</h2>
    </div>
</div>
<div class="row mt-3">
    <div class="col col-nopad">
        <form class="form-horizontal" action="/search" method="post">
            <input type="hidden" name="token" value="{{.Token}}">
            <div class="form-group">
                <div class="input-group">
                    <input type="text" class="form-control input-sm" placeholder="Search" name="search" value="{{.Search}}" autocomplete="off" autofocus>
                    <div class="input-group-append">
                        <button class="btn btn-sm btn-primary" type="submit">Search</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="row mt-3">
    {{if .Data}}
    <table class="table table-stripped table-hover">
    <thead>
        <tr>
            <th>File</th>
            <th>Keyword</th>
        </tr>
    </thead>
    <tbody>
    {{range $item := .Data}}
    <tr>
        <td>
        <a class="mono" href="{{$item.Path}}"><b>{{$item.Path}}</b></a>
        {{if $item.HTML}}
        <br><pre class="wrap">{{$item.HTML}}</pre>
        {{end}}
        </td>
        <td>{{$item.Keyword}}</td>
    </tr>
    {{end}}
    {{else}}
    <b>No search results found.</b>
    {{end}}
    </tbody>
    </table>
</div>
{{end}}
