woodpecker/pkg/template/pages/repo_dashboard.html

82 lines
2.5 KiB
HTML
Raw Normal View History

2014-02-07 10:10:01 +00:00
{{ 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}}">
2014-02-07 10:10:01 +00:00
<i class="fa fa-rotate-right"></i>
<span>0 new</span>
</a>
{{ if .Commits }}
<ul class="commit-list commit-list-alt">
{{ range .Commits }}
<li>
2014-04-06 22:03:51 +00:00
<a href="/{{$repo.Slug}}/commit/{{.Hash}}?branch={{.Branch}}" class="btn btn-{{.Status}}"></a>
2014-02-07 10:10:01 +00:00
<h3>
2014-04-06 22:03:51 +00:00
<a href="/{{$repo.Slug}}/commit/{{.Hash}}?branch={{.Branch}}">{{.HashShort}}</a>
2014-02-07 10:10:01 +00:00
<small class="timeago" title="{{.CreatedString}}"></small>
{{ if .PullRequest }}
2014-04-06 22:03:51 +00:00
<p>opened pull request <a href="/{{$repo.Slug}}/commit/{{.Hash}}?branch={{.Branch}}"># {{.PullRequest}}</a></p>
2014-02-07 10:10:01 +00:00
{{ 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}}>
2014-02-12 19:22:56 +00:00
<a href="/{{ $repo.Slug }}/tree?branch={{.Branch}}">
2014-02-07 10:10:01 +00:00
<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 }}