From 4e700f5727dccee83af6dc64cf4276950812f61a Mon Sep 17 00:00:00 2001 From: Nirmal Kumar R Date: Mon, 4 Nov 2024 23:44:17 +0000 Subject: [PATCH] DRY: Add existing ctx value to data-branch-path --- routers/web/repo/editor.go | 1 + templates/repo/editor/edit.tmpl | 2 +- web_src/js/features/repo-editor.js | 13 ++----------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 00c3d880a9..f27ad62982 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -211,6 +211,7 @@ func editFile(ctx *context.Context, isNewFile bool) { ctx.Data["TreeNames"] = treeNames ctx.Data["TreePaths"] = treePaths ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL() + ctx.Data["BranchPath"] = ctx.Repo.BranchNameSubURL() ctx.Data["commit_summary"] = "" ctx.Data["commit_message"] = "" if canCommit { diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index 71cecf1514..7b750b1e27 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -28,7 +28,7 @@