show-rss/src/cmd/server/handler/public/index.tmpl

54 lines
1.7 KiB
Cheetah

<html>
<header>
<link rel="stylesheet" href="/experimental/ui/dark.css">
</header>
<body>
<h2><a href="?">Feeds</a></h2>
<div>
{{ range feeds }}
<div>
<h3><code><a href="?edit={{.Entry.ID}}">{{ .Version.URL }}</a></code></h3>
<div>@<code>{{ .Version.Cron }}</code> ~<code>{{ .Version.Pattern }}</code></div>
<div><code>{{ .Version.WebhookMethod }} {{ .Version.WebhookURL }} | {{ .Version.WebhookBody }}</code></div>
<div>(last run {{ ago .Execution.Executed }} ago)</div>
</div>
{{ end }}
</div>
<br><hr><br>
<div>
<h3>
{{ if eq "" .editing.ID }}
New
{{ else }}
<form method="POST" action="/v1/feeds?id={{ .editing.ID }}&delete">
<button type="submit">DELETE</button>
</form>
Update <code><a target="_blank" href="{{ .editing_url }}">{{ .editing.URL }}</a></code> (<a href="?">clear</a>)
{{ end }}
</h3>
<form method="POST" action="/v1/feeds?id={{ .editing.ID }}">
{{ range $k, $v := .editing }}
{{ if not (in $k "Created" "Deleted" "Updated" "ID") }}
<div>
<label for="{{ $k }}">
{{ $k }}
{{- if eq $k "URL" }}
(hint: nyaa://?q=show)
{{ else if eq $k "WebhookURL" }}
(hint: vpntor:///outdir)
{{ end }}
</label>
<input name="{{ $k }}" type="text" value="{{ $v }}"/>
</div>
{{ end }}
{{ end }}
<button type="submit">Submit</button>
<code>Preview someday</code>
</form>
</div>
</body>
</html>