Make the hide/unhide actions a checkbox in the project settings
[?]
Feb 21, 2013, 12:45 AM
A6XVP6FE3CO7BVZR23HQS2GFDNF3FK7KBDSOB4YIPRISZHEWQJKACDependencies
- [2]
I4K2UPCWTweaks - [3]
UWVMQIAC* Refactoring. - [4]
FPK5LF53* Put the project-related actions in a separate controller. Put the - [5]
JARRBLZDBootstrapify the Hydra forms (except the project and jobset edit pages) - [6]
7ZQAHJQMFix indentation - [7]
7UJ5YV4V* Provide a channel for each project containing all the latest - [8]
TLJC6BJ3Add a menu item for deleting jobsets - [9]
OEPUOUNBUsing twitter bootstrap for more consistent looks for Hydra - [10]
3PNG7NIBRemove trailing whitespace - [11]
ODNCGFQ5* Improved the navigation bar: don't include all projects (since that - [12]
BHJ62LYE* Allow authorised users to create projects. - [13]
QTFVCDIFadded hide feature for project/jobset - [14]
LZO3C2KI* Hack around those SQLite timeouts: just retry the transaction. - [15]
JY7BXXOPSplit viewing and editing a project - [*]
QL55ECJ6- adapted ui for hydra, more in line with nixos.org website
Change contents
- edit in src/lib/Hydra/Controller/Project.pm at line 61
sub hide : Chained('project') PathPart Args(0) {my ($self, $c) = @_; - edit in src/lib/Hydra/Controller/Project.pm at line 62
requireProjectOwner($c, $c->stash->{project}); - edit in src/lib/Hydra/Controller/Project.pm at line 63[3.2221]→[3.1019:1138](∅→∅),[3.1019]→[3.1019:1138](∅→∅),[3.1138]→[3.2222:2223](∅→∅),[3.2223]→[3.1143:1184](∅→∅),[3.1143]→[3.1143:1184](∅→∅),[3.1184]→[3.2550:2552](∅→∅),[3.4746]→[3.2550:2552](∅→∅),[3.2550]→[3.2550:2552](∅→∅),[3.2552]→[3.793:794](∅→∅),[3.794]→[3.2552:2553](∅→∅),[3.2552]→[3.2552:2553](∅→∅),[3.2553]→[3.1185:1261](∅→∅),[3.1261]→[3.2553:2554](∅→∅),[3.2553]→[3.2553:2554](∅→∅),[3.2554]→[3.1262:1313](∅→∅),[3.1313]→[3.2224:2225](∅→∅),[3.2225]→[3.1318:1415](∅→∅),[3.1318]→[3.1318:1415](∅→∅),[3.974]→[3.2849:2857](∅→∅),[3.2849]→[3.2849:2857](∅→∅),[3.2857]→[3.2226:2227](∅→∅),[3.2227]→[3.2862:2903](∅→∅),[3.2862]→[3.2862:2903](∅→∅),[3.2903]→[3.0:4](∅→∅)
txn_do($c->model('DB')->schema, sub {$c->stash->{project}->update({ hidden => 1, enabled => 0 });});$c->res->redirect($c->uri_for("/"));}sub unhide : Chained('project') PathPart Args(0) {my ($self, $c) = @_;requireProjectOwner($c, $c->stash->{project});txn_do($c->model('DB')->schema, sub {$c->stash->{project}->update({ hidden => 0 });});$c->res->redirect($c->uri_for("/"));} - replacement in src/lib/Hydra/Controller/Project.pm at line 164
, enabled => trim($c->request->params->{enabled}) eq "1" ? 1 : 0, enabled => defined $c->request->params->{enabled} ? 1 : 0, hidden => defined $c->request->params->{visible} ? 0 : 1 - edit in src/root/edit-project.tt at line 3
<form class="form-horizontal" action="[% IF create %][% c.uri_for('/create-project/submit') %][% ELSE %][% c.uri_for('/project' project.name 'submit') %][% END %]" method="post"><fieldset> - replacement in src/root/edit-project.tt at line 8
<form action="[% IF create %][% c.uri_for('/create-project/submit') %][% ELSE %][% c.uri_for('/project' project.name 'submit') %][% END %]" method="post"><div class="control-group"><div class="controls"><label class="checkbox"><input type="checkbox" name="enabled" value="enabled" [% IF project.enabled; 'checked="checked"'; END %]></input>Enabled</label></div><div class="controls"><label class="checkbox"><input type="checkbox" name="visible" value="visible" [% IF !project.hidden; 'checked="checked"'; END %]></input>Visible in the list of projects</label></div></div> - replacement in src/root/edit-project.tt at line 21
<table class="layoutTable"><tr><th>Identifier:</th><td><tt>[% INCLUDE editString param="name" value=project.name %]</tt></td></tr><tr><th>Display name:</th><td>[% INCLUDE editString param="displayname" value=project.displayname %]</td></tr><tr><th>Description:</th><td>[% INCLUDE editString param="description" value=project.description %]</td></tr><tr><th>Homepage:</th><td>[% INCLUDE editString param="homepage" value=project.homepage %]</td></tr><tr><th>Owner:</th><td><tt>[% INCLUDE editString param="owner" value=(project.owner.username || c.user.username) %]</tt></td></tr><tr><th>Enabled:</th><td>[% INCLUDE renderSelection param="enabled" curValue=project.enabled radiobuttons=1 options={"1" = "Yes", "0" = "No"} %]</td></tr></table><div class="control-group"><label class="control-label">Identifier</label><div class="controls"><input type="text" class="span3" name="name" [% HTML.attributes(value => project.name) %]></input></div></div><div class="control-group"><label class="control-label">Display name</label><div class="controls"><input type="text" class="span3" name="displayname" [% HTML.attributes(value => project.displayname) %]></input></div></div><div class="control-group"><label class="control-label">Description</label><div class="controls"><input type="text" class="span3" name="description" [% HTML.attributes(value => project.description) %]></input></div></div><div class="control-group"><label class="control-label">Homepage</label><div class="controls"><input type="text" class="span3" name="homepage" [% HTML.attributes(value => project.homepage) %]></input></div></div><div class="control-group"><label class="control-label">Owner</label><div class="controls"><input type="text" class="span3" name="owner" [% HTML.attributes(value => project.owner.username || c.user.username) %]></input></div></div> - replacement in src/root/edit-project.tt at line 56
<div class="form-actions"><button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i>[%IF create %]Create[% ELSE %]Apply changes[% END %]</button>[% IF !create %]<button id="delete-project" type="submit" class="btn btn-danger" name="submit" value="delete"><i class="icon-trash icon-white"></i>Delete this project<div class="form-actions"><button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i>[%IF create %]Create[% ELSE %]Apply changes[% END %] - replacement in src/root/edit-project.tt at line 61
<script type="text/javascript">$("#delete-project").click(function() {return confirm("Are you sure you want to delete this project?");});</script>[% END %]</div>[% IF !create %]<button id="delete-project" type="submit" class="btn btn-danger" name="submit" value="delete"><i class="icon-trash icon-white"></i>Delete this project</button><script type="text/javascript">$("#delete-project").click(function() {return confirm("Are you sure you want to delete this project?");});</script>[% END %]</div> - edit in src/root/edit-project.tt at line 74
</fieldset> - edit in src/root/topbar.tt at line 55
[% IF project.hidden %][% INCLUDE menuItem uri = c.uri_for('/project' project.name 'unhide') title = "Unhide" %][% ELSE %][% INCLUDE menuItem uri = c.uri_for('/project' project.name 'hide') title = "Hide" %][% END %]