Fix item updates pulling in nav links

This commit is contained in:
Tim Van Baak 2025-02-10 13:51:55 -08:00
parent b12a411fd6
commit 9703db8478
6 changed files with 18 additions and 18 deletions

View File

@ -1,7 +1,7 @@
{{ define "title" }}{{ if .Items }}({{ len .Items }}) {{ end }}Intake{{ end }}
{{ define "content" -}}
<article class="center">
<nav class="center">
<span class="feed-controls flex-between">
<a href="?hidden={{ .ShowHidden }}&page={{ page .Page -1 }}&count={{ .Count }}">&lt;--</a>
<a href="/">Home</a>
@ -14,20 +14,20 @@
</span>
<a href="?hidden={{ .ShowHidden }}&page={{ page .Page 1 }}&count={{ .Count }}">--&gt;</a>
</span>
</article>
</nav>
{{ if .Items }}
{{ range .Items }}
{{ template "item" . }}
{{ end }}
<article class="center">
<nav class="center">
<button
hx-post="/mass-deactivate"
hx-vals='{{ massDeacVars .Items }}'
hx-confirm="Deactivate {{ len .Items }} items?"
>Deactivate All</button>
</article>
</nav>
{{ else }}
<article class="center">

View File

@ -1,9 +1,9 @@
{{ define "title" }}Intake - fetch result for {{ .Source }}{{ end }}
{{ define "content" -}}
<article class="center">
<nav class="center">
<span class="feed-controls">Fetch results for <a href="/source/{{ .Source }}">{{ .Source }}</a></span>
</article>
</nav>
<article>
<p>{{ .Added }} new items, {{ .Updated }} updated items, {{ .Deleted }} deleted items</p>

View File

@ -1,7 +1,7 @@
{{ define "title" }}Intake{{ end }}
{{ define "content" -}}
<article>
<nav>
<details open>
<summary><span class="feed-controls">Channels</span></summary>
{{ if .Channels }}
@ -18,9 +18,9 @@
<p>No channels found.</p>
{{ end }}
</details>
</article>
</nav>
<article>
<nav>
<details>
<summary><span class="feed-controls">Sources</span></summary>
{{ if .Sources }}
@ -41,9 +41,9 @@
<p>No sources found.</p>
{{ end }}
</details>
</article>
</nav>
<article>
<nav>
<details open>
<summary><span class="feed-controls">Add item</span></summary>
<form action="/item" method="post">
@ -73,5 +73,5 @@
</p>
</form>
</details>
</article>
</nav>
{{- end }}

View File

@ -3,7 +3,7 @@ main {
max-width: 700px;
margin: 0 auto;
}
article {
article, nav {
border: 1px solid black; border-radius: 6px;
padding: 5px;
margin-bottom: 20px;
@ -88,7 +88,7 @@ table.feed-control td {
.intake-sources form {
margin: 0
}
article.center {
.center {
text-align: center;
}
article textarea {

View File

@ -1,11 +1,11 @@
{{ define "title" }}{{ if .Item.Title }}{{ .Item.Title }}{{ else }}{{ .Item.Source }}/{{ .Item.Id }}{{ end }} - Intake [{{ .Item.Source }}]{{ end }}
{{ define "content" -}}
<article class="center">
<nav class="center">
<span class="feed-controls">
<a href="/">Home</a>
</span>
</article>
</nav>
{{ template "item" .Item }}
{{- end }}

View File

@ -1,7 +1,7 @@
{{ define "title" }}Intake - Login{{ end }}
{{ define "content" -}}
<article class="center">
<nav class="center">
<form method="post" action="/login">
<p>
<input name="password" type="password"/>
@ -13,5 +13,5 @@
>Submit</button>
</form>
<p id="errors">{{ .Error }}</p>
</article>
</nav>
{{ end }}