mirror of
				https://github.com/gitbucket/gitbucket.git
				synced 2025-10-31 10:36:05 +01:00 
			
		
		
		
	Add branch switcher
This commit is contained in:
		| @@ -9,6 +9,15 @@ | |||||||
| @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { | @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { | ||||||
|   @html.menu("code", repository){ |   @html.menu("code", repository){ | ||||||
|     <div class="head"> |     <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> / |       <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / | ||||||
|       @pathList.zipWithIndex.map { case (section, i) => |       @pathList.zipWithIndex.map { case (section, i) => | ||||||
|         @if(i == pathList.length - 1){ |         @if(i == pathList.length - 1){ | ||||||
|   | |||||||
| @@ -9,6 +9,15 @@ | |||||||
| @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { | @html.main(s"${repository.owner}/${repository.name}", Some(repository)) { | ||||||
|   @html.menu("code", repository){ |   @html.menu("code", repository){ | ||||||
|     <div class="head"> |     <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){ |       @if(pathList.isEmpty){ | ||||||
|         <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / Commit History |         <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.main(s"${repository.owner}/${repository.name}", Some(repository)) { | ||||||
|   @html.menu("code", repository, Some(branch), pathList.isEmpty){ |   @html.menu("code", repository, Some(branch), pathList.isEmpty){ | ||||||
|     <div class="head"> |     <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> / |       <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / | ||||||
|       @pathList.zipWithIndex.map { case (section, i) => |       @pathList.zipWithIndex.map { case (section, i) => | ||||||
|         <a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / |         <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 */ | /* General Styles */ | ||||||
| /* ======================================================================== */ | /* ======================================================================== */ | ||||||
| div.head { | div.head { | ||||||
|   font-size: large; |  | ||||||
|   margin-bottom: 10px; |   margin-bottom: 10px; | ||||||
|  |   font-weight: bold; | ||||||
| } | } | ||||||
|  |  | ||||||
| div.head div.forked { | div.head div.forked { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user