go1.16 and embed
This commit is contained in:
parent
f0add04396
commit
8e7bcfc21b
37 changed files with 98 additions and 1134 deletions
71
pkg/server/templates/search.html
Normal file
71
pkg/server/templates/search.html
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{{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="Query" name="query" value="{{.Query}}" 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>Tags</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>
|
||||
{{range $t := $item.Tags}}
|
||||
<a href="/search?query=tags:{{$t}}" class="btn badge btn-primary">{{$t}}</a>
|
||||
{{end}}
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{else}}
|
||||
<b>No search results found.</b>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col col-nopad">
|
||||
<div class="alert alert-primary">
|
||||
<h4>Query Syntax</h4>
|
||||
<p>Documentation: <a target="_blank" rel="noopener noreferrer" href="https://github.com/bcampbell/qs/blob/master/syntax.md">https://github.com/bcampbell/qs/blob/master/syntax.md</a></p>
|
||||
<p>Fields</p>
|
||||
<pre><code>tags:insurance
|
||||
tags:insurance OR tags:invoice
|
||||
# combine tags
|
||||
tags:insurance AND tags:invoice
|
||||
# exclude tags
|
||||
tags:insurance -tags:invoice
|
||||
created:<="2016-09-21"</code></pre>
|
||||
<p>Fulltext</p>
|
||||
<pre><code>some text here</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue