func InsertLink(ctx *middleware.Context, link model.Link) { switch ctx.R.Method { case "POST": err := link.Insert() PanicIf(err) ctx.Set("success", true) ctx.Set("message", Translate(ctx.S.Get("Lang").(string), "message.send.success")) ctx.Redirect("/link/all") default: ctx.HTML(200, "link/edit", ctx) } }