diff options
author | Unknwon <u@gogs.io> | 2017-04-05 09:17:21 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-04-05 09:17:21 -0400 |
commit | edaf14f2b6fd86f8dec99f67512a5c0095e391dc (patch) | |
tree | ec81011348a0c8df3995c36b46e2646472106800 /pkg/context/context.go | |
parent | 6fbb984ebf4f0d6804f0f83e6edb12ef0bb9a570 (diff) |
Refactoring: remove tool.TplName
Diffstat (limited to 'pkg/context/context.go')
-rw-r--r-- | pkg/context/context.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pkg/context/context.go b/pkg/context/context.go index 89783007..4213eaa4 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -21,7 +21,6 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/pkg/auth" - "github.com/gogits/gogs/pkg/tool" "github.com/gogits/gogs/pkg/form" "github.com/gogits/gogs/pkg/setting" ) @@ -80,18 +79,18 @@ func (ctx *Context) HasValue(name string) bool { } // HTML responses template with given status. -func (ctx *Context) HTML(status int, name tool.TplName) { +func (ctx *Context) HTML(status int, name string) { log.Trace("Template: %s", name) - ctx.Context.HTML(status, string(name)) + ctx.Context.HTML(status, name) } // Success responses template with status http.StatusOK. -func (c *Context) Success(name tool.TplName) { +func (c *Context) Success(name string) { c.HTML(http.StatusOK, name) } // RenderWithErr used for page has form validation but need to prompt error to users. -func (ctx *Context) RenderWithErr(msg string, tpl tool.TplName, f interface{}) { +func (ctx *Context) RenderWithErr(msg, tpl string, f interface{}) { if f != nil { form.Assign(f, ctx.Data) } @@ -112,7 +111,7 @@ func (ctx *Context) Handle(status int, title string, err error) { ctx.Data["ErrorMsg"] = err } } - ctx.HTML(status, tool.TplName(fmt.Sprintf("status/%d", status))) + ctx.HTML(status, fmt.Sprintf("status/%d", status)) } // NotFound renders the 404 page. |