From 848329076f61090c9430affe12dfc9d7a09e6b82 Mon Sep 17 00:00:00 2001 From: avadesian Date: Fri, 15 Oct 2021 13:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E5=8F=96=E5=AF=B9=E5=BA=94=E4=B8=8A?= =?UTF-8?q?=E6=B8=B8=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/view.go | 2 ++ templates/repo/home.tmpl | 60 ++++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/routers/repo/view.go b/routers/repo/view.go index 0d284c42b..9477b27dd 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -808,10 +808,12 @@ func renderCode(ctx *context.Context) { //base repo has the same branch, then compare between current repo branch and base repo's branch compareUrl := ctx.Repo.BranchName + "..." + ctx.Repo.Repository.BaseRepo.OwnerName + "/" + ctx.Repo.Repository.BaseRepo.Name + ":" + ctx.Repo.BranchName ctx.SetParams("*",compareUrl) + ctx.Data["UpstreamSameBranchName"] = true }else{ //else, compare between current repo branch and base repo's default branch compareUrl := ctx.Repo.BranchName + "..." + ctx.Repo.Repository.BaseRepo.OwnerName + "/" + ctx.Repo.Repository.BaseRepo.Name + ":" + ctx.Repo.Repository.BaseRepo.DefaultBranch ctx.SetParams("*",compareUrl) + ctx.Data["UpstreamSameBranchName"] = false } _, _, headGitRepo, compareInfo, _, _ := ParseCompareInfo(ctx) defer headGitRepo.Close() diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 8d52f9115..eaa4cab9a 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -75,7 +75,7 @@ z-index: 11; will-change: transform, opacity; width: 100% !important; - + -webkit-animation-iteration-count: 1; animation-iteration-count: 1; -webkit-animation-duration: 300ms; @@ -86,7 +86,7 @@ animation-fill-mode: both; } - + @@ -94,7 +94,7 @@ {{template "repo/header" .}}
{{template "base/alert" .}} - + {{if and .Permission.IsAdmin (not .Repository.IsArchived)}} - + {{end}}
{{.i18n.Tr "repo.topic.count_prompt"}} {{.i18n.Tr "repo.topic.format_prompt"}}
-
+
{{if .RepoSearchEnabled}} {{end}}
- + {{if .Repository.IsArchived}}
{{.i18n.Tr "repo.archive.title"}} @@ -156,7 +156,7 @@ {{if and .Repository.IsFork .PullRequestCtx.Allowed}} {{if gt .FetchUpstreamCnt 0 }} - + {{else if lt .FetchUpstreamCnt 0}} @@ -164,7 +164,7 @@ {{else}} - + {{end}} @@ -254,7 +254,7 @@ {{template "repo/view_list" .}} {{end}}
-
+

简介 {{range .Topics}} - + {{.Name}} - - + + {{end}}

@@ -301,13 +301,13 @@
- +
- - + +

{{range .LanguageStats}} @@ -315,14 +315,14 @@ {{end}}

- - + + {{if .LICENSE}}

{{.LICENSE}}

- + {{end}}
@@ -338,22 +338,22 @@ {{range .ContributorInfo}} {{if .UserInfo}} - {{else if .Email}} + {{else if .Email}} {{.Email}} {{end}} {{end}} -
+
- + - + - +