mirror of
				https://github.com/gitbucket/gitbucket.git
				synced 2025-10-31 02:25:59 +01:00 
			
		
		
		
	Add branch switcher
This commit is contained in:
		| @@ -9,6 +9,15 @@ | ||||
| @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { | ||||
|   @html.menu("code", repository){ | ||||
|     <div class="head"> | ||||
|       @helper.html.dropdown( | ||||
|         value  = if(branch.length == 40) branch.substring(0, 10) else branch, | ||||
|         prefix = if(branch.length == 40) "tree" else if(repository.branchList.contains(branch)) "branch" else "tree", | ||||
|         mini   = true | ||||
|       ){ | ||||
|         @repository.branchList.map { x => | ||||
|           <li><a href="@url(repository)/blob/@encodeRefName(x)/@pathList.mkString("/")">@helper.html.checkicon(x == branch) @x</a></li> | ||||
|         } | ||||
|       } | ||||
|       <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / | ||||
|       @pathList.zipWithIndex.map { case (section, i) => | ||||
|         @if(i == pathList.length - 1){ | ||||
|   | ||||
| @@ -9,6 +9,15 @@ | ||||
| @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { | ||||
|   @html.menu("code", repository){ | ||||
|     <div class="head"> | ||||
|       @helper.html.dropdown( | ||||
|         value  = if(branch.length == 40) branch.substring(0, 10) else branch, | ||||
|         prefix = if(branch.length == 40) "tree" else if(repository.branchList.contains(branch)) "branch" else "tree", | ||||
|         mini   = true | ||||
|       ){ | ||||
|         @repository.branchList.map { x => | ||||
|           <li><a href="@url(repository)/commits/@encodeRefName(branch)">@helper.html.checkicon(x == branch) @x</a></li> | ||||
|         } | ||||
|       } | ||||
|       @if(pathList.isEmpty){ | ||||
|         <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / Commit History | ||||
|       } | ||||
|   | ||||
| @@ -10,6 +10,15 @@ | ||||
| @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { | ||||
|   @html.menu("code", repository, Some(branch), pathList.isEmpty){ | ||||
|     <div class="head"> | ||||
|       @helper.html.dropdown( | ||||
|         value  = if(branch.length == 40) branch.substring(0, 10) else branch, | ||||
|         prefix = if(branch.length == 40) "tree" else if(repository.branchList.contains(branch)) "branch" else "tree", | ||||
|         mini   = true | ||||
|       ){ | ||||
|         @repository.branchList.map { x => | ||||
|           <li><a href="@url(repository)/tree/@encodeRefName(branch)">@helper.html.checkicon(x == branch) @x</a></li> | ||||
|         } | ||||
|       } | ||||
|       <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / | ||||
|       @pathList.zipWithIndex.map { case (section, i) => | ||||
|         <a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / | ||||
|   | ||||
| @@ -67,8 +67,8 @@ div.input-prepend span.count { | ||||
| /* General Styles */ | ||||
| /* ======================================================================== */ | ||||
| div.head { | ||||
|   font-size: large; | ||||
|   margin-bottom: 10px; | ||||
|   font-weight: bold; | ||||
| } | ||||
|  | ||||
| div.head div.forked { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user