woodpecker/pkg/template/pages/repo_dashboard.html
2014-04-06 15:03:51 -07:00

81 lines
2.5 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}}?branch={{.Branch}}" class="btn btn-{{.Status}}"></a>
<h3>
<a href="/{{$repo.Slug}}/commit/{{.Hash}}?branch={{.Branch}}">{{.HashShort}}</a>
<small class="timeago" title="{{.CreatedString}}"></small>
{{ if .PullRequest }}
<p>opened pull request <a href="/{{$repo.Slug}}/commit/{{.Hash}}?branch={{.Branch}}"># {{.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 }}