From e24b2ec10cfd65bc2c7070cbee42294deeb907cc Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Tue, 8 Jan 2008 23:42:56 +0100 Subject: [PATCH] only list scans, don't show them --- NDWeb/Pages/EditRaid.pm | 25 +++++++------------------ templates/editRaid.tmpl | 10 +++++++--- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/NDWeb/Pages/EditRaid.pm b/NDWeb/Pages/EditRaid.pm index b0f4f99..61a5814 100644 --- a/NDWeb/Pages/EditRaid.pm +++ b/NDWeb/Pages/EditRaid.pm @@ -223,28 +223,17 @@ sub render_body { } $target->{waves} = \@waves; - my $scans = $DBH->prepare(q{SELECT DISTINCT ON (type) type, tick, scan FROM scans - WHERE planet = ? AND type ~ 'Unit|Planet|Advanced Unit|.* Analysis' AND tick + 24 > tick() AND scan is not null - GROUP BY type, tick, scan ORDER BY type ,tick DESC}); + my $scans = $DBH->prepare(q{SELECT DISTINCT ON (type) scan_id,type, tick FROM scans + WHERE planet = ? AND type ~ 'Unit|Planet|Advanced Unit|.* Analysis' AND tick + 24 > tick() + ORDER BY type ,tick DESC}); $scans->execute($target->{planet}); delete $target->{planet}; - my %scans; - while (my $scan = $scans->fetchrow_hashref){ - $scans{$scan->{type}} = $scan; - } my @scans; - for my $type ('Planet','Unit','Advanced Unit','Surface Analysis','Technology Analysis'){ - next unless exists $scans{$type}; - my $scan = $scans{$type}; - if ($self->{TICK} - $scan->{tick} > 5){ - $scan->{scan} =~ s{}{}; - } - if ($type eq 'Planet'){ - $target->{PlanetScan} = $scan->{scan}; - next; - } - push @scans,{Scan => $scan->{scan}}; + my $i = 0; + while (my $scan = $scans->fetchrow_hashref){ + $scan->{ODD} = $i++ % 2; + push @scans,$scan; } $target->{Scans} = \@scans; push @targets,$target; diff --git a/templates/editRaid.tmpl b/templates/editRaid.tmpl index 6c9f277..0b176c3 100644 --- a/templates/editRaid.tmpl +++ b/templates/editRaid.tmpl @@ -98,11 +98,15 @@

+
+ -
- -
+
+ + + +
TickScan

-- 2.39.2