Add path and branch name to the page title

This commit is contained in:
moccos
2016-01-03 04:01:24 +09:00
parent 8191a4bedb
commit e8f6d2b990
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 == "master"){
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">