chiark / gitweb /
Trading plan commodity names are links to commod prices
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 22 Nov 2009 13:42:59 +0000 (13:42 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 22 Nov 2009 13:52:00 +0000 (13:52 +0000)
yarrg/web/query_route
yarrg/web/query_routesearch
yarrg/web/routetrade

index 3c769a9..cd40e6c 100644 (file)
@@ -128,7 +128,7 @@ foreach my $warningf (@warningfs) {
    dbh => $dbh,
    islandids => \@islandids,
    archipelagoes => \@archipelagoes,
-   qa => $qa,
+   qa => $qa, quri => $quri,
    routeparams => $routeparams,
    reset_suppressions => !!$allargs->{'apply_minprofit'}
  &>
index f8a697a..d56f77d 100644 (file)
@@ -126,7 +126,7 @@ print STDERR "ONRESULTS @_\n";
 % my $ours= sub { $_[0] =~ m/^lossperleague|^islandstring|^capitalstring|^capacitystring|^minprofitstring|^distance/; };
 <& "lookup:formhidden", ours => $ours &>
 
-% }
+s% }
 
 </form>
 </div>
index 9cd5712..1b7c8c9 100644 (file)
@@ -40,6 +40,7 @@ $dbh
 $qa
 $routeparams
 $reset_suppressions
+$quri
 </%args>
 <& query_age:pageload &>
 
@@ -735,6 +736,7 @@ Generated by YARRG at <strong><%
                        orgArbitrage => 0,
                        dstArbitrage => 0,
                } unless $$todo;
+               $$todo->{'commodid'}= $f->{'commodid'};
                $$todo->{'commodname'}= $f->{'commodname'};
                $$todo->{'posinclass'}= '';
                my $incl= $f->{'posinclass'};
@@ -822,9 +824,13 @@ END
 %              $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'};
 % tr_datarow($m,$dline);
 <<% $td %>><% $collectdeliver %>
-<<% $td %>><% $t->{'commodname'} |h %>
+<<% $td %>><a href="<% $quri->(%linkqf) %>"><% $t->{'commodname'} |h %></a>
 <<% $td %>><% $t->{'posinclass'} %>
 %
 %              my @stalls= sort keys %{ $t->{Stalls} };