1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

web: Remove template related code

This commit is contained in:
James Hillyerd
2018-12-15 09:20:57 -08:00
parent 4894244d5c
commit 89886843bd
5 changed files with 3 additions and 120 deletions

View File

@@ -3,7 +3,6 @@ package webui
import (
"errors"
"fmt"
"html/template"
"io"
"net/http"
"strconv"
@@ -110,14 +109,10 @@ func MailboxHTML(w http.ResponseWriter, req *http.Request, ctx *web.Context) (er
// This doesn't indicate empty, likely an IO error
return fmt.Errorf("GetMessage(%q) failed: %v", id, err)
}
// Render partial template
// Render HTML
w.Header().Set("Content-Type", "text/html; charset=UTF-8")
return web.RenderPartial("mailbox/_html.html", w, map[string]interface{}{
"ctx": ctx,
"name": name,
"message": msg,
"body": template.HTML(msg.HTML()),
})
_, err = w.Write([]byte(msg.HTML()))
return err
}
// MailboxSource displays the raw source of a message, including headers. Renders text/plain