deletions: hide 'view latest' link on deleted rev links

This commit is contained in:
mappu 2018-04-02 17:45:55 +12:00
parent 5148c59944
commit ec116a09b8
1 changed files with 7 additions and 5 deletions

View File

@ -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