single.go 834 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package repo
  2. import (
  3. "github.com/codegangsta/martini"
  4. "github.com/martini-contrib/render"
  5. "github.com/gogits/gogs/models"
  6. "github.com/gogits/gogs/modules/base"
  7. "github.com/gogits/gogs/modules/log"
  8. )
  9. func Single(params martini.Params, r render.Render, data base.TmplData) {
  10. if !data["IsRepositoryValid"].(bool) {
  11. return
  12. }
  13. files, err := models.GetReposFiles(params["username"], params["reponame"], "HEAD", "/")
  14. if err != nil {
  15. log.Handle(200, "repo.Single", data, r, err)
  16. return
  17. }
  18. data["IsRepoToolbarSource"] = true
  19. data["Files"] = files
  20. r.HTML(200, "repo/single", data)
  21. }
  22. func Setting(r render.Render, data base.TmplData) {
  23. if !data["IsRepositoryValid"].(bool) {
  24. return
  25. }
  26. data["Title"] = data["Title"].(string) + " - settings"
  27. data["IsRepoToolbarSetting"] = true
  28. r.HTML(200, "repo/setting", data)
  29. }