diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index b9da12ee..529a456b 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -163,7 +163,7 @@ sub edit : Chained('jobsetChain') PathPart Args(0) { $c->stash->{template} = 'edit-jobset.tt'; $c->stash->{edit} = 1; - $c->stash->{clone} = defined $c->stash->{params}->{clone}; + $c->stash->{cloneJobset} = defined $c->stash->{params}->{cloneJobset}; $c->stash->{totalShares} = getTotalShares($c->model('DB')->schema); } @@ -269,7 +269,7 @@ sub clone : Chained('jobsetChain') PathPart('clone') Args(0) { requireProjectOwner($c, $c->stash->{project}); $c->stash->{template} = 'edit-jobset.tt'; - $c->stash->{clone} = 1; + $c->stash->{cloneJobset} = 1; $c->stash->{totalShares} = getTotalShares($c->model('DB')->schema); } diff --git a/src/lib/Hydra/Controller/JobsetEval.pm b/src/lib/Hydra/Controller/JobsetEval.pm index 65ae7fb0..c7ea4448 100644 --- a/src/lib/Hydra/Controller/JobsetEval.pm +++ b/src/lib/Hydra/Controller/JobsetEval.pm @@ -157,6 +157,17 @@ sub release : Chained('eval') PathPart('release') Args(0) { } +sub create_jobset : Chained('eval') PathPart('create-jobset') Args(0) { + my ($self, $c) = @_; + my $eval = $c->stash->{eval}; + + requireProjectOwner($c, $c->stash->{project}); + + $c->stash->{template} = 'edit-jobset.tt'; + $c->stash->{createFromEval} = 1; +} + + sub cancel : Chained('eval') PathPart('cancel') Args(0) { my ($self, $c) = @_; requireProjectOwner($c, $c->stash->{eval}->project); diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index 1fea107b..4cd577b1 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -113,7 +113,6 @@ sub create : Path('/create-project') { $c->stash->{template} = 'edit-project.tt'; $c->stash->{create} = 1; - $c->stash->{edit} = 1; } @@ -124,7 +123,6 @@ sub create_jobset : Chained('projectChain') PathPart('create-jobset') Args(0) { $c->stash->{template} = 'edit-jobset.tt'; $c->stash->{create} = 1; - $c->stash->{edit} = 1; $c->stash->{totalShares} = getTotalShares($c->model('DB')->schema); } diff --git a/src/root/edit-jobset.tt b/src/root/edit-jobset.tt index 0fc06abe..30b9a4c9 100644 --- a/src/root/edit-jobset.tt +++ b/src/root/edit-jobset.tt @@ -1,4 +1,8 @@ -[% WRAPPER layout.tt title=(create ? "Create jobset in project $project.name" : clone ? "Cloning jobset $project.name:$jobset.name" : "Editing jobset $project.name:$jobset.name") %] +[% WRAPPER layout.tt title= + (create ? "Creating jobset in project $project.name" : + createFromEval ? "Creating jobset from evaluation $eval.id of $project.name:$jobset.name" : + cloneJobset ? "Cloning jobset $project.name:$jobset.name" : + "Editing jobset $project.name:$jobset.name") %] [% PROCESS common.tt %] [% USE format %] @@ -11,16 +15,25 @@ input.name) %]/>