X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Froute;h=74a5086f1428b64f37e269dd66f3eff07ed999d7;hp=595976f8293a7cde6b6cbe56871ba5e90f47595b;hb=7548896aab16af6ec42c6be252b7f5f876e2fea0;hpb=4a7daddbd09806e47fc3b6df9cfc42ed5eb84758 diff --git a/yarrg/web/route b/yarrg/web/route index 595976f..74a5086 100644 --- a/yarrg/web/route +++ b/yarrg/web/route @@ -76,7 +76,7 @@ foreach my $var (@vars) { my %qf= (%baseqf,%queryqf); delete $qf{$lname}; $qf{$lname}= $value if $cvalix; - print ''; + print ''; $after= ''; } print $html, $after; @@ -100,7 +100,7 @@ $routestring => ''

Specify route

-
+ %#---------- textbox, user enters route as string ---------- % if (!$a{Dropdowns}) { @@ -201,7 +201,7 @@ while ($row=$sth->fetchrow_arrayref) { my %resetislandlistdata; foreach my $arch (keys %islandlistdata) { $resetislandlistdata{$arch}= - &$optionlistmap($islandlistdata{$arch}, ''); + $optionlistmap->($islandlistdata{$arch}, ''); } @@ -229,7 +229,7 @@ function ms_Setarch(dd) { +<% $optionlistmap->(\@archlistdata, $ARGS{"archipelago$dd"}) %> % } @@ -239,7 +239,7 @@ function ms_Setarch(dd) { % $arch= 'none' if !defined $arch; % } @@ -251,14 +251,19 @@ function ms_Setarch(dd) {
-

Results

- <%perl> #========== result computations ========== +my $results_head; +$results_head= sub { + print "

Results

\n"; + $results_head= sub { }; +}; + #---------- result computation - textstring ---------- if (!$a{Dropdowns}) { if (length $routestring) { + $results_head->(); my $rsr= $m->comp('routetextstring', ocean => $a{Ocean}, string => $routestring, @@ -285,13 +290,14 @@ my $argorundef= sub { }; for my $dd (0..$a{Dropdowns}-1) { - my $arch= &$argorundef($dd,'archipelago'); - my $island= &$argorundef($dd,'islandid'); + my $arch= $argorundef->($dd,'archipelago'); + my $island= $argorundef->($dd,'islandid'); next unless defined $arch or defined $island; if (defined $island and defined $arch) { my $ii= $islandid2{$island}; my $iarch= $ii->{Arch}; if ($iarch ne $arch) { + $results_head->(); Specified archipelago <% $arch %> but island <% $ii->{Name} %> @@ -308,6 +314,7 @@ for my $dd (0..$a{Dropdowns}-1) { % if (@islandids) { +% $results_head->(); <& routetrade, islandids => \@islandids, archipelagoes => \@archipelagoes &>