diff options
Diffstat (limited to 'src/http/assets.go')
-rw-r--r-- | src/http/assets.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/http/assets.go b/src/http/assets.go index 260b786..9c6c67e 100644 --- a/src/http/assets.go +++ b/src/http/assets.go @@ -59,9 +59,9 @@ func resizeImage(out io.Writer, in io.Reader, maxWidth float64) error { } } -func (a *api) renderPostAssetsIndexHandler() http.Handler { +func (a *api) managePostAssetsHandler() http.Handler { - tpl := a.mustParseBasedTpl("assets.html") + tpl := a.mustParseBasedTpl("post-assets-manage.html") return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { @@ -86,17 +86,10 @@ func (a *api) renderPostAssetsIndexHandler() http.Handler { func (a *api) getPostAssetHandler() http.Handler { - renderIndexHandler := a.renderPostAssetsIndexHandler() - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { id := filepath.Base(r.URL.Path) - if id == "/" { - renderIndexHandler.ServeHTTP(rw, r) - return - } - maxWidth, err := apiutil.StrToInt(r.FormValue("w"), 0) if err != nil { apiutil.BadRequest(rw, r, fmt.Errorf("invalid w parameter: %w", err)) @@ -172,7 +165,7 @@ func (a *api) postPostAssetHandler() http.Handler { return } - a.executeRedirectTpl(rw, r, a.assetsURL(false)) + a.executeRedirectTpl(rw, r, a.manageAssetsURL(false)) }) } @@ -199,6 +192,6 @@ func (a *api) deletePostAssetHandler() http.Handler { return } - a.executeRedirectTpl(rw, r, a.assetsURL(false)) + a.executeRedirectTpl(rw, r, a.manageAssetsURL(false)) }) } |