2014-02-07 10:10:01 +00:00
|
|
|
{{ define "title" }}{{.Repo.Slug}} · {{ .Commit.HashShort }}{{ end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
|
|
|
|
<div class="subhead">
|
|
|
|
<div class="container">
|
|
|
|
<ul class="nav nav-tabs pull-right">
|
2014-03-14 18:34:43 +00:00
|
|
|
<li class="active"><a href="/{{.Repo.Slug}}/commit/{{ .Commit.Branch }}/{{ .Commit.Hash }}">{{ .Commit.HashShort }}</a></li>
|
2014-02-07 10:10:01 +00:00
|
|
|
<li><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 -->
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
<div class="alert alert-build-{{ .Build.Status }}">
|
2014-03-14 18:34:43 +00:00
|
|
|
<a href="/{{.Repo.Slug}}/{{.Commit.Branch}}/commit/{{ .Commit.Branch }}/{{ .Commit.Hash }}" class="btn btn-{{ .Build.Status }}"></a>
|
2014-02-07 10:10:01 +00:00
|
|
|
{{ if .Commit.PullRequest }}
|
|
|
|
<span>opened pull request <span># {{ .Commit.PullRequest }}</span></span>
|
|
|
|
{{ else }}
|
|
|
|
<span>commit <span>{{ .Commit.HashShort }}</span> to <span>{{.Commit.Branch}}</span> branch</span>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
<div class="build-details container affix-top" data-spy="affix" data-offset-top="248">
|
|
|
|
<div class="build-summary">
|
|
|
|
<dt>Status</dt>
|
|
|
|
<dd>{{.Build.Status}}</dd>
|
|
|
|
<dt>Started</dt>
|
|
|
|
<dd><span class="timeago" title="{{ .Build.StartedString }}"></span></dd>
|
|
|
|
<dt>Duration</dt>
|
|
|
|
<dd>{{ if .Build.IsRunning }}--{{else}}{{ .Build.HumanDuration }}{{end}}</dd>
|
|
|
|
</div>
|
2014-03-05 10:25:27 +00:00
|
|
|
<img src="{{.Commit.Image}}">
|
2014-02-07 10:10:01 +00:00
|
|
|
<div class="commit-summary">
|
|
|
|
<dt>Commit</dt>
|
|
|
|
<dd><u>{{ .Commit.HashShort }}</u></dd>
|
|
|
|
<dt>Committer</dt>
|
|
|
|
<dd>{{ .Commit.Author }}</dd>
|
|
|
|
<dt>Message</dt>
|
|
|
|
<dd>{{ .Commit.Message }}</dd>
|
|
|
|
</div>
|
|
|
|
</div>
|
2014-02-27 12:04:51 +00:00
|
|
|
<pre id="stdout"></pre>
|
|
|
|
<span id="follow">Follow</span>
|
2014-02-07 10:10:01 +00:00
|
|
|
</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>
|
2014-02-09 02:51:13 +00:00
|
|
|
|
2014-02-07 10:10:01 +00:00
|
|
|
<script>
|
|
|
|
{{ if .Build.IsRunning }}
|
2014-03-02 05:43:20 +00:00
|
|
|
$(document).ready(function() {
|
2014-03-02 07:08:30 +00:00
|
|
|
var commitUpdates = new Drone.CommitUpdates('/feed?token='+{{ .Token }});
|
2014-03-02 05:43:20 +00:00
|
|
|
var outputBox = document.getElementById('stdout');
|
|
|
|
commitUpdates.startOutput(outputBox);
|
2014-03-02 00:51:14 +00:00
|
|
|
|
2014-03-02 05:43:20 +00:00
|
|
|
$("#follow").on("click", function(e) {
|
|
|
|
e.preventDefault();
|
2014-03-02 00:51:14 +00:00
|
|
|
|
2014-03-02 05:43:20 +00:00
|
|
|
if(commitUpdates.autoFollow) {
|
|
|
|
commitUpdates.autoFollow = false;
|
|
|
|
$(this).text("Follow");
|
|
|
|
} else {
|
|
|
|
commitUpdates.autoFollow = true;
|
|
|
|
$(this).text("Stop following");
|
2014-03-02 00:51:14 +00:00
|
|
|
}
|
2014-03-02 05:43:20 +00:00
|
|
|
});
|
|
|
|
});
|
2014-03-02 00:51:14 +00:00
|
|
|
|
|
|
|
{{ else }}
|
2014-03-14 18:34:43 +00:00
|
|
|
$.get("/{{ .Repo.Slug }}/commit/{{ .Commit.Branch }}/{{ .Commit.Hash }}/build/{{ .Build.Slug }}/out.txt", function( data ) {
|
2014-03-02 05:43:20 +00:00
|
|
|
var lineFormatter = new Drone.LineFormatter();
|
|
|
|
$( "#stdout" ).html(lineFormatter.format(data));
|
2014-02-07 10:10:01 +00:00
|
|
|
});
|
|
|
|
{{ end }}
|
|
|
|
</script>
|
2014-03-02 05:43:20 +00:00
|
|
|
{{ end }}
|