diff --git a/base/web/render.go b/base/web/render.go index 0782c4a6..402ca009 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -71,6 +71,18 @@ func Render(m *ice.Message, cmd string, args ...ice.Any) bool { } RenderType(m.W, arg[0], kit.Select("", arg, 1)) RenderHeader(m.W, "Content-Disposition", fmt.Sprintf("filename=%s", kit.Select(path.Base(kit.Select(arg[0], m.Option("filename"))), arg, 2))) + if m.Option("render") == "replace" { + res := m.Cmdx(nfs.CAT, arg[0]) + fieldset := "fieldset." + m.Option(ctx.INDEX) + m.W.Write([]byte(kit.ReplaceAll(res, + "$project", fieldset+">div.output>div.project", + "$display", fieldset+">div.output>div.layout>div.display", + "$profile", fieldset+">div.output>div.layout>div.layout>div.profile", + "$content", fieldset+">div.output>div.layout>div.layout>div.content", + "$fieldset", fieldset, "$index", m.Option(ctx.INDEX), + ))) + break + } if _, e := nfs.DiskFile.StatFile(arg[0]); e == nil { http.ServeFile(m.W, m.R, kit.Path(arg[0])) } else if f, e := nfs.PackFile.OpenFile(arg[0]); e == nil { diff --git a/conf.go b/conf.go index 534215ec..77892451 100644 --- a/conf.go +++ b/conf.go @@ -212,9 +212,10 @@ const ( // MSG MSG_OUTPUT = "_output" MSG_ARGS = "_args" - MSG_PROCESS = "_process" - MSG_DISPLAY = "_display" - MSG_TOOLKIT = "_toolkit" + MSG_PROCESS = "_process" + MSG_DISPLAY = "_display" + MSG_DISPLAY_CSS = "_display_css" + MSG_TOOLKIT = "_toolkit" MSG_USERIP = "user.ip" MSG_USERUA = "user.ua"