diff options
Diffstat (limited to 'pkg/context')
-rw-r--r-- | pkg/context/api.go | 4 | ||||
-rw-r--r-- | pkg/context/context.go | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/pkg/context/api.go b/pkg/context/api.go index a1c80bd1..5e29a73f 100644 --- a/pkg/context/api.go +++ b/pkg/context/api.go @@ -12,7 +12,7 @@ import ( log "gopkg.in/clog.v1" "gopkg.in/macaron.v1" - "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/tool" "github.com/gogits/gogs/pkg/setting" ) @@ -37,7 +37,7 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) { ctx.JSON(status, map[string]string{ "message": message, - "url": base.DOC_URL, + "url": tool.DOC_URL, }) } diff --git a/pkg/context/context.go b/pkg/context/context.go index b3377833..89783007 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -21,7 +21,7 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/pkg/auth" - "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/tool" "github.com/gogits/gogs/pkg/form" "github.com/gogits/gogs/pkg/setting" ) @@ -80,18 +80,18 @@ func (ctx *Context) HasValue(name string) bool { } // HTML responses template with given status. -func (ctx *Context) HTML(status int, name base.TplName) { +func (ctx *Context) HTML(status int, name tool.TplName) { log.Trace("Template: %s", name) ctx.Context.HTML(status, string(name)) } // Success responses template with status http.StatusOK. -func (c *Context) Success(name base.TplName) { +func (c *Context) Success(name tool.TplName) { 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 base.TplName, f interface{}) { +func (ctx *Context) RenderWithErr(msg string, tpl tool.TplName, f interface{}) { if f != nil { form.Assign(f, ctx.Data) } @@ -112,7 +112,7 @@ func (ctx *Context) Handle(status int, title string, err error) { ctx.Data["ErrorMsg"] = err } } - ctx.HTML(status, base.TplName(fmt.Sprintf("status/%d", status))) + ctx.HTML(status, tool.TplName(fmt.Sprintf("status/%d", status))) } // NotFound renders the 404 page. |