Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
svn: Fix incorrect url to file at specific revision
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Yi EungJun committed Apr 16, 2015
1 parent 352d114 commit 857020a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/code/svnDiff.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
3 changes: 2 additions & 1 deletion public/javascripts/service/yobi.code.SvnDiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 857020a

Please sign in to comment.