[Midnightbsd-cvs] mports: index.cgi: only show reset links if the port belongs to an
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Wed Mar 19 23:58:27 EDT 2008
Log Message:
-----------
only show reset links if the port belongs to an active run
Modified Files:
--------------
mports/Tools/magus/www/data/magus:
index.cgi (r1.9 -> r1.10)
-------------- next part --------------
Index: index.cgi
===================================================================
RCS file: /home/cvs/mports/Tools/magus/www/data/magus/index.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -L Tools/magus/www/data/magus/index.cgi -L Tools/magus/www/data/magus/index.cgi -u -r1.9 -r1.10
--- Tools/magus/www/data/magus/index.cgi
+++ Tools/magus/www/data/magus/index.cgi
@@ -136,16 +136,17 @@
$port = Magus::Port->retrieve($port) || die "No such port: $port";
$tmpl->param(
- port => $port->name,
+ port => $port->name,
id => $port->id,
- title => "Magus // $port",
- desc => $port->description,
- www => $port->www,
- version => $port->version,
- run => $port->run->id,
+ title => "Magus // $port",
+ desc => $port->description,
+ www => $port->www,
+ version => $port->version,
+ run => $port->run->id,
osversion => $port->run->osversion,
arch => $port->run->arch,
status => $port->status,
+ can_reset => $port->run->status eq 'active' ? 1 : 0,
);
my @events = map { {
@@ -221,7 +222,7 @@
my $query = $p->param('q');
- my @ports = Magus::Port->retrieve_from_sql("name LIKE ?", "%$query%");
+ my @ports = Magus::Port->retrieve_from_sql("name LIKE ? ORDER BY name", "%$query%");
if (@ports == 1) {
my $id = $ports[0]->id;
@@ -237,6 +238,7 @@
id => $_->id,
run => $_->run,
osversion => $_->run->osversion,
+ can_reset => $_->run->status eq 'active' ? 1 : 0,
}} @ports;
my $tmpl = template($p, 'list.tmpl');
@@ -296,7 +298,7 @@
osversion => $_->run->osversion,
}} @ports;
- my $tmpl = template($p, 'result-list.tmpl');
+ my $tmpl = template($p, 'port-list.tmpl');
$tmpl->param(results => \@results);
$details{html} = $tmpl->output;
More information about the Midnightbsd-cvs
mailing list