aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/view.go
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-03-18 05:59:07 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-18 18:59:07 +0800
commit1c3bd436ccbe3852541dc7162df41632658769db (patch)
tree4ee965f43e0dee397c05557329bf524974cd94a4 /routers/repo/view.go
parent5ecb369dacb929c218399379350fa2ecb05693ae (diff)
downloadgitea-1c3bd436ccbe3852541dc7162df41632658769db.tar.gz
gitea-1c3bd436ccbe3852541dc7162df41632658769db.zip
feat: Only use issue and wiki on repo. (#1297)
Diffstat (limited to 'routers/repo/view.go')
-rw-r--r--routers/repo/view.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index 5f9d78a52f..51443a9452 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -28,6 +28,7 @@ import (
)
const (
+ tplRepoBARE base.TplName = "repo/bare"
tplRepoHome base.TplName = "repo/home"
tplWatchers base.TplName = "repo/watchers"
tplForks base.TplName = "repo/forks"
@@ -243,12 +244,18 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
// Home render repository home page
func Home(ctx *context.Context) {
+ ctx.Data["PageIsViewCode"] = true
+
+ if ctx.Repo.Repository.IsBare {
+ ctx.HTML(200, tplRepoBARE)
+ return
+ }
+
title := ctx.Repo.Repository.Owner.Name + "/" + ctx.Repo.Repository.Name
if len(ctx.Repo.Repository.Description) > 0 {
title += ": " + ctx.Repo.Repository.Description
}
ctx.Data["Title"] = title
- ctx.Data["PageIsViewCode"] = true
ctx.Data["RequireHighlightJS"] = true
branchLink := ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchName