intake/web/html/editChannels.html

60 lines
1.3 KiB
HTML
Raw Normal View History

2025-02-12 15:46:19 +00:00
{{ define "title" }}Channels - Intake{{ end }}
{{ define "content" -}}
<nav class="center">
<span class="feed-controls">
<a href="/">Home</a>
</span>
</nav>
<nav>
<span class="feed-controls">Edit channels</span>
<p>
<form>
<label for="source">Add</label>
<select name="source">{{ range .Sources }}
<option value="{{ . }}">{{ . }}</option>{{ end }}
</select>
<label for="channel">to</label>
<input type="text" name="channel" list="channel-options">
<button
2025-02-12 18:04:58 +00:00
hx-post="/channel/"
2025-02-12 15:46:19 +00:00
>Submit</button>
</form>
</p>
<datalist id="channel-options">{{ range $channel, $_ := .ChannelSources }}
<option value="{{ $channel }}"></option>{{ end }}
</datalist>
{{ range $channel, $sources := .ChannelSources }}
{{ if $channel }}
2025-02-12 15:46:19 +00:00
<p><b><a href="/channel/{{ $channel }}">{{ $channel }}</a></b></p>
<table>
{{- range $sources }}
<tr>
<td>
<button
hx-delete="/channel/?channel={{ $channel }}&source={{ . }}"
>&#10005;</button>
</td>
</form>
<td><a href="/source/{{ . }}">{{ . }}</a></td>
</tr>
{{ end }}
</table>
{{ end }}
{{ end }}
{{ if index .ChannelSources "" }}
<p><b>not in a channel</b></p>
<ul>
{{ range index .ChannelSources "" }}
<li><a href="/source/{{ . }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
2025-02-12 15:46:19 +00:00
</nav>
{{- end }}