Added deleted page to show if file was successfully deleted.
This commit is contained in:
parent
cb1dd51750
commit
15dd184106
@ -210,6 +210,7 @@ func (h *UploadHandlers) Delete(w http.ResponseWriter, r *http.Request) {
|
|||||||
h.logDelete.Printf("| %s | %s | %s | %s", r.Header.Get("X-Real-IP"), netTyp, saltedHash, r.UserAgent())
|
h.logDelete.Printf("| %s | %s | %s | %s", r.Header.Get("X-Real-IP"), netTyp, saltedHash, r.UserAgent())
|
||||||
|
|
||||||
w.WriteHeader(http.StatusNoContent)
|
w.WriteHeader(http.StatusNoContent)
|
||||||
|
web.Deleted(utils.MainSite(r.Host), site)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NotFound(w http.ResponseWriter, r *http.Request) {
|
func NotFound(w http.ResponseWriter, r *http.Request) {
|
||||||
|
11
web/templates/deleted.jade
Normal file
11
web/templates/deleted.jade
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
extends base.jade
|
||||||
|
|
||||||
|
block header
|
||||||
|
h1 Deleted
|
||||||
|
|
||||||
|
block body
|
||||||
|
:go:func Deleted(mainSite, site string)
|
||||||
|
section
|
||||||
|
h2 File was successfully deleted.
|
||||||
|
center
|
||||||
|
a(href="/") Back to index page
|
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/index.jade
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/index.jade
|
||||||
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/nospace.jade
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/nospace.jade
|
||||||
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/deleted.jade
|
||||||
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/uploaded.jade
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/uploaded.jade
|
||||||
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/error404.jade
|
//go:generate $GOPATH/bin/jade -pkg=web -stdbuf -stdlib -writer templates/error404.jade
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user