chiark / gitweb /
Merge branch 'master' into stable-5.x
[ypp-sc-tools.db-live.git] / yarrg / web / enter_advrouteopts
index 2a5eff0e5c5c677334ec055b709d1c566cfdb4f6..95a71433ddbf2e1ec4d18e9381131e41c937dfa9 100644 (file)
  This Mason component generates entry fields for route planning
  advanced parameters (capacity limits, etc).
 
  This Mason component generates entry fields for route planning
  advanced parameters (capacity limits, etc).
 
The results are returned in $routeparams:
Some useful parameters are in %$routeparams:
        ${ $routeparams->{EmsgRef} }
        ${ $routeparams->{EmsgRef} }
+       $routeparams->{SayRequiredCapacity}
+ The results are returned there:
        $routeparams->{LossPerLeaguePct}
        $routeparams->{MaxMass}
        $routeparams->{MaxVolume}
        $routeparams->{LossPerLeaguePct}
        $routeparams->{MaxMass}
        $routeparams->{MaxVolume}
@@ -47,6 +49,15 @@ $dbh
 $routeparams
 </%args>
 
 $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:
 <table><tr><td>
 
 Vessel or capacity:
@@ -60,6 +71,22 @@ Vessel or capacity:
  size=40
 </&>
 
  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;
 <td>
 &nbsp;
 &nbsp;
@@ -75,19 +102,6 @@ Expected losses:
  size=9
 </&>
 
  size=9
 </&>
 
-</table>
-<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
-</&>
-
 <% $m->content %>
 
 </table>
 <% $m->content %>
 
 </table>