summaryrefslogtreecommitdiffstats
path: root/templates/repo/single.tmpl
blob: ed04be0779220b61b0156b08e8a096d6717744c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{{template "base/head" .}}
{{template "base/navbar" .}}
{{template "repo/nav" .}}
{{template "repo/toolbar" .}}
<div id="body" class="container">
    <div id="source">
        {{if .IsBareRepo}}
        {{template "repo/single_bare" .}}
        {{else}}
        <div class="source-toolbar">
            {{ $n := len .Treenames}}
            {{if not .IsFile}}<button class="btn btn-default pull-right hidden"><i class="fa fa-plus-square"></i>Add File</button>{{end}}
            <div class="dropdown branch-switch">
                <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">
                    {{range .Branches}}
                    <li><a {{if eq . $.Branchname}}class="current" {{end}}href="/{{$.Username}}/{{$.Reponame}}/src/{{.}}">{{.}}</a></li>
                    {{end}}
                </ul>
            </div>
            {{ $l := Subtract $n 1}}
            <ol class="breadcrumb">
                <li class="root dir">
                    <a href="{{.BranchLink}}">{{.Repository.Name}}</a></li>
                {{range $i, $v := .Treenames}}
                <li class="dir">
                    {{if eq $i $l}}{{$v}}
                    {{else}}
                    <a href="{{$.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a>&nbsp;
                    {{end}}
                </li>
                {{end}}
            </ol>
        </div>
        {{if .IsFile}}
            {{template "repo/single_file" .}}
        {{else}}
            {{template "repo/single_list" .}}
        {{end}}
        {{end}}
    </div>
</div>
{{template "base/footer" .}}