From: Ian Jackson Date: Sun, 11 Oct 2009 20:07:45 +0000 (+0100) Subject: WIP routesearch UI: entry improvements re advanced options X-Git-Tag: 5.0^2~50 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=commitdiff_plain;h=20bea992a857ea1f03f19d81f7164b113a560e83 WIP routesearch UI: entry improvements re advanced options --- diff --git a/yarrg/web/enter_advrouteopts b/yarrg/web/enter_advrouteopts index c8a6ddb..95a7143 100644 --- a/yarrg/web/enter_advrouteopts +++ b/yarrg/web/enter_advrouteopts @@ -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 +<%method advanced> +Advanced options - you may leave these blank: +

+ + +% if (!$routeparams->{SayRequiredCapacity}) { +<& SELF:advanced &> +% } +
Vessel or capacity: @@ -62,6 +71,22 @@ Vessel or capacity: size=40 +
+% if ($routeparams->{SayRequiredCapacity}) { +<& SELF:advanced &> +% } + + +
Available capital: + +<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ac', + thingstring => 'capitalstring', emsgstore => $routeparams->{EmsgRef}, + helpref => 'capital', + onresults => sub { ($routeparams->{MaxCapital})= @_; } + &> + size=9 + +     @@ -77,20 +102,6 @@ Expected losses: size=9 -
- - -
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 %>
diff --git a/yarrg/web/query_route b/yarrg/web/query_route index 7871c3d..3c37d6f 100644 --- a/yarrg/web/query_route +++ b/yarrg/web/query_route @@ -90,9 +90,6 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' }; % my $routeparams= { EmsgRef => \$emsg }; % if (!$qa->{Dropdowns}) { -Advanced options - you may leave these blank: -

- <& enter_advrouteopts, qa=>$qa, dbh=>$dbh, routeparams=>$routeparams &> % } #---------- end of dropdowns, now common middle of page code ---------- diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch index bbeba5b..93fcf0b 100644 --- a/yarrg/web/query_routesearch +++ b/yarrg/web/query_routesearch @@ -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; @@ -70,11 +70,15 @@ This feature is not available from the "drop down menus" interface. &> <&| enter_advrouteopts, qa=>$qa, dbh=>$dbh, routeparams=>$routeparams &> + +  +  Maximum distance: <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ml', thingstring => 'distance', emsgstore => \$emsg, onresults => sub { ($maxdist)= @_; } &> + size=10