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

View File

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

View File

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

View File

@ -3,7 +3,7 @@ main {
max-width: 700px; max-width: 700px;
margin: 0 auto; margin: 0 auto;
} }
article { article, nav {
border: 1px solid black; border-radius: 6px; border: 1px solid black; border-radius: 6px;
padding: 5px; padding: 5px;
margin-bottom: 20px; margin-bottom: 20px;
@ -88,7 +88,7 @@ table.feed-control td {
.intake-sources form { .intake-sources form {
margin: 0 margin: 0
} }
article.center { .center {
text-align: center; text-align: center;
} }
article textarea { 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 "title" }}{{ if .Item.Title }}{{ .Item.Title }}{{ else }}{{ .Item.Source }}/{{ .Item.Id }}{{ end }} - Intake [{{ .Item.Source }}]{{ end }}
{{ define "content" -}} {{ define "content" -}}
<article class="center"> <nav class="center">
<span class="feed-controls"> <span class="feed-controls">
<a href="/">Home</a> <a href="/">Home</a>
</span> </span>
</article> </nav>
{{ template "item" .Item }} {{ template "item" .Item }}
{{- end }} {{- end }}

View File

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