From 7f62acb4d9d90d4b6feb723d3c1aa38b0c0e62d0 Mon Sep 17 00:00:00 2001 From: Bram Hagens Date: Thu, 22 Aug 2024 15:36:12 +0000 Subject: [PATCH] ui: fix go to citation button url (#4597) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4597 Reviewed-by: Ghost Reviewed-by: Gusted Co-authored-by: Bram Hagens Co-committed-by: Bram Hagens --- routers/web/repo/view.go | 3 +- templates/repo/cite/cite_modal.tmpl | 2 +- templates/repo/home.tmpl | 2 +- tests/integration/repo_citation_test.go | 81 +++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 3 deletions(-) create mode 100644 tests/integration/repo_citation_test.go diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index db163410cf..f1445c580a 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -781,7 +781,8 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) { if content, err := entry.Blob().GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil { log.Error("checkCitationFile: GetBlobContent: %v", err) } else { - ctx.Data["CitiationExist"] = true + ctx.Data["CitationExist"] = true + ctx.Data["CitationFile"] = entry.Name() ctx.PageData["citationFileContent"] = content break } diff --git a/templates/repo/cite/cite_modal.tmpl b/templates/repo/cite/cite_modal.tmpl index fb251442ca..1ce959a5c5 100644 --- a/templates/repo/cite/cite_modal.tmpl +++ b/templates/repo/cite/cite_modal.tmpl @@ -6,7 +6,7 @@