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.CurrentPageName = a.Title
|
||||||
pto.CurrentPageIsArticle = true
|
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()
|
bcr := this.GetBBCodeRenderer()
|
||||||
pto.Content = template.HTML(
|
pto.Content = template.HTML(
|
||||||
`<div class="info">`+
|
`<div class="info">`+infoMessageHtml+`</div>`,
|
||||||
`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>`,
|
|
||||||
) + bcr.RenderHTML(string(a.Body))
|
) + bcr.RenderHTML(string(a.Body))
|
||||||
pto.LoadCodeResources = bcr.CodePresent
|
pto.LoadCodeResources = bcr.CodePresent
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user