woodpecker/server/template/repo_commit.amber

72 lines
1.9 KiB
Plaintext

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}
span /
a[href="#"] #{Commit.ShaShort}
a.pure-button[href="/"+Repo.Host+"/"+Repo.Owner+"/"+Repo.Name]
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);
};
script
$(document).ready(function() {
var commitUpdates = new Drone.CommitUpdates('/feed?token=#{Stream}');
var outputBox = document.getElementById('stdout');
commitUpdates.autoFollow = true;
commitUpdates.startOutput(outputBox);
});
else
script
$.get("/v1/repos/"+#{Repo.Host}+"/"+#{Repo.Owner}+"/"+#{Repo.Name}+"/branches/"+#{Commit.Branch}+"/commits/"+#{Commit.Sha}+"/console", function( data ) {
var lineFormatter = new Drone.LineFormatter();
$( "#stdout" ).html(lineFormatter.format(data));
});