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BDW4ZJ3QC
ZI535LI6PJMKSOBJE33B3RRZ5S2JVTR3XPUDTSXJW6BZNTAHS3GQC
W6DC6K4INJQOJYR553ISCKZV7YIOGHEM3FZQPOLAPSZQ3KSJDMRQC
2P7VNAACFSXMH42JCXQZ7GDAAEIFDGDWJOK6XD6G36AGEYQSRO2AC
if ($c->req->looks_like_browser) {
$c->res->redirect($c->uri_for($self->action_for("project"), [$c->stash->{project}->name]) . "#tabs-configuration");
} else {
$self->status_no_content($c);
}
my $uri = $c->uri_for($self->action_for("project"), [$c->stash->{project}->name]) . "#tabs-configuration";
$self->status_ok($c, entity => { redirect => "$uri" });
if ($c->req->looks_like_browser) {
$c->res->redirect($uri . "#tabs-configuration");
} else {
$self->status_created(
$c,
location => "$uri",
entity => { name => $project->name, uri => "$uri", type => "project" }
);
}
$self->status_created($c,
location => "$uri",
entity => { name => $project->name, uri => "$uri", redirect => "$uri", type => "project" });
$c->stash->{template} = 'edit-project.tt';
$c->stash->{edit} = 1;
txn_do($c->model('DB')->schema, sub {
$c->stash->{project}->jobsetevals->delete_all;
$c->stash->{project}->builds->delete_all;
$c->stash->{project}->delete;
});
my $uri = $c->res->redirect($c->uri_for("/"));
$self->status_ok($c, entity => { redirect => "$uri" });
if (($c->request->params->{submit} // "") eq "delete") {
txn_do($c->model('DB')->schema, sub {
$c->stash->{project}->jobsetevals->delete_all;
$c->stash->{project}->builds->delete_all;
$c->stash->{project}->delete;
});
return $c->res->redirect($c->uri_for("/"));
}
$("#delete-project").click(function() {
return confirm("Are you sure you want to delete this project?");
$("#submit-project").click(function() {
requestJSON({
[% IF create %]
url: "[% c.uri_for('/project' '.new') %]",
[% ELSE %]
url: "[% c.uri_for('/project' project.name) %]",
[% END %]
data: $(this).parents("form").serialize(),
type: 'PUT',
success: function(data) {
window.location = data.redirect;
},
});
return false;
[% INCLUDE menuItem uri = c.uri_for('/project' project.name 'edit') title="Edit configuration" %]
<li><a href="[% c.uri_for('/project' project.name 'edit') %]"><i class="icon-edit icon-black"></i> Edit configuration</a></li>
<li><a href="javascript:deleteProject()"><i class="icon-trash icon-black"></i> Delete this project</a></li>
}
var requestJSON = function(args) {
args.dataType = 'json';
args.error = function(data) {
json = {};
try {
if (data.responseText)
json = $.parseJSON(data.responseText);
} catch (err) {
}
if (json.error)
bootbox.alert(json.error);
else if (data.responseText)
bootbox.alert("Server error: " + data.responseText);
else
bootbox.alert("Unknown server error!");
};
return $.ajax(args);
var redirectJSON = function(args) {
args.success = function(data) {
window.location = data.redirect;
};
return requestJSON(args);
}