dashboard.go 686 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package routers
  5. import (
  6. "github.com/gogits/gogs/modules/middleware"
  7. "github.com/gogits/gogs/routers/user"
  8. )
  9. func Home(ctx *middleware.Context) {
  10. if ctx.IsSigned {
  11. user.Dashboard(ctx)
  12. return
  13. }
  14. ctx.Data["PageIsHome"] = true
  15. ctx.HTML(200, "home")
  16. }
  17. func Help(ctx *middleware.Context) {
  18. ctx.Data["PageIsHelp"] = true
  19. ctx.Data["Title"] = "Help"
  20. ctx.HTML(200, "help")
  21. }
  22. func NotFound(ctx *middleware.Context) {
  23. ctx.Data["PageIsNotFound"] = true
  24. ctx.Data["Title"] = 404
  25. ctx.Handle(404, "home.NotFound", nil)
  26. }