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 3c769a92f4fc6390851f22bb8c4a92e25d3d715c..cd40e6cb8928a38ab3bb44fba4bc293cd44a5744 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 f8a697ac902df640c63bb7b7cd026169014014a6..d56f77d6832e1c81593fdd39f90c28cb4d8695f5 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 9cd57122d66b8fd421fd040dc00ee45abbf66422..1b7c8c945bb312b0c7073eb5de1e8361910cd148 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} };