chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cope with multi-word arches
[ypp-sc-tools.main.git]
/
yarrg
/
web
/
query_route
diff --git
a/yarrg/web/query_route
b/yarrg/web/query_route
index 18c3ecb1390af1f2d3a3fc4f2108d2a64f5c90ce..393e7a668755145d05262a56b56ed005330669c1 100644
(file)
--- a/
yarrg/web/query_route
+++ b/
yarrg/web/query_route
@@
-49,6
+49,16
@@
my @islandids;
my %islandid2;
my $qa= \%ARGS;
my %islandid2;
my $qa= \%ARGS;
+
+my $be_post;
+my $startform= sub {
+ ($be_post)= @_;
+</%perl>
+<form action="<% $quri->() |h %>" method="<% $be_post ? 'post' : 'get' %>">
+<%perl>
+};
+my $goupdate= sub { $be_post ? 'Update' : 'Go' };
+
</%perl>
<h1>Specify route</h1>
</%perl>
<h1>Specify route</h1>
@@
-61,7
+71,7
@@
my $qa= \%ARGS;
Enter route (islands, or archipelagoes, separated by |s or commas;
abbreviations are OK):<br>
Enter route (islands, or archipelagoes, separated by |s or commas;
abbreviations are OK):<br>
-<form action="<% $quri->() |h %>" method="get">
+% $startform->($routestring =~ m/\S/);
<&| qtextstring, qa => $qa, dbh => $dbh,
thingstring => 'routestring', emsgstore => \$emsg,
<&| qtextstring, qa => $qa, dbh => $dbh,
thingstring => 'routestring', emsgstore => \$emsg,
@@
-76,6
+86,11
@@
Enter route (islands, or archipelagoes, separated by |s or commas;
% } else { #---------- dropdowns, user selects from menus ----------
% } else { #---------- dropdowns, user selects from menus ----------
+% $startform->(grep {
+% defined $ARGS{"archipelago$_"} ||
+% defined $ARGS{"islandid$_"}
+% } (0..$qa->{Dropdowns}-1));
+
<%perl>
my ($sth,$row);
my @archlistdata;
<%perl>
my ($sth,$row);
my @archlistdata;
@@
-165,8
+180,8
@@
function ms_Setarch(dd) {
% } #---------- end of dropdowns, now common middle of page code ----------
% } #---------- end of dropdowns, now common middle of page code ----------
-<input type=submit name=submit value="
Go
">
-% my $ours= sub { $_[0] =~ m/^island|^archipelago|^routestring|^
rtsel[ag]_
/; };
+<input type=submit name=submit value="
<% $goupdate->() %>
">
+% my $ours= sub { $_[0] =~ m/^island|^archipelago|^routestring|^
[RT]
/; };
<& "lookup:formhidden", ours => $ours &>
<%perl>
<& "lookup:formhidden", ours => $ours &>
<%perl>
@@
-205,7
+220,7
@@
for my $dd (0..$qa->{Dropdowns}-1) {
</%perl>
% if (@islandids) {
</%perl>
% if (@islandids) {
-% $someresults->();
+% $someresults->(
'Relevant trades'
);
<& routetrade,
dbh => $dbh,
islandids => \@islandids,
<& routetrade,
dbh => $dbh,
islandids => \@islandids,