Yi EungJun 2015-03-18
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.
@857020afb39e5709c790df6a0c230f6ff75e8338
app/views/code/svnDiff.scala.html
--- app/views/code/svnDiff.scala.html
+++ 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({
public/javascripts/service/yobi.code.SvnDiff.js
--- public/javascripts/service/yobi.code.SvnDiff.js
+++ 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 = $('<div/>',{class:'diff-partial-commit-id'});
             var welCommitLink = $('<a/>',{href:sURL,target:'_blink'}).text(sCommitId);
             welCommit.append(welCommitLink);
Add a comment
List