hover all timestamp displays to get more detail
This commit is contained in:
parent
cfc0107bef
commit
51aae382b7
@ -47,9 +47,11 @@ func (this *WikiServer) servePageResponse(w http.ResponseWriter, r *http.Request
|
||||
}
|
||||
}
|
||||
|
||||
func (this *WikiServer) formatTimestamp(m int64) string {
|
||||
func (this *WikiServer) formatTimestamp(m int64) template.HTML {
|
||||
// TODO add a more detailed timestamp on hover
|
||||
return template.HTMLEscapeString(time.Unix(m, 0).In(this.loc).Format(this.opts.DateFormat))
|
||||
dt := time.Unix(m, 0).In(this.loc)
|
||||
|
||||
return template.HTML(`<span title="` + template.HTMLEscapeString(dt.Format(time.RFC3339)) + `">` + template.HTMLEscapeString(dt.Format(this.opts.DateFormat)) + `</span>`)
|
||||
}
|
||||
|
||||
func (this *WikiServer) viewLink(articleTitle string) template.HTML {
|
||||
|
@ -39,7 +39,7 @@ func (this *WikiServer) routeHistory(w http.ResponseWriter, r *http.Request, art
|
||||
for _, rev := range revs {
|
||||
revIdStr := fmt.Sprintf("%d", rev.ID)
|
||||
content += `<tr>` +
|
||||
`<td><a href="` + template.HTMLEscapeString(this.opts.ExpectBaseURL+`archive/`+revIdStr) + `">` + this.formatTimestamp(rev.Modified) + `</a></td>` +
|
||||
`<td><a href="` + template.HTMLEscapeString(this.opts.ExpectBaseURL+`archive/`+revIdStr) + `">` + string(this.formatTimestamp(rev.Modified)) + `</a></td>` +
|
||||
`<td>` + template.HTMLEscapeString(rev.Author) + `</td>` +
|
||||
`<td><input type="radio" name="t" value="` + revIdStr + `"> <input type="radio" name="f" value="` + revIdStr + `"></td>` +
|
||||
`</tr>`
|
||||
|
@ -44,7 +44,8 @@ func (this *WikiServer) routeRecentChanges(w http.ResponseWriter, r *http.Reques
|
||||
`<td><a href="` + template.HTMLEscapeString(this.opts.ExpectBaseURL+`view/`+url.PathEscape(rev.Title)) + `">` + template.HTMLEscapeString(rev.Title) + `</a>` +
|
||||
` [<a href="` + template.HTMLEscapeString(this.opts.ExpectBaseURL+`archive/`+fmt.Sprintf("%d", rev.ID)) + `">a</a>]` +
|
||||
`</td>` +
|
||||
`<td>` + this.formatTimestamp(rev.Modified) + ` by ` + template.HTMLEscapeString(rev.Author) + `</td>` +
|
||||
`<td>` + string(this.formatTimestamp(rev.Modified)) + `</td>` +
|
||||
`<td>` + template.HTMLEscapeString(rev.Author) + `</td>` +
|
||||
`</tr>`
|
||||
}
|
||||
content += `<tr><td>`
|
||||
|
Loading…
Reference in New Issue
Block a user