harness-drone/server/template/repo_commit.amber

72 lines
1.9 KiB
Text
Raw Normal View History

2014-06-04 21:25:38 +00:00
extends base
block title
| #{Repo.Name} · #{Commit.Sha}
block content
article.pure-g
header.pure-u-1
h1
span #{Repo.Owner}
span /
a[href="/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name] #{Repo.Name}
2014-06-04 21:25:38 +00:00
span /
a[href="#"] #{Commit.ShaShort}
a.pure-button[href="/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name]
2014-06-04 21:25:38 +00:00
i.fa.fa-dashboard
section.pure-u-3-4
div.alert[data-status=Commit.Status]
| commit
u #{Commit.ShaShort}
| to
u #{Commit.Branch}
| branch
div.progress
pre#stdout[data-status=Commit.Status]
div.pure-u-1-4.sticky
section.pure-g.build
div.pure-u-1
img[src="//secure.gravatar.com/avatar/" +Commit.Gravatar+"?s=64&d=identicon"][style="border-radius:50%;float:left;margin-right:10px;"]
header
h3 #{Commit.ShaShort}
h4 #{Commit.Branch}
div
span finished:
span.timeago[title=Commit.FinishedString]
div
span duration:
span #{Commit.Duration} seconds
div
span message:
p #{Commit.Message}
block append scripts
script
$(document).ready(function() {
$(".timeago").timeago();
});
if Commit.Status == "Started" || Commit.Status == "Pending"
script
var ws = new WebSocket((window.location.protocol=='http:'?'ws':'wss')+'://'+window.location.host+'/feed?token=#{Channel}');
ws.onmessage = function (e) {
console.log(e);
};
2014-06-04 21:25:38 +00:00
script
$(document).ready(function() {
var commitUpdates = new Drone.CommitUpdates('/feed?token=#{Stream}');
2014-06-04 21:25:38 +00:00
var outputBox = document.getElementById('stdout');
commitUpdates.autoFollow = true;
2014-06-04 21:25:38 +00:00
commitUpdates.startOutput(outputBox);
});
else
script
$.get("/v1/repos/"+#{Repo.Host}+"/"+#{Repo.Owner}+"/"+#{Repo.Name}+"/branches/"+#{Commit.Branch}+"/commits/"+#{Commit.Sha}+"/console", function( data ) {
2014-06-04 21:25:38 +00:00
var lineFormatter = new Drone.LineFormatter();
$( "#stdout" ).html(lineFormatter.format(data));
});