pretty up the generated HTML
This commit is contained in:
parent
672f0f606c
commit
f261ca0ece
@ -234,7 +234,7 @@ func (this *ArchiveState) renderTemplateHead(w http.ResponseWriter) {
|
||||
targetUri += fmt.Sprintf(`%d/%d`, h.LatestDate().Year, h.LatestDate().Month)
|
||||
}
|
||||
|
||||
w.Write([]byte(`<option value="` + html.EscapeString(targetUri) + `" ` + attr(current, "selected") + `>` + html.EscapeString(h.Description) + `</option>`))
|
||||
w.Write([]byte(fmt.Sprintf("\t\t\t\t\t<option value=\"%s\"%s>%s</option>\n", html.EscapeString(targetUri), attr(current, " selected"), html.EscapeString(h.Description))))
|
||||
}
|
||||
|
||||
w.Write([]byte(`
|
||||
@ -253,18 +253,18 @@ func (this *ArchiveState) renderTemplateHead(w http.ResponseWriter) {
|
||||
for ympair := this.log.EarliestDate(); !ympair.Equals(limit); ympair = ympair.Next() {
|
||||
if ympair.Year != lastY {
|
||||
if lastY != -1 {
|
||||
w.Write([]byte(`</optgroup>`))
|
||||
w.Write([]byte("\t\t\t\t</optgroup>\n"))
|
||||
}
|
||||
w.Write([]byte(`<optgroup label="` + fmt.Sprintf("%d", ympair.Year) + `">`))
|
||||
w.Write([]byte(fmt.Sprintf("\t\t\t\t<optgroup label=\"%d\">\n", ympair.Year)))
|
||||
lastY = ympair.Year
|
||||
}
|
||||
|
||||
targetUri := fmt.Sprintf(`/%s/%d/%d`, this.logBestSlug, ympair.Year, ympair.Month)
|
||||
|
||||
w.Write([]byte(fmt.Sprintf(`<option value="%s" %s>%s</option>`, html.EscapeString(targetUri), attr(ympair.Equals(this.ym), "selected"), html.EscapeString(ympair.Month.String()))))
|
||||
w.Write([]byte(fmt.Sprintf("\t\t\t\t\t<option value=\"%s\"%s>%s</option>\n", html.EscapeString(targetUri), attr(ympair.Equals(this.ym), " selected"), html.EscapeString(ympair.Month.String()))))
|
||||
}
|
||||
if lastY != -1 {
|
||||
w.Write([]byte(`</optgroup>`))
|
||||
w.Write([]byte("\t\t\t\t</optgroup>\n"))
|
||||
}
|
||||
w.Write([]byte(`
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user