chiark / gitweb /
WIP routesearch UI: entry improvements re advanced options
authorIan Jackson <ian@liberator.(none)>
Sun, 11 Oct 2009 20:07:45 +0000 (21:07 +0100)
committerIan Jackson <ian@liberator.(none)>
Sun, 11 Oct 2009 20:07:45 +0000 (21:07 +0100)
yarrg/web/enter_advrouteopts
yarrg/web/query_route
yarrg/web/query_routesearch

index c8a6ddbb2429a983e40fad372fb97821564b9f03..95a71433ddbf2e1ec4d18e9381131e41c937dfa9 100644 (file)
@@ -34,7 +34,7 @@
 
  Some useful parameters are in %$routeparams:
        ${ $routeparams->{EmsgRef} }
-       $routeparams->{SayOptionalCapital}
+       $routeparams->{SayRequiredCapacity}
  The results are returned there:
        $routeparams->{LossPerLeaguePct}
        $routeparams->{MaxMass}
@@ -49,6 +49,15 @@ $dbh
 $routeparams
 </%args>
 
+<%method advanced>
+<strong>Advanced options - you may leave these blank:</strong>
+<p>
+</%method>
+
+% if (!$routeparams->{SayRequiredCapacity}) {
+<& SELF:advanced &>
+% }
+
 <table><tr><td>
 
 Vessel or capacity:
@@ -62,6 +71,22 @@ Vessel or capacity:
  size=40
 </&>
 
+</table>
+% if ($routeparams->{SayRequiredCapacity}) {
+<& SELF:advanced &>
+% }
+<table><tr>
+
+<td>Available capital:
+
+<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ac',
+    thingstring => 'capitalstring', emsgstore => $routeparams->{EmsgRef},
+    helpref => 'capital',
+    onresults => sub { ($routeparams->{MaxCapital})= @_; }
+ &>
+ size=9
+</&>
+
 <td>
 &nbsp;
 &nbsp;
@@ -77,20 +102,6 @@ Expected losses:
  size=9
 </&>
 
-</table>
-<table><tr>
-
-<td>Available capital<%
- $routeparams->{SayOptionalCapital} ? ' (optional)' : '' %>:
-
-<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ac',
-    thingstring => 'capitalstring', emsgstore => $routeparams->{EmsgRef},
-    helpref => 'capital',
-    onresults => sub { ($routeparams->{MaxCapital})= @_; }
- &>
- size=9
-</&>
-
 <% $m->content %>
 
 </table>
index 7871c3d54dbb6eed20e97fcfcfb99fb86a127610..3c37d6fc9f7833359394af29dd8bab35dbb7b81c 100644 (file)
@@ -90,9 +90,6 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' };
 % my $routeparams= { EmsgRef => \$emsg };
 % if (!$qa->{Dropdowns}) {
 
-<strong>Advanced options - you may leave these blank:</strong>
-<p>
-
 <& enter_advrouteopts, qa=>$qa, dbh=>$dbh, routeparams=>$routeparams &>
 
 % } #---------- end of dropdowns, now common middle of page code ----------
index bbeba5b522e59ce506ec29d9fb334fa01ae93334..93fcf0bc1bda2c57d793b0ed7a7b3e196ab12494 100644 (file)
@@ -51,7 +51,7 @@ my @warningfs;
 my @islandids;
 
 my $qa= \%ARGS;
-my $routeparams= { EmsgRef => \$emsg, SayOptionalCapital => 1 };
+my $routeparams= { EmsgRef => \$emsg, SayRequiredCapacity => 1 };
 my $maxdist;
 
 </%perl>
@@ -70,11 +70,15 @@ This feature is not available from the "drop down menus" interface.
  &>
 
 <&| enter_advrouteopts, qa=>$qa, dbh=>$dbh, routeparams=>$routeparams &>
+<td>
+&nbsp;
+&nbsp;
 <td>
  Maximum distance:
  <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ml',
     thingstring => 'distance', emsgstore => \$emsg,
     onresults => sub { ($maxdist)= @_; } &>
+   size=10
  </&>
 </&>