0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-03 00:13:48 +01:00

more fixes

This commit is contained in:
silverwind 2025-10-30 03:43:05 +01:00
parent cb8be2e50a
commit 5b40a23926
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ func TestRenderHelperCodePreview(t *testing.T) {
OwnerName: "user2",
RepoName: "repo1",
CommitID: "65f1bf27bc3bf70f64657658635e66094edbcb4d",
FilePath: "/README.md",
FilePath: "README.md",
LineStart: 1,
LineStop: 2,
})

View File

@ -1,7 +1,7 @@
<div class="code-preview-container file-content">
<div class="code-preview-header">
<a href="{{.FullURL}}" class="tw-font-semibold" rel="nofollow">{{.RepoName}}/{{.FilePath}}</a>
{{$link := HTMLFormat `<a href="%s/commit/%s" class="muted tw-font-mono tw-text-text">%s</a>` .RepoLink .CommitID (.CommitID | ShortSha) -}}
{{$link := HTMLFormat `<a href="%s/commit/%s" class="muted tw-font-mono tw-text-text" rel="nofollow">%s</a>` .RepoLink .CommitID (.CommitID | ShortSha) -}}
{{- if eq .LineStart .LineStop -}}
{{ctx.Locale.Tr "repo.code_preview_line_in" .LineStart $link}}
{{- else -}}