diff options
author | Unknwon <u@gogs.io> | 2017-03-16 23:10:45 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-16 23:10:45 -0400 |
commit | 171f97868dccb6d2c2a73b44b07593ccb8f348e6 (patch) | |
tree | 16a6a9ab501004d83237126956b60926a523bc42 /routers | |
parent | becaec19a773301546045294d850d79614809c7c (diff) |
repo: allow issues and wiki for bare repository (#4104)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/view.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index 3f7165d7..2b166520 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -27,6 +27,7 @@ import ( ) const ( + BARE base.TplName = "repo/bare" HOME base.TplName = "repo/home" WATCHERS base.TplName = "repo/watchers" FORKS base.TplName = "repo/forks" @@ -223,6 +224,13 @@ func setEditorconfigIfExists(ctx *context.Context) { } func Home(ctx *context.Context) { + ctx.Data["PageIsViewCode"] = true + + if ctx.Repo.Repository.IsBare { + ctx.HTML(200, BARE) + return + } + title := ctx.Repo.Repository.Owner.Name + "/" + ctx.Repo.Repository.Name if len(ctx.Repo.Repository.Description) > 0 { title += ": " + ctx.Repo.Repository.Description @@ -231,7 +239,6 @@ func Home(ctx *context.Context) { if ctx.Repo.BranchName != ctx.Repo.Repository.DefaultBranch { ctx.Data["Title"] = title + " @ " + ctx.Repo.BranchName } - ctx.Data["PageIsViewCode"] = true ctx.Data["RequireHighlightJS"] = true branchLink := ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchName |