chiark / gitweb /
Do not include Advanced Options heading in routesearch; it's inaccurate
[ypp-sc-tools.db-test.git] / yarrg / web / enter_advrouteopts
index 1e037330197161c5ede0342057fc08f31b780c76..66b012890ec9824f6dac9680ec4ab866e0c9c3a1 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->{MaxCapital}
        $routeparams->{LossPerLeaguePct}
        $routeparams->{MaxMass}
        $routeparams->{MaxVolume}
        $routeparams->{MaxCapital}
+       $routeparams->{MinProfit}
 
 
 </%doc>
 
 
 </%doc>
 $qa
 $dbh
 $routeparams
 $qa
 $dbh
 $routeparams
+$minprofit_needs_apply => 0
 </%args>
 
 </%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:
-<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'cs',
+<& qtextstring, qa => $qa, dbh => $dbh, prefix => 'cs',
     thingstring => 'capacitystring', emsgstore => $routeparams->{EmsgRef},
     thingstring => 'capacitystring', emsgstore => $routeparams->{EmsgRef},
-    helpref => 'capacity',
+    helpref => 'capacity', boxopts => 'size=30',
     onresults => sub {
        ($routeparams->{MaxMass}, $routeparams->{MaxVolume}) = @_;
     }
  &>
     onresults => sub {
        ($routeparams->{MaxMass}, $routeparams->{MaxVolume}) = @_;
     }
  &>
- size=40
-</&>
 
 <td>
 &nbsp;
 &nbsp;
 
 
 <td>
 &nbsp;
 &nbsp;
 
-<td>
-Expected losses:
-
-<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'll',
-    thingstring => 'lossperleague', emsgstore => $routeparams->{EmsgRef},
-    helpref => 'losses',
-    onresults => sub { ($routeparams->{LossPerLeaguePct})= @_; }
+<td>Minimum trade value:
+<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'mt', checkkind => 'poe',
+    thingstring => 'minprofitstring', emsgstore => $routeparams->{EmsgRef},
+    helpref => 'minprofit', boxopts => 'size=9',
+    onresults => sub {
+       ($routeparams->{MinProfit}) = @_;
+    }
  &>
  &>
- size=9
+% if ($minprofit_needs_apply) {
+<input type=submit name="apply_minprofit" value="Apply">
+% }
 </&>
 
 </table>
 </&>
 
 </table>
@@ -80,12 +93,25 @@ Expected losses:
 
 <td>Available capital:
 
 
 <td>Available capital:
 
-<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ac',
+<& qtextstring, qa => $qa, dbh => $dbh, prefix => 'ac', checkkind => 'poe',
     thingstring => 'capitalstring', emsgstore => $routeparams->{EmsgRef},
     thingstring => 'capitalstring', emsgstore => $routeparams->{EmsgRef},
-    helpref => 'capital',
+    helpref => 'capital', boxopts => 'size=9',
     onresults => sub { ($routeparams->{MaxCapital})= @_; }
  &>
     onresults => sub { ($routeparams->{MaxCapital})= @_; }
  &>
- size=9
-</&>
+
+<td>
+&nbsp;
+&nbsp;
+
+<td>
+Expected losses:
+
+<& qtextstring, qa => $qa, dbh => $dbh, prefix => 'll',
+    thingstring => 'lossperleague', emsgstore => $routeparams->{EmsgRef},
+    helpref => 'losses', boxopts => 'size=9',
+    onresults => sub { ($routeparams->{LossPerLeaguePct})= @_; }
+ &>
+
+<% $m->content %>
 
 </table>
 
 </table>