diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-14 23:54:16 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-14 23:54:16 +0800 |
commit | b27e8e87f8be2d11468e9057254b6c8933e0af33 (patch) | |
tree | bbfb32d7e248ae6f2ec63164722523d96447848a /templates/repo/single.tmpl | |
parent | 607303e4dee3ddf9ba3d9d67b0186fc5213b167b (diff) | |
parent | d18237850c6a4ae855b3f8592994c91462fcdb0a (diff) | |
download | gitea-b27e8e87f8be2d11468e9057254b6c8933e0af33.tar.gz gitea-b27e8e87f8be2d11468e9057254b6c8933e0af33.zip |
add tree view
Diffstat (limited to 'templates/repo/single.tmpl')
-rw-r--r-- | templates/repo/single.tmpl | 59 |
1 files changed, 53 insertions, 6 deletions
diff --git a/templates/repo/single.tmpl b/templates/repo/single.tmpl index c83fcd93cd..292f8cbddd 100644 --- a/templates/repo/single.tmpl +++ b/templates/repo/single.tmpl @@ -3,11 +3,58 @@ {{template "repo/nav" .}} {{template "repo/toolbar" .}} <div id="gogs-body" class="container"> - <h4>Source Files:</h4> - <ul> - {{range .Files}} - <li>{{.Name}} - {{.Id}} - {{.Message}} - {{.Created}} - {{.IsFile}} - {{.IsDir}}</li> - {{end}} - </ul> + <div id="gogs-source"> + <div id="gogs-source-toolbar"> + <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 + <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a class="current" href="/{{.RepositoryLink}}/branch/master">master</a></li> + <li><a href="//{{.RepositoryLink}}/branch/develop">develop</a></li> + </ul> + </div> + <ol class="breadcrumb"> + <li class="root dir">{{.Repository.Name}}</li> + {{$paths := .Paths}} + {{ $username := .Username}} + {{ $reponame := .Reponame}} + {{ $branchname := .Branchname}} + {{ $treenames := .Treenames}} + {{ $n := len $treenames}} + {{ $l := Subtract $n 1}} + {{range $i, $v := $treenames}} + <li class="dir"> + {{if eq $i $l}}{{$v}} + {{else}} + <a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{index $paths $i}}">{{$v}}</a> + {{end}}</li> + {{end}} + </ol> + </div> + <table id="gogs-source-table" class="table table-hover"> + <thead class="hidden"> + <tr> + <th class="name">Filename</th> + <th class="date">Date modified</th> + <th class="text">Message</th> + </tr> + </thead> + <tbody> + {{range .Files}} + <tr {{if .IsDir}}class="is-dir"{{end}}> + <td class="name"><i class="fa {{if .IsDir}}fa-folder{{else}}fa-file{{end}}"></i> + {{if .IsDir}} + <a href="/{{$username}}/{{$reponame}}/tree/{{$branchname}}/{{.Path}}">{{.Name}}</a> + {{else}} + <a href="#">{{.Name}}</a> + {{end}}</td> + <td class="date"><time datetime="{{.Created}}" data-title="true" title="{{.Created}}">{{TimeSince .Created}}</time></td> + <td class="text">{{.Message}}</td> + </tr> + {{end}} + </tbody> + </table> + </div> </div> {{template "base/footer" .}}
\ No newline at end of file |