woodpecker/pkg/template/pages/repo_dashboard.html
Brad Rydzewski 7d52a4c4df Revert "query and show commits by branch"
This reverts commit 2d837cc3db.
2014-03-16 23:08:53 -07:00

81 lines
2.4 KiB
HTML

{{ define "title" }}{{.Repo.Slug}} · Dashboard{{ end }}
{{ define "content" }}
<div class="subhead">
<div class="container">
<ul class="nav nav-tabs pull-right">
<li class="active"><a href="/{{.Repo.Slug}}">Commits</a></li>
<li><a href="/{{.Repo.Slug}}/settings">Settings</a></li>
</ul> <!-- ./nav -->
<h1>
<span>{{.Repo.Name}}</span>
<small>{{.Repo.Owner}}</small>
</h1>
</div><!-- ./container -->
</div><!-- ./subhead -->
{{ $repo := .Repo }}
{{ $branch := .Branch }}
<div class="container">
<div class="row">
<div class="col-xs-8" role="main">
<a class="btn btn-refresh hide" href="/{{.Repo.Slug}}/tree?branch={{.Branch}}">
<i class="fa fa-rotate-right"></i>
<span>0 new</span>
</a>
{{ if .Commits }}
<ul class="commit-list commit-list-alt">
{{ range .Commits }}
<li>
<a href="/{{$repo.Slug}}/commit/{{.Hash}}" class="btn btn-{{.Status}}"></a>
<h3>
<a href="/{{$repo.Slug}}/commit/{{.Hash}}">{{.HashShort}}</a>
<small class="timeago" title="{{.CreatedString}}"></small>
{{ if .PullRequest }}
<p>opened pull request <a href="/{{$repo.Slug}}/commit/{{.Hash}}"># {{.PullRequest}}</a></p>
{{ else }}
<p>{{.Message}} &nbsp;</p>
{{ end }}
</h3>
<img src="{{.Image}}" />
</li>
{{ end }}
</ul>
{{ end }}
</div><!-- ./col-xs-8 -->
<div class="col-xs-4" style="padding-left:20px;">
<ul class="nav nav-pills nav-stacked nav-branches">
{{ range .Branches }}
<li{{ if eq $branch .Branch }} class="active"{{end}}>
<a href="/{{ $repo.Slug }}/tree?branch={{.Branch}}">
<span class="btn btn-mini btn-{{.Status}} "></span>
<span>{{.Branch}}</span>
</a>
<li>
{{ end }}
</ul>
</div><!-- ./col-xs-4 -->
</div><!-- ./row -->
</div><!-- ./container -->
{{ end }}
{{ define "script" }}
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.1.0/jquery.timeago.js"></script>
<script>
$(document).ready(function() {
$(".timeago").timeago();
});
</script>
<script>
var updates = 0;
var ws = new WebSocket((window.location.protocol=='http:'?'ws':'wss')+'://'+window.location.host+'/feed?token='+{{ .Token}});
ws.onmessage = function (e) {
updates = updates+1;
$(".btn-refresh span").text(updates + " new")
$(".btn-refresh").show().removeClass("hide");
};
</script>
{{ end }}