chiark / gitweb /
Fix spelling error in intro
[ypp-sc-tools.db-live.git] / yarrg / web / lookup
index 7af431cee119f6e163439b83a08fcf84b6b8eedd..6fc1cd76e0cafa0d93da1ce9c8d3037f1254616b 100755 (executable)
@@ -58,6 +58,7 @@ my %styles;
                Values => [     [ 'route', 'Trades for route' ],
                                [ 'commod', 'Prices for commodity' ],
                                [ 'offers', 'Offers at location' ],
+                               [ 'routesearch', 'Find profitable route' ],
                                [ 'age', 'Data age' ] ]
        }, {    Name => 'BuySell',
                Before => '',
@@ -79,6 +80,12 @@ my %styles;
                                [ 1, 'Show individual stalls' ],
                        ],
                QuerySpecific => 1,
+       }, {    Name => 'RouteSearchType',
+               Before => 'Type of routes to search for: ',
+               Values => [     [ 0, 'Open-ended' ],
+                               [ 1, 'Circular' ],
+                       ],
+               QuerySpecific => 1,
        });
 
 foreach my $var (@vars) {
@@ -121,12 +128,13 @@ $ours
 
 <html lang="en"><head><title><% ucfirst $ahtml{Query} %> - YARRG</title>
 <style type="text/css">
-body {
-  color: #000000;
-  background: #ffffff;
-}
-tr.datarow0 { background: #e3e3e3; }
-tr.datarow1 { background: #ffffff; }
+<& style.css &>
+  body { color: #000000; background: #c5c7ae; }
+  div.query { background: #d7d8b3; padding: 1em; }
+  div.results { padding: 1em; }
+  table.data { background: #b5b686; }
+  tr.datarow0 { background: #e3e3e3; }
+  tr.datarow1 { background: #ffffff; }
 </style>
 <&| script &>
   function register_onload(f) {
@@ -139,15 +147,11 @@ tr.datarow1 { background: #ffffff; }
 </&script>
 </head><body>
 
-<a href="<% $m->current_comp()->name() |u %>">YARRG</a> -
- Yet Another Revenue Research Gatherer
-|
-<a href="intro">introduction</a>
-|
-<a href="docs">documentation</a>
-|
-<a href="devel">development</a>
+% if (!printable($m)) {
+<div class="navoptbar">
+<& navbar &>
 <p>
+% }
 <%perl>
 
 foreach my $var (@vars) {
@@ -158,8 +162,8 @@ foreach my $var (@vars) {
 
 foreach my $var (keys %ARGS) {
        next unless $var =~
-               m/^(?: (?:route|commod|capacity|capital)string |
-                       lossperleague |
+               m/^(?: (?:route|commod|capacity|capital|island)string |
+                       lossperleague | distance |
                        commodid |
                        islandid \d |
                        archipelago \d |
@@ -179,6 +183,7 @@ my $quri= sub {
 
 my $prselector_core= sub {
        my ($var)= @_;
+       return if printable($m);
        my $name= $var->{Name};
        my $lname= lc $var->{Name};
        my $delim= $var->{Before};
@@ -244,10 +249,14 @@ my $someresults= sub {
 $debug => 0
 </%args>
 
+% if (!printable($m)) {
+</div>
 <hr>
+% }
 
 <& "query_$styles{Query}", %baseqf, %queryqf, %styles,
     quri => $quri, dbh => $dbh,
+    baseqf => \%baseqf, queryqf => \%queryqf, allargs => \%ARGS,
     prselector => $prselector,
     someresults => $someresults,
     emsgokorprint => sub {
@@ -259,15 +268,14 @@ $debug => 0
     }
  &>
 
-<p>
-
 %#---------- debugging and epilogue ----------
 
 % if ($debug) {
-<p>
+<div class="results">
 <pre id="debug_log">
 Debug log:
 </pre>
+</div>
 % }
 
 <&| script &>