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