Skip to content

Commit

Permalink
codeBrowser: Fix Code browser nav tab link error
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Dec 16, 2016
1 parent 8afa58b commit cb81968
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/views/code/branches.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@
* limitations under the License.
**@
@(project: Project, branches: List[playRepository.GitBranch], head: playRepository.GitBranch)
@defaultBranch = @{
if(project.defaultBranch().lastIndexOf("/") > 0){
project.defaultBranch().substring(project.defaultBranch().lastIndexOf("/") + 1)
} else {
project.defaultBranch()
}
}

@import utils.AccessControl._
@import java.net.URLEncoder

@projectLayout(Messages("title.branches"), project, utils.MenuType.CODE) {
@projectMenu(project, utils.MenuType.CODE, "main-menu-only")
Expand All @@ -30,10 +38,10 @@
<div class="code-browse-wrap">
<ul class="nav nav-tabs" style="margin-bottom:20px;">
<li>
<a href="@routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, "HEAD", "")">@Messages("code.files")</a>
<a href="@routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, defaultBranch, "")">@Messages("code.files")</a>
</li>
<li>
<a href="@routes.CodeHistoryApp.historyUntilHead(project.owner, project.name)">@Messages("code.commits")</a>
<a href="@routes.CodeHistoryApp.history(project.owner, project.name, defaultBranch, "")">@Messages("code.commits")</a>
</li>
@if(project.isGit) {
<li class="active">
Expand Down

0 comments on commit cb81968

Please sign in to comment.