diff --git a/modules/context/repo.go b/modules/context/repo.go index f3ae33cb5..53dbaa3bc 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -619,8 +619,8 @@ func RepoRefByType(refType RepoRefType) macaron.Handler { // redirect from old URL scheme to new URL scheme ctx.Redirect(path.Join( setting.AppSubURL, - strings.TrimSuffix(ctx.Req.URL.String(), ctx.Params("*")), - ctx.Repo.BranchNameSubURL(), + path.Dir(ctx.Req.URL.String()), + strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(ctx.Repo.BranchNameSubURL()), ctx.Repo.TreePath)) return } diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index f5454afb9..2adc8e44c 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -84,7 +84,7 @@
{{$.i18n.Tr "repo.activity.published_release_label"}}
{{.TagName}} {{if not .IsTag}} - {{.Title}} + {{.Title}} {{end}} {{TimeSinceUnix .CreatedUnix $.Lang}}

diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index cd6afce91..750526f7a 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -38,10 +38,10 @@ {{if .IsDeleted}} - {{.Name}} + {{.Name}}

{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}

{{else}} - {{.Name}} + {{.Name}}

{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}

{{end}} diff --git a/templates/repo/commits_table.tmpl b/templates/repo/commits_table.tmpl index 8a8e2c369..e96abd1b2 100644 --- a/templates/repo/commits_table.tmpl +++ b/templates/repo/commits_table.tmpl @@ -5,7 +5,7 @@
{{if .PageIsCommits}} -
+ @@ -83,17 +83,17 @@ {{if gt .TotalPages 1}}
diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index 7b7e2cf46..52d3bc218 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -14,7 +14,7 @@
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index 77e40c6de..930c92d60 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -30,8 +30,8 @@
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 9f705c967..b63477509 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -27,7 +27,7 @@
diff --git a/templates/repo/pulls/commits.tmpl b/templates/repo/pulls/commits.tmpl index 99bac62cf..d084f9bc5 100644 --- a/templates/repo/pulls/commits.tmpl +++ b/templates/repo/pulls/commits.tmpl @@ -5,7 +5,7 @@
diff --git a/templates/repo/pulls/files.tmpl b/templates/repo/pulls/files.tmpl index 7663788c6..8cb006a25 100644 --- a/templates/repo/pulls/files.tmpl +++ b/templates/repo/pulls/files.tmpl @@ -5,7 +5,7 @@
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index af0f0fa82..5f4a00bcb 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -28,7 +28,7 @@ {{$.i18n.Tr "repo.release.stable"}} {{end}} - {{.TagName}} + {{.TagName}} {{ShortSha .Sha1}} @@ -38,19 +38,19 @@
{{if .IsTag}}

- {{.TagName}} + {{.TagName}}

{{if $.Repository.UnitEnabled $.UnitTypeCode}} {{ShortSha .Sha1}} - ZIP - TAR.GZ + ZIP + TAR.GZ {{end}}
{{else}}

- {{.Title}} - {{if $.IsRepositoryWriter}}({{$.i18n.Tr "repo.release.edit"}}){{end}} + {{.Title}} + {{if $.IsRepositoryWriter}}({{$.i18n.Tr "repo.release.edit"}}){{end}}

@@ -68,10 +68,10 @@

@@ -62,7 +62,7 @@ {{range .ProtectedBranches}}
{{.BranchName}}
- Edit + Edit {{else}} {{.i18n.Tr "repo.settings.no_protected_branch"}} diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index bdd6c3482..bd2ea370e 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -13,8 +13,8 @@ {{else if eq .GetOpType 2}} {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}} {{else if eq .GetOpType 5}} - {{ $branchLink := .GetBranch | EscapePound}} - {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}} + {{ $branchLink := (printf "branch/%s" .GetBranch) | EscapePound | Escape}} + {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink (Escape .GetBranch) .ShortRepoPath | Str2html}} {{else if eq .GetOpType 6}} {{ $index := index .GetIssueInfos 0}} {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}} @@ -24,7 +24,8 @@ {{else if eq .GetOpType 8}} {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}} {{else if eq .GetOpType 9}} - {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}} + {{ $branchLink := .GetBranch | EscapePound | Escape}} + {{$.i18n.Tr "action.push_tag" .GetRepoLink $branchLink .ShortRepoPath | Str2html}} {{else if eq .GetOpType 10}} {{ $index := index .GetIssueInfos 0}} {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}