Merge pull request #1027 from moccos/add_path_to_title

Add path and branch name to the page title
This commit is contained in:
Naoki Takezoe
2016-01-05 01:07:47 +09:00
2 changed files with 11 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
isBlame: Boolean)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.main(s"${(repository.name :: pathList).mkString("/")} at ${encodeRefName(branch)} - ${repository.owner}/${repository.name}", Some(repository)) {
@html.menu("code", repository){
<div class="head">
<div class="pull-right hide-if-blame"><div class="btn-group">

View File

@@ -11,7 +11,16 @@
error: Option[Any] = None)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
@html.main(
if(pathList.isEmpty){
if(branch == repository.repository.defaultBranch){
s"${repository.owner}/${repository.name}"
} else {
s"${repository.owner}/${repository.name} at ${encodeRefName(branch)}"
}
} else {
s"${(repository.name :: pathList).mkString("/")} at ${encodeRefName(branch)} - ${repository.owner}/${repository.name}"
}, Some(repository)) {
@html.menu("code", repository, Some(branch), pathList.isEmpty, groupNames.isEmpty, info, error){
<div class="head">
<div class="pull-right"><div class="btn-group">