Fix legacy redirect for tree, fix code tab escape
Signed-off-by: Robin Durner <github@nubenum.de>
This commit is contained in:
parent
06991dfb69
commit
1237382d65
|
@ -619,9 +619,10 @@ func RepoRefByType(refType RepoRefType) macaron.Handler {
|
|||
|
||||
if refType == RepoRefLegacy {
|
||||
// redirect from old URL scheme to new URL scheme
|
||||
unescaped, _ := url.PathUnescape(ctx.Req.URL.String())
|
||||
ctx.Redirect(path.Join(
|
||||
setting.AppSubURL,
|
||||
path.Dir(ctx.Req.URL.String()),
|
||||
strings.TrimSuffix(unescaped, ctx.Params("*")),
|
||||
(&url.URL{Path: ctx.Repo.BranchNameSubURL()}).String(),
|
||||
ctx.Repo.TreePath))
|
||||
return
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<div class="ui tabs container">
|
||||
<div class="ui tabular stackable menu navbar">
|
||||
{{if .Repository.UnitEnabled $.UnitTypeCode}}
|
||||
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL}}{{end}}">
|
||||
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">
|
||||
<i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user