chiark / gitweb /
Better doc
[ypp-sc-tools.db-live.git] / yarrg / web / enter_route
index f4ad1d7ed003283e80aabc2babeda6d4f8414800..6d2c9fdca32b0a9ca982fb7ea6eeb577e087d414 100644 (file)
@@ -48,21 +48,26 @@ $archipelagoes_r
 %#---------- textbox, user enters route as string ----------
 % if (!$qa->{Dropdowns}) {
 
-<% $enterwhat %> (islands, or archipelagoes, separated by |s or commas;
- abbreviations are OK):<br>
+<% $enterwhat %>
+% if (defined($archipelagoes_r)) {
+(islands, or archipelagoes,
+% } else {
+(islands
+% }
+separated by |s or commas; abbreviations are OK):<br>
 
-<&| qtextstring, qa => $qa, dbh => $dbh,
-    thingstring => 'routestring', emsgstore => $emsg_r,
+<& qtextstring, qa => $qa, dbh => $dbh, emsgstore => $emsg_r,
+    thingstring => defined($archipelagoes_r) ? 'routestring' : 'islandstring',
+    prefix => 'rl', boxopts => 'size=80',
     onresults => sub {
        foreach (@_) {
        my ($canonname, $island, $arch) = @$_;
                push @$islandids_r, $island;
-               push @$archipelagoes_r, defined $island ? undef : $arch;
+               push @$archipelagoes_r, defined $island ? undef : $arch
+                       if defined $archipelagoes_r;
        }
     }
  &>
- size=80
-</&>
 
 % } else { #---------- dropdowns, user selects from menus ----------