From 857020afb39e5709c790df6a0c230f6ff75e8338 Mon Sep 17 00:00:00 2001 From: Yi EungJun Date: Wed, 18 Mar 2015 17:54:07 +0900 Subject: [PATCH] svn: Fix incorrect url to file at specific revision Do not use jquery template for the url. We can't create a template string by routes.CodeApp.codeBrowserWithBranch because the method encodes path segments. It is a kind of duplication with the routes file, but currently I think there is no better way to solve this problem. --- app/views/code/svnDiff.scala.html | 2 +- public/javascripts/service/yobi.code.SvnDiff.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/code/svnDiff.scala.html b/app/views/code/svnDiff.scala.html index 6f1afd2d9..123bf8b43 100644 --- a/app/views/code/svnDiff.scala.html +++ b/app/views/code/svnDiff.scala.html @@ -178,7 +178,7 @@ "sUnwatchUrl" : "@routes.WatchApp.unwatch(commit.asResource(project).asParameter)", "sParentCommitId": "@if(parentCommit != null){@parentCommit.getId}", "sCommitId" : "@commit.getId", - "sTplFileURL" : "@routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, "${commitId}", "${path}")", + "sCodeURL" : "@routes.CodeApp.codeBrowser(project.owner, project.name)" }); yobi.Mention({ diff --git a/public/javascripts/service/yobi.code.SvnDiff.js b/public/javascripts/service/yobi.code.SvnDiff.js index cd3f53844..b6ce5ca1d 100644 --- a/public/javascripts/service/yobi.code.SvnDiff.js +++ b/public/javascripts/service/yobi.code.SvnDiff.js @@ -50,6 +50,7 @@ htVar.sUnwatchUrl = htOptions.sUnwatchUrl; htVar.sParentCommitId = htOptions.sParentCommitId; htVar.sCommitId = htOptions.sCommitId; + htVar.sCodeURL = htOptions.sCodeURL; htVar.sTplFileURL = htOptions.sTplFileURL; htVar.rxSlashes = /\//g; @@ -444,7 +445,7 @@ } function _makeCommitLink(sPath,sCommitId) { - var sURL = $yobi.tmpl(htVar.sTplFileURL, {"commitId":sCommitId, "path":sPath}); + var sURL = htVar.sCodeURL + "/" + sCommitId + "/" + sPath; var welCommit = $('
',{class:'diff-partial-commit-id'}); var welCommitLink = $('',{href:sURL,target:'_blink'}).text(sCommitId); welCommit.append(welCommitLink);