aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLunny Xiao2022-02-17 01:16:04 +0800
committerGitHub2022-02-16 17:16:04 +0000
commitad789542b874d4a5a1aa8e9732eb200f48f38830 (patch)
tree23e19c3d6bbee7330e979209677fa6e8569a3495
parent1f7802db97c8bdda5589901897eecf5adb941f44 (diff)
Fix template bug of LFS lock (#18784) (#18787)
Backport #18784 Fix #18782
-rw-r--r--routers/web/repo/view.go1
-rw-r--r--templates/repo/view_file.tmpl2
2 files changed, 2 insertions, 1 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index 4c0e881f1..e98d94f7c 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -465,6 +465,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
return
}
ctx.Data["LFSLockOwner"] = u.DisplayName()
+ ctx.Data["LFSLockOwnerHomeLink"] = u.HomeLink()
ctx.Data["LFSLockHint"] = ctx.Tr("repo.editor.this_file_locked")
}
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index d5308c154..dc62e249b 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -24,7 +24,7 @@
{{if .LFSLock}}
<div class="file-info-entry ui tooltip" data-content="{{.LFSLockHint}}">
{{svg "octicon-lock" 16 "mr-2"}}
- <a href="{{.LFSLock.Owner.HomeLink}}">{{.LFSLockOwner}}</a>
+ <a href="{{.LFSLockOwnerHomeLink}}">{{.LFSLockOwner}}</a>
</div>
{{end}}
</div>