Make jobset deletion consistent with project deletion

[?]
Feb 26, 2013, 4:36 PM
ZRRPBEI4ZSISCMWV62JGB35QNRJVA7SZUR4F52WTQRECCG2GCEAQC

Dependencies

  • [2] TNMOG2ZQ Indentation
  • [3] OX6NYJDV Split viewing and editing a jobset
  • [4] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [5] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate
  • [6] LZO3C2KI * Hack around those SQLite timeouts: just retry the transaction.
  • [7] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [8] UMFB2767 Hydra/64: Leaving number of builds empty gives DBIx error
  • [9] 3PNG7NIB Remove trailing whitespace
  • [10] 7ZQAHJQM Fix indentation
  • [11] JARRBLZD Bootstrapify the Hydra forms (except the project and jobset edit pages)
  • [12] QTFVCDIF added hide feature for project/jobset
  • [13] OEPUOUNB Using twitter bootstrap for more consistent looks for Hydra
  • [14] TLJC6BJ3 Add a menu item for deleting jobsets
  • [15] PVIRRARJ Turn hiding/unhiding a jobset into a checkbox
  • [16] YG6VGK4F "Evaluate" command: push the jobset to the front of the eval queue
  • [17] I4K2UPCW Tweaks
  • [*] 3HZY24CX * Make jobsets viewable under
  • [*] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website

Change contents

  • edit in src/lib/Hydra/Controller/Jobset.pm at line 133
    [4.861]
    [4.16]
    if (($c->request->params->{submit} // "") eq "delete") {
    $c->stash->{jobset}->delete;
    return $c->res->redirect($c->uri_for($c->controller('Project')->action_for("view"), [$c->stash->{project}->name]));
    }
  • edit in src/lib/Hydra/Controller/Jobset.pm at line 145
    [4.1093][4.0:2](),[4.77][4.77:78](),[4.129][4.18:19](),[2.137][4.1097:1245](),[4.744][4.1097:1245](),[4.1097][4.1097:1245](),[4.1245][4.26:27](),[4.27][4.172:214](),[4.1250][4.172:214](),[4.214][4.1292:1337](),[4.1292][4.1292:1337](),[4.1337][4.28:29](),[4.29][4.1342:1463](),[4.1342][4.1342:1463]()
    }
    sub delete : Chained('jobset') PathPart Args(0) {
    my ($self, $c) = @_;
    requireProjectOwner($c, $c->stash->{project});
    requirePost($c);
    txn_do($c->model('DB')->schema, sub {
    $c->stash->{jobset}->delete;
    });
    $c->res->redirect($c->uri_for($c->controller('Project')->action_for("view"),
    [$c->stash->{project}->name]));
  • replacement in src/lib/Hydra/Controller/Project.pm at line 48
    [4.2217][4.641:702](),[4.2361][4.641:702]()
    if (($c->request->params->{submit} || "") eq "delete") {
    [4.2217]
    [4.702]
    if (($c->request->params->{submit} // "") eq "delete") {
  • replacement in src/lib/Hydra/Controller/Project.pm at line 50
    [4.740][4.740:785]()
    $c->res->redirect($c->uri_for("/"));
    [4.740]
    [4.785]
    return $c->res->redirect($c->uri_for("/"));
  • edit in src/root/edit-jobset.tt at line 112
    [3.4659]
    [3.4659]
    [% IF !create %]
    <button id="delete-jobset" type="submit" class="btn btn-danger" name="submit" value="delete">
    <i class="icon-trash icon-white"></i>
    Delete this jobset
    </button>
    <script type="text/javascript">
    $("#delete-jobset").click(function() {
    return confirm("Are you sure you want to delete this jobset?");
    });
    </script>
    [% END %]
  • edit in src/root/topbar.tt at line 85
    [4.427][4.6049:6553](),[4.6049][4.6049:6553]()
    <form id="delete-jobset" method="post" action="[% c.uri_for('/jobset' project.name jobset.name 'delete') %]" class="hidden"></form>
    <script>
    function confirmDeleteJobset() {
    bootbox.confirm(
    'Are you sure you want to delete this jobset?',
    function(del) { if (del) $('#delete-jobset').submit(); });
    return;
    };
    </script>
    [% INCLUDE menuItem title="Delete" uri = "javascript:confirmDeleteJobset()" %]