deletions: hide 'view latest' link on deleted rev links
This commit is contained in:
parent
5148c59944
commit
ec116a09b8
12
rArchive.go
12
rArchive.go
@ -25,13 +25,15 @@ func (this *WikiServer) routeArchive(w http.ResponseWriter, r *http.Request, rev
|
||||
pto.CurrentPageName = a.Title
|
||||
pto.CurrentPageIsArticle = true
|
||||
|
||||
infoMessageHtml := `You are viewing a specific revision of this page, last modified ` +
|
||||
time.Unix(a.Modified, 0).In(this.loc).Format(this.opts.DateFormat) + `. `
|
||||
if !a.IsDeleted {
|
||||
infoMessageHtml += `Click <a href="` + template.HTMLEscapeString(this.opts.ExpectBaseURL+`view/`+url.PathEscape(a.Title)) + `">here</a> to see the latest revision.`
|
||||
}
|
||||
|
||||
bcr := this.GetBBCodeRenderer()
|
||||
pto.Content = template.HTML(
|
||||
`<div class="info">`+
|
||||
`You are viewing specific revision of this page, last modified `+
|
||||
time.Unix(a.Modified, 0).In(this.loc).Format(this.opts.DateFormat)+`. `+
|
||||
`Click <a href="`+template.HTMLEscapeString(this.opts.ExpectBaseURL+`view/`+url.PathEscape(a.Title))+`">here</a> to see the latest revision.`+
|
||||
`</div>`,
|
||||
`<div class="info">`+infoMessageHtml+`</div>`,
|
||||
) + bcr.RenderHTML(string(a.Body))
|
||||
pto.LoadCodeResources = bcr.CodePresent
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user