harness-drone/template/amber/repo_activate.amber
2015-09-29 18:21:17 -07:00

33 lines
No EOL
1 KiB
Text

extends base
block append head
title #{Repo.Name}
block header
ol
li #{Repo.Owner} / #{Repo.Name}
block content
div.container.repo_activate
div.alert.alert-danger.hidden
div.alert.alert-info
| This repository is not yet activated.
button.btn.btn-info#activateRepo Activate Now
block append scripts
script
$( "#activateRepo" ).click(function() {
$( "#activateRepo" ).hide();
$.ajax({
type: "POST",
url: "/api/repos/#{Repo.FullName}",
success: function() {
window.location.href="/#{Repo.FullName}"
},
error: function(err) {
$(".alert-info").hide();
$(".alert-danger").text("Unable to activate this repository. You must have administrative access to this repository. Also, please check the third-party application access policy to ensure Drone is approved. "+ err.responseText).show();
}
});
});