Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Improve list view
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Jul 18, 2017
1 parent a104d26 commit 2eaa615
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ func AuthorsHandler(w http.ResponseWriter, r *http.Request) {
}, func(a nameID, b nameID) bool {
return a.Name < b.Name
})
listHTML.WriteString(`<div style="text-align:center;">`)
for _, ni := range authors {
listHTML.WriteString(itemCardHTML(ni.Name, "", "/authors/"+ni.ID))
}
listHTML.WriteString(`</div>`)

io.WriteString(w, pageHTML("Authors", listHTML.String()))
return
Expand Down Expand Up @@ -177,9 +179,11 @@ func SeriesHandler(w http.ResponseWriter, r *http.Request) {
}, func(a nameID, b nameID) bool {
return a.Name < b.Name
})
listHTML.WriteString(`<div style="text-align:center;">`)
for _, ni := range series {
listHTML.WriteString(itemCardHTML(ni.Name, "", "/series/"+ni.ID))
}
listHTML.WriteString(`</div>`)
if len(series) == 0 {
io.WriteString(w, pageHTML("Series", "No series have been found."))
return
Expand Down

0 comments on commit 2eaa615

Please sign in to comment.