Turn hiding/unhiding a jobset into a checkbox

[?]
Feb 21, 2013, 1:36 AM
PVIRRARJJC2Z3PYC6XPHJUZPT5IS4IKXUUDGMXXV57PFVVFCUUMAC

Dependencies

  • [2] TNMOG2ZQ Indentation
  • [3] OX6NYJDV Split viewing and editing a jobset
  • [4] UMFB2767 Hydra/64: Leaving number of builds empty gives DBIx error
  • [5] I4K2UPCW Tweaks
  • [6] QTFVCDIF added hide feature for project/jobset
  • [7] 7ZQAHJQM Fix indentation
  • [8] OEPUOUNB Using twitter bootstrap for more consistent looks for Hydra
  • [9] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [10] LZO3C2KI * Hack around those SQLite timeouts: just retry the transaction.
  • [11] TLJC6BJ3 Add a menu item for deleting jobsets
  • [*] 3HZY24CX * Make jobsets viewable under
  • [*] VS3OUK7D if no emailoverride specified, use empty string
  • [*] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website

Change contents

  • edit in src/lib/Hydra/Controller/Jobset.pm at line 136
    [4.2][4.2:77]()
    sub hide : Chained('jobset') PathPart Args(0) {
    my ($self, $c) = @_;
  • edit in src/lib/Hydra/Controller/Jobset.pm at line 137
    [4.78][4.78:129]()
    requireProjectOwner($c, $c->stash->{project});
  • edit in src/lib/Hydra/Controller/Jobset.pm at line 138
    [4.19][4.134:252](),[4.134][4.134:252](),[4.252][4.20:21](),[4.21][4.257:378](),[4.257][4.257:378](),[4.378][4.1093:1096](),[4.1093][4.1093:1096](),[4.1096][2.134:135](),[2.135][4.379:454](),[4.1096][4.379:454](),[4.454][4.1096:1097](),[4.1096][4.1096:1097](),[4.1097][4.455:506](),[4.506][4.22:23](),[4.23][4.511:615](),[4.511][4.511:615](),[4.615][4.24:25](),[4.25][4.620:744](),[4.620][4.620:744](),[4.744][2.136:137]()
    txn_do($c->model('DB')->schema, sub {
    $c->stash->{jobset}->update({ hidden => 1, enabled => 0 });
    });
    $c->res->redirect($c->uri_for($c->controller('Project')->action_for("view"),
    [$c->stash->{project}->name]));
    }
    sub unhide : Chained('jobset') PathPart Args(0) {
    my ($self, $c) = @_;
    requireProjectOwner($c, $c->stash->{project});
    txn_do($c->model('DB')->schema, sub {
    $c->stash->{jobset}->update({ hidden => 0 });
    });
    $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 213
    [14.76]
    [4.122]
    , hidden => defined $c->request->params->{visible} ? 0 : 1
  • edit in src/root/edit-jobset.tt at line 56
    [3.2728]
    [3.2728]
    <div class="controls">
    <label class="checkbox">
    <input type="checkbox" name="visible" [% IF !jobset.hidden; 'checked="checked"'; END %]></input>Visible
    </label>
    </div>
  • edit in src/root/topbar.tt at line 97
    [4.6934][4.1602:1888](),[4.1602][4.1602:1888]()
    [% IF jobset.hidden %]
    [% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'unhide') title = "Unhide" %]
    [% ELSE %]
    [% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'hide') title = "Hide" %]
    [% END %]