aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-16 23:43:22 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-16 23:43:22 -0400
commit685631627e5c4db881160bfc9b39dc45143989f6 (patch)
tree632f287752a9d678e3dfcbc49c0b75ccf4ad4f71 /templates
parent7015c3d4912bbe053786819b71539720f96e4a39 (diff)
downloadgitea-685631627e5c4db881160bfc9b39dc45143989f6.tar.gz
gitea-685631627e5c4db881160bfc9b39dc45143989f6.zip
Show branches in repo viewer
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/single.tmpl18
1 files changed, 10 insertions, 8 deletions
diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl
index b5207d0820..e1fb05bd03 100644
--- a/templates/repo/single.tmpl
+++ b/templates/repo/single.tmpl
@@ -5,21 +5,23 @@
<div id="gogs-body" class="container">
<div id="gogs-source">
<div class="source-toolbar">
+ {{ $username := .Username}}
+ {{ $reponame := .Reponame}}
+ {{ $branchname := .Branchname}}
+ {{ $treenames := .Treenames}}
+ {{ $repoLink := .RepositoryLink}}
+ {{ $n := len $treenames}}
<button class="btn btn-default pull-right"><i class="fa fa-plus-square"></i>Add File</button>
<div class="dropdown branch-switch">
- <a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>master&nbsp;&nbsp;
+ <a href="#" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><i class="fa fa-chain"></i>{{$branchname}}&nbsp;&nbsp;
<b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a class="current" href="/{{.RepositoryLink}}/tree/master">master</a></li>
- <li><a href="/{{.RepositoryLink}}/tree/develop">develop</a></li>
+ {{range .Branches}}
+ <li><a {{if eq . $branchname}}class="current" {{end}}href="/{{$repoLink}}/tree/{{.}}">{{.}}</a></li>
+ {{end}}
</ul>
</div>
{{$paths := .Paths}}
- {{ $username := .Username}}
- {{ $reponame := .Reponame}}
- {{ $branchname := .Branchname}}
- {{ $treenames := .Treenames}}
- {{ $n := len $treenames}}
{{ $l := Subtract $n 1}}
<ol class="breadcrumb">
<li class="root dir"><a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}">{{.Repository.Name}}</a></li>