-</%perl>
-% my $show_flows= sub {
-% my ($od,$arbitrage,$collectdeliver) = @_;
-% my $todo= $flowlists{$od};
-% return unless $todo;
-% foreach my $tkey (sort keys %$todo) {
-% my $t= $todo->{$tkey};
-% next if $t->{"${od}Arbitrage"} != $arbitrage;
-% $show_total_now->('');
-% if (!$age_reported++) {
-% my $age= $now - $t->{Timestamp};
-% my $cellid= "da_${i}";
-% $da_ages{$cellid}= $age;
-<td colspan=2>\
-(Data age: <span id="<% $cellid %>"><% prettyprint_age($age) %></span>)
-% } elsif (!defined $total) {
-% $total= 0;
-<tbody>
-% }
-% $total += $t->{Total};
-% my $span= 0 + keys %{ $t->{Stalls} };
-% my $td= "td rowspan=$span";
-<tr class="datarow<% $dline %>">
-<<% $td %>><% $collectdeliver %>
-<<% $td %>><% $t->{'commodname'} |h %>
-%
-% my @stalls= sort keys %{ $t->{Stalls} };
-% my $pstall= sub {
-% my $name= $stalls[$_[0]];
-<td><% $name |h %>
-% };
-%
-% $pstall->(0);
-<<% $td %> align=right><% $t->{Price} |h %> poe ea.
-<<% $td %> align=right><% $t->{Qty} |h %> unit(s)
-<<% $td %> align=right><% $t->{Total} |h %> total
-%
-% foreach my $stallix (1..$#stalls) {
-<tr class="datarow<% $dline %>">
-% $pstall->($stallix);
-% }
-%
-% $dline ^= 1;
-% }
-% };
-<%perl>
+ my $show_flows= sub {
+ my ($od,$arbitrage,$collectdeliver) = @_;
+ my $todo= $flowlists{$od};
+ return unless $todo;
+ foreach my $tkey (sort keys %$todo) {
+ my $t= $todo->{$tkey};
+ next if $t->{"${od}Arbitrage"} != $arbitrage;
+ $show_total_now->('');
+ if (!$age_reported++) {
+ my $age= $now - $t->{Timestamp};
+ @oldest= ($age,$islandnamepr) if $oldest[0] < $age;
+ my $cellid= "da_${i}";
+ my $agepr= prettyprint_age($age);
+ $da_ages{$cellid}= $age;
+ $plan_html .= <<END
+<td colspan=2>(Data age: <span id="$cellid">$agepr</span>)
+END
+ } elsif (!defined $total) {
+ $total= 0;
+ $plan_html .= $tbody->(0);
+ }
+ $total += $t->{Total};
+ my $span= 0 + keys %{ $t->{Stalls} };
+ my $td= "td rowspan=$span";
+ my %linkqf= (%{ $qa->{'baseqf'} }, %{ $qa->{'queryqf'} });
+ $linkqf{'query'}= 'commod';
+ $linkqf{'commodstring'}= $t->{'commodname'};
+ $linkqf{'commodid'}= $t->{'commodid'};
+ my $linkqfpr= $quri->(%linkqf);
+ my $commodnamepr= encode_entities($t->{'commodname'});
+ $plan_html .= tr_datarow_s($m,$dline) . <<END;
+<$td>$collectdeliver
+<$td><a href="$linkqfpr">$commodnamepr</a>
+<$td>$t->{'posinclass'}
+END
+ my @stalls= sort keys %{ $t->{Stalls} };
+ my $pstall= sub {
+ my $namepr= encode_entities( $stalls[$_[0]] );
+ $plan_html .= <<END;
+<td>$namepr
+END
+ };
+
+ $pstall->(0);
+ $plan_html .= <<END;
+<$td align=right>$t->{Price} poe ea.
+<$td align=right>$t->{Qty} unit(s)
+<$td align=right>$t->{Total} total
+END
+ foreach my $stallix (1..$#stalls) {
+ tr_datarow_s($m,$dline);
+ $pstall->($stallix);
+ }
+
+ $dline ^= 1;
+ }
+ };