This commit is contained in:
Eelco Dolstra 2008-11-13 18:16:57 +00:00
parent 77e1bb7527
commit 83d6ad7aa2
3 changed files with 30 additions and 5 deletions

View file

@ -126,7 +126,7 @@ sub project :Local {
$c->model('DB')->schema->txn_do(sub { $c->model('DB')->schema->txn_do(sub {
updateProject($c, $project); updateProject($c, $project);
}); });
return $c->res->redirect($c->uri_for("/project", $projectName)); return $c->res->redirect($c->uri_for("/project", $c->request->params->{name}));
} elsif ($subcommand eq "delete" && $isPosted) { } elsif ($subcommand eq "delete" && $isPosted) {
$c->model('DB')->schema->txn_do(sub { $c->model('DB')->schema->txn_do(sub {
$project->delete; $project->delete;

View file

@ -13,15 +13,21 @@
[% BLOCK renderJobset %] [% BLOCK renderJobset %]
<div class="indent jobset"> <div class="jobset">
<h3>Jobset <tt>[% INCLUDE maybeEditString param="jobset-$baseName-name" value=jobset.name %]</tt></h3> <h3>[% IF jobset %]Jobset <tt>[% jobset.name %]</tt>[% ELSE %]New jobset[% END %]</h3>
<div class="indent"> <div class="indent">
<h4>Information</h4> <h4>Information</h4>
<table> <table>
[% IF edit %]
<tr>
<th>Identifier:</th>
<td>[% INCLUDE maybeEditString param="jobset-$baseName-name" value=jobset.name %]</td>
</tr>
[% END %]
<tr> <tr>
<th>Description:</th> <th>Description:</th>
<td>[% INCLUDE maybeEditString param="jobset-$baseName-description" value=jobset.description %]</td> <td>[% INCLUDE maybeEditString param="jobset-$baseName-description" value=jobset.description %]</td>
@ -137,7 +143,7 @@
$("#add-jobset").click(function() { $("#add-jobset").click(function() {
var newid = "jobset-" + id++; var newid = "jobset-" + id++;
$("#jobset-template").clone(true).attr("id", newid).insertAfter($("#jobset-template")).show(); $("#jobset-template").clone(true).attr("id", newid).insertAfter($("#jobset-template")).show();
$("#jobset-template-name", $("#" + newid)).attr("name", newid + "-name").attr("value", newid); $("#jobset-template-name", $("#" + newid)).attr("name", newid + "-name").attr("value", "trunk");
$("#jobset-template-description", $("#" + newid)).attr("name", newid + "-description"); $("#jobset-template-description", $("#" + newid)).attr("name", newid + "-description");
$("#jobset-template-nixexprpath", $("#" + newid)).attr("name", newid + "-nixexprpath"); $("#jobset-template-nixexprpath", $("#" + newid)).attr("name", newid + "-nixexprpath");
$("#jobset-template-nixexprinput", $("#" + newid)).attr("name", newid + "-nixexprinput"); $("#jobset-template-nixexprinput", $("#" + newid)).attr("name", newid + "-nixexprinput");

View file

@ -155,6 +155,16 @@ create table Projects (
); );
create trigger cascadeProjectUpdate
update of name on Projects
for each row begin
update Jobsets set project = new.name where project = old.name;
update JobsetInputs set project = new.name where project = old.name;
update JobsetInputAlts set project = new.name where project = old.name;
update Builds set project = new.name where project = old.name;
end;
-- A jobset consists of a set of inputs (e.g. SVN repositories), one -- A jobset consists of a set of inputs (e.g. SVN repositories), one
-- of which contains a Nix expression containing an attribute set -- of which contains a Nix expression containing an attribute set
-- describing build jobs. -- describing build jobs.
@ -170,6 +180,15 @@ create table Jobsets (
); );
create trigger cascadeJobsetUpdate
update of name on jobsets
for each row begin
update JobsetInputs set jobset = new.name where jobset = old.name;
update JobsetInputAlts set jobset = new.name where jobset = old.name;
update Builds set jobset = new.name where jobset = old.name;
end;
create table JobsetInputs ( create table JobsetInputs (
project text not null, project text not null,
jobset text not null, jobset text not null,