| <!-- |
| Copyright 2024 The Go Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style |
| license that can be found in the LICENSE file. |
| --> |
| <!doctype html> |
| <html> |
| {{template "head" .}} |
| <body> |
| {{template "header" .}} |
| {{template "overview-result" .}} |
| </body> |
| </html> |
| |
| |
| {{define "show-prompt"}} |
| <div class="toggle" onclick="togglePrompt()">[show prompt]</div> |
| <div id="prompt"> |
| <ul> |
| {{- range .Overview.Prompt -}} |
| <li> |
| <pre>{{.}}</pre> |
| </li> |
| {{- end -}} |
| </ul> |
| </div> |
| <script> |
| function togglePrompt() { |
| var x = document.getElementById("prompt"); |
| toggle(x) |
| } |
| </script> |
| {{end}} |
| |
| {{define "overview-result"}} |
| <div class="section"> |
| {{- with .Error -}} |
| <p>Error: {{.Error}}</p> |
| {{- else with .Result -}} |
| <div class="result"> |
| <p><a href="{{.HTMLURL}}" target="_blank">{{.HTMLURL}}</a></p> |
| <p><strong>{{.Title}}</strong></p> |
| <p>author: {{.User.Login}} | state: {{.State}} | created: {{fmttime .CreatedAt}} | updated: {{fmttime .UpdatedAt}}{{if .IsIssueOverview}} | comments: {{.NumComments}}{{end}}</p> |
| <p><a href="{{.Related}}" target="_blank">[Search for related issues]</a></p> |
| <p>AI-generated overview{{if .Overview.Cached}} (cached){{end}}:</p> |
| <div id="overview">{{safehtml .Overview.Overview}}</div> |
| </div> |
| {{template "show-prompt" .}} |
| {{- else }} |
| {{if .Params.Query}}<p>No result.</p>{{end}} |
| {{- end}} |
| </div> |
| {{end}} |