cairn/web/templates/pages/search.html

46 lines
1.4 KiB
HTML

{{define "content"}}
<div class="search-page">
<form class="search-form" method="GET" action="/search">
<input type="text" name="q" value="{{.Query}}" placeholder="Search artifacts..." class="search-input" autofocus>
<button type="submit" class="btn">Search</button>
</form>
{{if .Query}}
<div class="toolbar">
<span class="result-count">{{.Total}} results for "{{.Query}}"</span>
</div>
{{if .Artifacts}}
<table class="table">
<thead>
<tr>
<th>Type</th>
<th>Repository</th>
<th>Commit</th>
<th>Crash Message</th>
<th>Size</th>
<th>Created</th>
<th></th>
</tr>
</thead>
<tbody>
{{range .Artifacts}}
<tr>
<td><span class="badge badge-{{.Type}}">{{.Type}}</span></td>
<td>{{.RepoName}}</td>
<td><code>{{shortSHA .CommitSHA}}</code></td>
<td>{{if .CrashMessage}}{{truncate (deref .CrashMessage) 80}}{{else}}-{{end}}</td>
<td>{{formatSize .BlobSize}}</td>
<td>{{timeAgo .CreatedAt}}</td>
<td><a href="/artifacts/{{.ID}}" class="btn btn-sm">View</a></td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<p class="empty-state">No results found.</p>
{{end}}
{{end}}
</div>
{{end}}