blob: 901629849930eef45d53bb4a54924817bdd6491b [file] [log] [blame]
<!--
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>
<head>
<title>Oscar Overviews</title>
<link rel="stylesheet" href="static/style.css"/>
<link rel="stylesheet" href="static/search.css"/>
</head>
<body>
<div class="section" class="header">
<h1>Oscar Overviews</h1>
<p>Generate summaries of posts and their comments. This is a first draft (and currently limited to golang/go GitHub issues). Feedback welcome!</p>
<div class="filter-tips-box">
<div class="toggle" onclick="toggleTips()">[show/hide input tips]</div>
<ul id="filter-tips">
<li><b>issue</b> (<code>int</code>): the issue ID (in the github.com/golang/go repo) of the issue to summarize</li>
</ul>
</div>
<form id="form" action="/overview" method="GET">
<span>
<label for="query"><b>issue</b></label>
<input id="query" type="text" name="q" value="{{.Query}}" required autofocus />
</span>
<span class="submit">
<input type="submit" value="generate"/>
</span>
</form>
</div>
<script>
const form = document.getElementById("form");
form.addEventListener("submit", (event) => {
document.getElementById("working").innerHTML = "<p style='margin-top:1rem'>Working...</p>"
})
function toggle(x) {
if (x.style.display === "block") {
x.style.display = "none";
} else {
x.style.display = "block";
}
}
function toggleTips() {
var x = document.getElementById("filter-tips");
toggle(x)
}
function togglePrompt() {
var x = document.getElementById("prompt");
toggle(x)
}
</script>
<div class="section">
<div id="working"></div>
{{- with .Error -}}
<p>Error: {{.}}</p>
{{- else with .Result -}}
<div class="result">
<p>URL: <a href="{{.URL}}">{{.URL}}</a></p>
<p>Number of comments: {{.NumComments}}</p>
<div id="overview">{{.OverviewHTML}}</div>
</div>
<div class="toggle" onclick="togglePrompt()">[show prompt]</div>
<div id="prompt">
<ul>
{{- range .Prompt -}}
<li>
<pre>{{.}}</pre>
</li>
{{- end -}}
</ul>
</div>
{{- else }}
{{if .Query}}<p>No result.</p>{{end}}
{{- end}}
</div>
</body>
</html>