diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index b5ccaa1dfb..aa615059fe 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -2920,6 +2920,7 @@ "org.teams.write_access_helper": "Members can read and push to team repositories.", "org.teams.admin_access": "Administrator Access", "org.teams.admin_access_helper": "Members can pull and push to team repositories and add collaborators to them.", + "org.teams.owner_access": "Owner", "org.teams.no_desc": "This team has no description", "org.teams.settings": "Settings", "org.teams.owners_permission_desc": "Owners have full access to all repositories and have administrator access to the organization.", diff --git a/routers/web/repo/blame.go b/routers/web/repo/blame.go index 583a982824..5a39163abf 100644 --- a/routers/web/repo/blame.go +++ b/routers/web/repo/blame.go @@ -20,6 +20,7 @@ import ( "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/gitrepo" "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/highlight" "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/log" + "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/markup" "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/setting" "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/templates" "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/util" @@ -73,6 +74,12 @@ func RefBlame(ctx *context.Context) { return } + // Set HasSourceRenderedToggle if the file has a known markup renderer, + // so that permalinks include ?display=source for correct line-number linking. + if markup.DetectRendererTypeByFilename(ctx.Repo.TreePath) != nil { + ctx.Data["HasSourceRenderedToggle"] = true + } + ctx.Data["NumLines"], err = blob.GetBlobLineCount(nil) if err != nil { ctx.NotFound(err) diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index 8bdefa5d43..4ebf13b1e8 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -76,8 +76,6 @@ {{end}}{{/* end if .IsFileTooLarge */}}