deletions: put [delete] as page content to block /view/ route
This commit is contained in:
parent
eeb2308c54
commit
6c70f37ef8
@ -9,6 +9,10 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
bbcodeIsDeleted string = `[delete]`
|
||||
)
|
||||
|
||||
// An embarassing cascade of half-working hacks follows.
|
||||
type BBCodeRenderer struct {
|
||||
baseUrl string
|
||||
|
@ -17,6 +17,10 @@ func (this *WikiServer) serveInternalError(w http.ResponseWriter, r *http.Reques
|
||||
http.Error(w, "An internal error occurred. Please ask an administrator to check the log file.", 500)
|
||||
}
|
||||
|
||||
func (this *WikiServer) serveDeleted(w http.ResponseWriter, lookingFor string) {
|
||||
this.serveRedirect(w, this.opts.ExternalBaseURL+"history/"+url.PathEscape(lookingFor)+"?error="+url.QueryEscape(`The page you are looking for has been deleted. However, the history is still available.`))
|
||||
}
|
||||
|
||||
func (this *WikiServer) serveErrorText(w http.ResponseWriter, msg string) {
|
||||
this.serveRedirect(w, this.opts.ExpectBaseURL+"view/"+url.PathEscape(this.opts.DefaultPage)+"?error="+url.QueryEscape(msg))
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ func (this *WikiServer) routeFormatting(w http.ResponseWriter, r *http.Request)
|
||||
<li>[section=header]content[/section]</li>
|
||||
<li>[youtube]id[/youtube]</li>
|
||||
<li>[html]raw html[/html]</li>
|
||||
<li>` + bbcodeIsDeleted + `</li>
|
||||
</ul>`
|
||||
|
||||
pto.Content = template.HTML(content)
|
||||
|
5
rView.go
5
rView.go
@ -26,6 +26,11 @@ func (this *WikiServer) routeView(w http.ResponseWriter, r *http.Request, articl
|
||||
return
|
||||
}
|
||||
|
||||
if string(a.Body) == bbcodeIsDeleted {
|
||||
this.serveDeleted(w, articleTitle)
|
||||
return
|
||||
}
|
||||
|
||||
pto := DefaultPageTemplateOptions(this.opts)
|
||||
pto.CurrentPageName = articleTitle
|
||||
pto.CurrentPageIsArticle = true
|
||||
|
Loading…
Reference in New Issue
Block a user