Add edit link to feed footer
This commit is contained in:
parent
e242095aba
commit
67760cdedf
@ -27,19 +27,27 @@
|
||||
hx-vals='{{ massDeacVars .Items }}'
|
||||
hx-confirm="Deactivate {{ len .Items }} items?"
|
||||
>Deactivate All</button>
|
||||
<br>
|
||||
{{ if not .LastUpdated.IsZero }}
|
||||
<br>
|
||||
last updated {{ .LastUpdated | until }} ({{ .LastUpdated | dateFormat }})
|
||||
{{ end }}
|
||||
{{ if .EditLink }}
|
||||
<br>
|
||||
<a href="{{ .EditLink }}">edit</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
|
||||
{{ else }}
|
||||
<article class="center">
|
||||
<span class="feed-controls">Feed is empty</span>
|
||||
<br>
|
||||
{{ if not .LastUpdated.IsZero }}
|
||||
<br>
|
||||
last updated {{ .LastUpdated | until }} ({{ .LastUpdated | dateFormat }})
|
||||
{{ end }}
|
||||
{{ if .EditLink }}
|
||||
<br>
|
||||
<a href="{{ .EditLink }}">edit</a>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
{{/* end if .Items */}}
|
||||
|
@ -123,6 +123,7 @@ type FeedData struct {
|
||||
Page int
|
||||
Count int
|
||||
LastUpdated time.Time
|
||||
EditLink string
|
||||
}
|
||||
|
||||
func Feed(writer io.Writer, data FeedData) {
|
||||
|
@ -45,6 +45,7 @@ func (env *Env) getSource(writer http.ResponseWriter, req *http.Request) {
|
||||
Page: page,
|
||||
Count: count,
|
||||
LastUpdated: lastUpdated,
|
||||
EditLink: "/source/" + source + "/edit",
|
||||
}
|
||||
html.Feed(writer, data)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user