dashboard.go 651 B

123456789101112131415161718192021222324
  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/martini-contrib/render"
  7. "github.com/martini-contrib/sessions"
  8. "github.com/gogits/gogs/modules/auth"
  9. "github.com/gogits/gogs/modules/base"
  10. "github.com/gogits/gogs/modules/middleware"
  11. "github.com/gogits/gogs/routers/user"
  12. )
  13. func Home(ctx *middleware.Context, r render.Render, data base.TmplData, session sessions.Session) {
  14. if auth.IsSignedIn(session) {
  15. user.Dashboard(ctx)
  16. return
  17. }
  18. data["PageIsHome"] = true
  19. r.HTML(200, "home", data)
  20. }