|
|
@ -1,16 +1,17 @@ |
|
|
|
package repo |
|
|
|
package repo |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"net/http" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/codegangsta/martini" |
|
|
|
"github.com/codegangsta/martini" |
|
|
|
"github.com/gogits/gogs/models" |
|
|
|
"github.com/gogits/gogs/models" |
|
|
|
"github.com/gogits/gogs/modules/auth" |
|
|
|
"github.com/gogits/gogs/modules/auth" |
|
|
|
"github.com/gogits/gogs/modules/base" |
|
|
|
"github.com/gogits/gogs/modules/base" |
|
|
|
"github.com/martini-contrib/render" |
|
|
|
"github.com/martini-contrib/render" |
|
|
|
"github.com/martini-contrib/sessions" |
|
|
|
"github.com/martini-contrib/sessions" |
|
|
|
"net/http" |
|
|
|
"github.com/qiniu/log" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func Single(params martini.Params, req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { |
|
|
|
func Single(params martini.Params, req *http.Request, r render.Render, data base.TmplData, session sessions.Session) { |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
user *models.User |
|
|
|
user *models.User |
|
|
@ -52,5 +53,14 @@ func Single(params martini.Params, req *http.Request, r render.Render, data base |
|
|
|
data["RepositoryLink"] = data["Title"] |
|
|
|
data["RepositoryLink"] = data["Title"] |
|
|
|
data["IsRepoToolbarSource"] = true |
|
|
|
data["IsRepoToolbarSource"] = true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
files, err := models.GetReposFiles(params["username"], params["reponame"], "HEAD", "/") |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
data["ErrorMsg"] = err |
|
|
|
|
|
|
|
log.Error("repo.List: %v", err) |
|
|
|
|
|
|
|
r.HTML(200, "base/error", data) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data["Files"] = files |
|
|
|
r.HTML(200, "repo/single", data) |
|
|
|
r.HTML(200, "repo/single", data) |
|
|
|
} |
|
|
|
} |
|
|
|