{{define "menu"}}
<ul class="navbar-nav">
    <li class="nav-item"><a class="nav-link" href="/wiki/Index">Index</a></li>
    <li class="nav-item"><a class="nav-link" href="/sections">Sections</a></li>
{{if .Login}}
    <li class="nav-item"><a class="nav-link" href="/new">New Page</a></li>
{{end}}
</ul>
<form class="form-inline" method="post" action="/search">
    <input type="hidden" name="token" value="{{.Token}}">
    <input type="text" class="form-control mr-sm-2 menu" placeholder="Search" name="search" value="{{.Search}}" autocomplete="off">
    <button class="btn btn-sm btn-info" type="submit">Search</button>
</form>
<ul class="nav navbar-nav ml-auto">
{{if .Login}}
    {{if .Admin}}
    <li class="nav-item"><a class="nav-link" href="/users">Users</a></li>
    {{else}}
    <li class="nav-item"><a class="nav-link" href="/user/edit/{{.User}}">Profile</a></li>
    {{end}}
    <li class="nav-item"><a class="nav-link" href="/logout">Logout</a></li>
{{else}}
    <li class="nav-item"><a class="nav-link" href="/login">Login</a></li>
{{end}}
</ul>
{{end}}
