chiark / gitweb /
Merge branch 'refs/remote/t.fa.mason'
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Thu, 29 Oct 2009 18:57:44 +0000 (18:57 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Thu, 29 Oct 2009 18:57:44 +0000 (18:57 +0000)
23 files changed:
yarrg/Commods.pm
yarrg/Makefile
yarrg/README
yarrg/TODO
yarrg/db-idempotent-populate
yarrg/notes.linear-programming [deleted file]
yarrg/rscommon.h
yarrg/rsmain.c
yarrg/rssearch.c
yarrg/rssql.c
yarrg/rsvalue.c
yarrg/web/devel
yarrg/web/docs
yarrg/web/dumptable
yarrg/web/intro
yarrg/web/lookup
yarrg/web/query_age
yarrg/web/query_commod
yarrg/web/query_offers
yarrg/web/query_route
yarrg/web/query_routesearch
yarrg/web/routetrade
yarrg/web/style.css [new file with mode: 0755]

index 372fe16f51544081e9378d68563a91a5b38868df..f74571ddd39c6c5093902c51aae03969cb780532 100644 (file)
@@ -51,7 +51,33 @@ BEGIN {
     @EXPORT_OK   = qw();
 }
 
-our $masterinfoversion= 2; # version we understand
+our $masterinfoversion= 2; # version we understand.
+#
+# To extend the source-info.txt format:
+#
+#    * Commods.pm:parse_info1
+#       add code to parse new version
+#
+#    * source-info.txt
+#       add new information
+#
+# If new data should NOT be in master-info.txt too:
+#
+#    * update-master-info:process_some_info
+#       check that code for converting source-info to master-info
+#       removes the extra info; add code to remove it if necessary
+#
+#    * db-idempotent-populate
+#       if database schema is extended, add code to copy data
+#
+# If new data DOES need to be in master-info.txt too:
+#
+#    * Commods.pm:$masterinfoversion
+#       increment
+#
+#    * update-master-info:process_some_info
+#       add code to convert new version to old, by removing
+#       extra info conditionally depending on version
 
 our %oceans; # eg $oceans{'Midnight'}{'Ruby'}{'Eta Island'}= $sources;
 our %clients; # eg $clients{'ypp-sc-tools'}= [ qw(last-page) ];
index a9c833b622760f697f86d30fe52c5b1bef6d547e..44441bc19370b843229dc1f79de831769d76c4ab 100644 (file)
@@ -1,4 +1,3 @@
-
 # This is part of ypp-sc-tools, a set of third-party tools for assisting
 # players of Yohoho Puzzle Pirates.
 #
@@ -9,6 +8,12 @@
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
+# The parts of the code used for the website (including the web/
+# directory and the rs*.[ch] which make up the routesearch program)
+# are released instead under the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -31,10 +36,14 @@ DEBUG=-g
 
 CFLAGS += $(WARNINGS) $(WERROR) $(OPTIMISE) $(DEBUG)
 
-TARGETS= yarrg
+TARGETS_CLIENT= yarrg
+TARGETS_SERVER= routesearch
+TARGETS= $(TARGETS_CLIENT) $(TARGETS_SERVER)
 
-default: clean-other-directory $(TARGETS)
-all: default routesearch
+default: clean-other-directory client
+client: $(TARGETS_CLIENT)
+server: $(TARGETS_SERVER)
+all: client server
 
 CONVERT_OBJS= convert.o ocr.o pages.o structure.o rgbimage.o resolve.o
 COMMON_OBJS= common.o
index d5062ac6ed0ae6111b15f80a0dc1848cc1b491b0..10555f47aa039121c0881af27ee8f5c01906692a 100644 (file)
@@ -178,7 +178,8 @@ Copyright (C) 2009 Steve Early
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of
- (a) for the website code, the GNU Affero General Public License and
+ (a) for the website code including the route searcher,
+      the GNU Affero General Public License and
  (b) for the rest of the code, GNU General Public License
 as published by the Free Software Foundation, either version 3 of
 each applicable the License, or (at your option) any later version.
index 8e85c933e1d1bd44204fb3df18771c9916d5c153..d9d1b699278d4e94d187eeaef75cad5189563b3e 100644 (file)
@@ -1,3 +1,6 @@
+unticking trades doesn't work?!
+
+
 UPLOADER
 --------
 
index 1d106f2b4f9ef6924cebc6f19b0677ce8352d008..c4bd4a761431ef4968520b0080e894925871f73f 100755 (executable)
@@ -5,7 +5,7 @@
 #
 # usage: ./db-idempotent-populate <Oceanname>
 #  creates or updates OCEAN-Oceanname.db
-#  from master-master.txt
+#  from source-info.txt
 
 # This is part of ypp-sc-tools, a set of third-party tools for assisting
 # players of Yohoho Puzzle Pirates.
diff --git a/yarrg/notes.linear-programming b/yarrg/notes.linear-programming
deleted file mode 100644 (file)
index e3c684c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-use glpk's standalone solver with cplex input, see
- glpk refman.ps.gz p84 for example
-don't use it own modelling language which is very complex
-
-Math::LP would be nice but depends on Math::LP::Solve which is not in
- Debian.
-
index 45a5b3129e141af8369576e059bb386b497d823f..237cab1347d8006ed63587529fd61f442a34acb9 100644 (file)
@@ -1,3 +1,30 @@
+/*
+ * Route searcher - common definitions
+ */
+/*
+ *  This is part of the YARRG website, a tool for assisting
+ *  players of Yohoho Puzzle Pirates.
+ * 
+ *  Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU Affero General Public License as
+ *  published by the Free Software Foundation, either version 3 of the
+ *  License, or (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Affero General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Affero General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *  
+ *  Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+ *  are used without permission.  This program is not endorsed or
+ *  sponsored by Three Rings.
+ */
+
 #ifndef RSCOMMON_H
 #define RSCOMMON_H
 
index 774f507e309857db3c603463ed276920a1c8bdb4..67d338b502d961dc3279874cacb1344ab173e4ba 100644 (file)
@@ -1,4 +1,29 @@
-/**/
+/*
+ * Route searcher - command line parsing and result printing
+ */
+/*
+ *  This is part of the YARRG website, a tool for assisting
+ *  players of Yohoho Puzzle Pirates.
+ * 
+ *  Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU Affero General Public License as
+ *  published by the Free Software Foundation, either version 3 of the
+ *  License, or (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Affero General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Affero General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *  
+ *  Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+ *  are used without permission.  This program is not endorsed or
+ *  sponsored by Three Rings.
+ */
 
 #include "rscommon.h"
 
index 1dd29e5bfa2dc23293b640b41a44186851f96b3f..245070e9ad6c34740f576707dee52dca95df03b1 100644 (file)
@@ -1,4 +1,29 @@
-/**/
+/*
+ * Route searcher - recursive iteration over all routes
+ */
+/*
+ *  This is part of the YARRG website, a tool for assisting
+ *  players of Yohoho Puzzle Pirates.
+ * 
+ *  Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU Affero General Public License as
+ *  published by the Free Software Foundation, either version 3 of the
+ *  License, or (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Affero General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Affero General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *  
+ *  Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+ *  are used without permission.  This program is not endorsed or
+ *  sponsored by Three Rings.
+ */
 
 #include "rscommon.h"
 
index 23b3bd04af68ff56033d754a1dca60349797fe08..043e34ed7790999cc4d09a9295e3dfca6d83f7b3 100644 (file)
@@ -1,3 +1,29 @@
+/*
+ * Route searcher - database helper functions
+ */
+/*
+ *  This is part of the YARRG website, a tool for assisting
+ *  players of Yohoho Puzzle Pirates.
+ * 
+ *  Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU Affero General Public License as
+ *  published by the Free Software Foundation, either version 3 of the
+ *  License, or (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Affero General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Affero General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *  
+ *  Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+ *  are used without permission.  This program is not endorsed or
+ *  sponsored by Three Rings.
+ */
 
 #include "rscommon.h"
 
index d3ffeeb1f8c651c280d9599f499f632ae4862dad..b469378303de295f3c12d17b20cc9b65f44ac772 100644 (file)
@@ -1,4 +1,29 @@
-/**/
+/*
+ * Route searcher - route evaluation
+ */
+/*
+ *  This is part of the YARRG website, a tool for assisting
+ *  players of Yohoho Puzzle Pirates.
+ * 
+ *  Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU Affero General Public License as
+ *  published by the Free Software Foundation, either version 3 of the
+ *  License, or (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Affero General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU Affero General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *  
+ *  Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+ *  are used without permission.  This program is not endorsed or
+ *  sponsored by Three Rings.
+ */
 
 #include <glpk.h>
 
index fecd77dc1b25449701391f4a8a65d6b888703d6b..fed459f5b8e1df457e9de2eaf8456944c76b9c3c 100755 (executable)
 </%doc>
 <html lang="en"><head>
 <title>YARRG (Yet Another Revenue Research Gatherer)</title>
+<link rel="stylesheet" type="text/css" href="style.css">
 </head><body>
 
+<div class="navoptbar">
 <a href="lookup">YARRG</a> -
  Yet Another Revenue Research Gatherer
 |
@@ -45,6 +47,8 @@
 <a href="docs">documentation</a>
 |
 <b>development</b>
+</div>
+<div class="docs">
 
 <h1>YARRG development, contribution and troubleshooting</h1>
 
@@ -141,4 +145,5 @@ Email Ian Jackson ijackson (at) chiark.greenend.org.uk.  Or talk to
 any Fleet Officer or above of the crew Special Circumstances on the
 Midnight Ocean.
 
+</div>
 <& footer, isdevel => 1 &>
index 9feaa6b651d02f6d60aa068ee3e004eb19f5cd81..02cbeebdc90ba63569582c2fbd3bd21fa90ae9e2 100755 (executable)
 
 </%doc>
 <html lang="en"><head><title>Website documentation - YARRG</title>
+<link rel="stylesheet" type="text/css" href="style.css">
 </head><body>
 
+<div class="navoptbar">
 <a href="lookup">YARRG</a> -
  Yet Another Revenue Research Gatherer
 |
@@ -44,6 +46,8 @@
 <b>documentation</b>
 |
 <a href="devel">development</a>
+</div>
+<div class="docs">
 
 <h1>Looking up data in YARRG</h1>
 
@@ -202,4 +206,5 @@ them for 20 PoE each, and then buy 2000 beans at B for 10 PoE each and
 sail them to C to sell for 20 PoE each even if such a trade would in
 fact be possible.  In practice this is unlikely to be a problem!
 
+</div>
 <& footer &>
index 739f14d8b04f8eb3a8993f3572637c9f804ce22d..4e1fb3e5215e743ec7be8f06b505ecd82f44a2a8 100644 (file)
@@ -59,7 +59,7 @@ $cols => $sth->{NAME}
 $qa => undef
 </%args>
 %      if (!$qa || $qa->{'debug'}) {
-<table frame=box rules=all>
+<table class="data" frame=box rules=all>
 <tr>
 %              foreach my $field (@$cols) {
 <th><% $field |h %>
index 1580b2c9cd1ef4a4e1a73de36a92b7fc0f6ab758..8e993a0034254d7586dd13b315d3d68f13c7d1b1 100755 (executable)
 </%doc>
 <html lang="en"><head>
 <title>YARRG (Yet Another Revenue Research Gatherer)</title>
+<link rel="stylesheet" type="text/css" href="style.css">
 </head><body>
 
+<div class="navoptbar">
 <a href="lookup">YARRG</a> -
  Yet Another Revenue Research Gatherer
 |
@@ -45,7 +47,8 @@
 <a href="docs">documentation</a>
 |
 <a href="devel">development</a>
-
+</div>
+<div class="docs">
 <h1>Introduction to YARRG</h1>
 
 YARRG (Yet Another Revenue Research Gatherer) is a third-party tool
@@ -122,4 +125,5 @@ Email Ian Jackson ijackson (at) chiark.greenend.org.uk.  Or talk to
 any Fleet Officer or above of the crew Special Circumstances on the
 Midnight Ocean.
 
+</div>
 <& footer &>
index 56b34fc36fb09d228cb4d9598f5c138a507ef444..365ed58129407277626411e60f96b8bc8fe2ba1e 100755 (executable)
@@ -128,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) {
@@ -147,6 +148,7 @@ tr.datarow1 { background: #ffffff; }
 </head><body>
 
 % if (!printable($m)) {
+<div class="navoptbar">
 <a href="<% $m->current_comp()->name() |u %>">YARRG</a> -
  Yet Another Revenue Research Gatherer
 |
@@ -255,6 +257,7 @@ $debug => 0
 </%args>
 
 % if (!printable($m)) {
+</div>
 <hr>
 % }
 
@@ -272,15 +275,14 @@ $debug => 0
     }
  &>
 
-<p>
-
 %#---------- debugging and epilogue ----------
 
 % if ($debug) {
-<p>
+<div class="results">
 <pre id="debug_log">
 Debug log:
 </pre>
+</div>
 % }
 
 <&| script &>
index 7cfe54e291799e6c8daa53ec0207c0f4d37eeead..fd2044d97b4463457d88776b71dc0000b45590ea 100644 (file)
@@ -52,6 +52,7 @@ my $sth= $dbh->prepare("SELECT archipelago, islandid, islandname, timestamp
 $sth->execute();
 
 </%perl>
+<div class="results">
 
 <& SELF:pageload &>
 <%method pageload>
@@ -69,12 +70,11 @@ $sth->execute();
   $now
   $fetchrow
 </%args>
-<table id="ts_table">
+<table class="data" id="ts_table" rules="groups">
 <tr>
 <th>Archipelago
 <th>Island
 <th>Age
-</tr>
 % my $row;
 % my %da_ages;
 % my %ts_sortkeys;
@@ -142,6 +142,7 @@ Time since this page loaded:
 <& "lookup:formhidden", ours => sub { 0; } &>
 </form>
 
+</div>
 <%init>
 use POSIX;
 use CommodsWeb;
index 3b2bf3554533f40a334d63690dac86f023b16764..8d55f2686130568ba92d2c578dd787d2362e368e 100644 (file)
@@ -50,6 +50,7 @@ my ($commodname,$cmid);
 my $qa= \%ARGS;
 </%perl>
 
+<div class="query">
 <h1>Commodity enquiry</h1>
 
 % $prselector->('BuySell');
@@ -69,10 +70,13 @@ my $qa= \%ARGS;
 </form>
 
 %#========== results ==========
+</div>
+<div class="results">
 <%perl>
 
 $emsgokorprint->($emsg) or $cmid=undef;
-return unless defined $cmid;
+print("</div>"), return
+       unless defined $cmid;
 $someresults->();
 
 #---------- actually compute the results and print them ----------
@@ -109,7 +113,7 @@ foreach my $bs (split /_/, $ARGS{BuySell}) {
 %      my $rowix= 0;
 %      while ($island= $islands->fetchrow_hashref) {
 %              if (!$rowix) {
-<table id="<% $bs %>_table" rules=groups>
+<table class="data" id="<% $bs %>_table" rules=groups>
 <colgroup span=2>
 <colgroup span=1>
 <colgroup span=2>
@@ -212,3 +216,4 @@ No offers.
 <%perl>
 }
 </%perl>
+</div>
index 76f45c0da52f143bb39fd7de472c5a1118539cdf..779d80407dc767857e2a74fd389e07432a6b0f96 100644 (file)
@@ -54,6 +54,7 @@ my ($commodname,$cmid);
 my $qa= \%ARGS;
 </%perl>
 
+<div class="query">
 <h1>Prices for commodity at location(s)</h1>
 
 % $prselector->('BuySell');
@@ -79,12 +80,15 @@ my $qa= \%ARGS;
 <& "lookup:formhidden", ours => $ours &>
 
 </form>
+</div>
+<div class="results">
 
 %#========== results ==========
 <%perl>
 
 $emsgokorprint->($emsg) or $cmid=undef;
-return unless defined $cmid and @islandids;
+print("</div>"), return
+       unless defined $cmid and @islandids;
 
 foreach my $wf (@warningfs) { $wf->(); }
 
@@ -166,7 +170,7 @@ foreach my $bs (split /_/, $qa->{BuySell}) {
 </%perl>
 %      while ($row= $sth->fetchrow_arrayref) {
 %              if (!$rowix) {
-<table id="<% $bs %>_table" rules=groups>
+<table class="data" id="<% $bs %>_table" rules=groups>
 <colgroup span=2>
 <colgroup span=3>
 <colgroup span=1>
@@ -221,3 +225,5 @@ database.  This will be a pain for you to program, slow to run, and
 pointlessly overload our server.  Instead, see our
 <a href="devel">information for developers</a>
 to find out how to get testing data or a real-time feed.)
+
+</div>
index fb32bcdd705017d6ad82f7da4a3344c55b44b47e..a4e9a067e1b4c40b9c31215ad1bcc9abaee3f2fb 100644 (file)
@@ -64,8 +64,6 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' };
 
 </%perl>
 
-<h1>Specify route</h1>
-
 % # Sadly we need to do this rather hacky thing to make it be a POST
 % #  form if the user has already selected some thing(s)
 % if (!$qa->{Dropdowns}) {
@@ -77,6 +75,10 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' };
 %      } (0..$qa->{Dropdowns}-1));
 % }
 
+<div class="query">
+
+<h1>Specify route</h1>
+
 % $prselector->('ShowStalls');
 
 <& enter_route, qa => $qa, dbh => $dbh, emsg_r => \$emsg,
@@ -100,6 +102,8 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' };
 % };
 <& "lookup:formhidden", ours => $ours &>
 
+</div>
+<div class="results">
 <%perl>
 #========== results ==========
 
@@ -122,4 +126,5 @@ foreach my $warningf (@warningfs) {
    routeparams => $routeparams
  &>
 % }
+</div>
 </form>
index 89a81371845c06069fe43b197a6ad8d945e89abb..9c583b8899338489228249fef319dc360e7d3883 100644 (file)
@@ -67,6 +67,7 @@ my $maxcountea=15;
 
 </%perl>
 
+<div class="query">
 <h1>Find most profitable routes and trades</h1>
 
 % if ($qa->{Dropdowns}) {
@@ -102,6 +103,8 @@ This feature is not available from the "drop down menus" interface.
 % }
 
 </form>
+</div>
+<div class="results">
 <%perl>
 
 if (!$emsg && $maxdist > $maxmaxdist) {
@@ -109,10 +112,12 @@ if (!$emsg && $maxdist > $maxmaxdist) {
                " supported, sorry.";
 }
 
-$emsgokorprint->($emsg) or return;
-@islandids or return;
-$allargs->{'submit'} or return;
-defined $routeparams->{MaxMass} or defined $routeparams->{MaxVolume} or return;
+print("</div>"), return
+     unless $emsgokorprint->($emsg)
+       and @islandids
+       and $allargs->{'submit'}
+       and (defined $routeparams->{MaxMass} or
+            defined $routeparams->{MaxVolume});
 
 #---------- prepare island names ----------
 
@@ -273,7 +278,7 @@ $someresults->();
 %      } else {
 <h2>Best routes for profit per league</h2>
 %      }
-<table rules=groups id="ap<% $ap %>_table">
+<table class="data" rules=groups id="ap<% $ap %>_table">
 <colgroup span=2>
 <colgroup span=1>
 <colgroup span=1>
@@ -293,7 +298,6 @@ $someresults->();
 <th>Start
 <th>Via
 <th>Finish
-<tr>
 <tr id="ap<% $ap %>_sortrow"><th><th><th><th><th><th><th>
 %      my $datarow=0;
 %      my %sortkeys;
@@ -345,7 +349,4 @@ Per league values count each island visited as one
 to be sailed.  All profit figures are somewhat approximate; get a
 complete trading plan for a route for accurate information.
 
-<%perl>
-
-
-</%perl>
+</div>
index 09e908b1ac44e160fb817dacb612a8c746e19b67..ce319facae713bb9e32edddf86a1509d979b4772 100644 (file)
@@ -625,7 +625,7 @@ Generated by YARRG at <strong><%
 %
 <h2><a name="plan">Voyage trading plan</a></h2>
 
-<table rules=groups <% printable($m) ? 'width=100%' : '' %> >
+<table class="data" rules=groups <% printable($m) ? 'width=100%' : '' %> >
 % my $tbody= sub {
 %      if (!printable($m)) { return '<tbody>'; }
 %#  return "<tr><td colspan=7><hr>";
@@ -857,7 +857,7 @@ Islands shown in reverse order of visits.<br>
 %      my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : '';
 %      my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
 <h2><a name="trades">Relevant trades</a></h2>
-<table id="trades" rules=groups>
+<table class="data" id="trades" rules=groups>
 <colgroup span=1>
 <colgroup span=2>
 <% $qa->{ShowStalls} ? '<colgroup span=2>' : '' %>
@@ -965,7 +965,7 @@ Islands shown in reverse order of visits.<br>
        throw => 'trades_sort', tbrow => 'trades_total' &>
   ts_sortkeys= <% to_json_protecttags(\%ts_sortkeys) %>;
 </&tabsort>
-
+<p>
 <input type=submit name=update value="Update">
 
 % } # !printable
diff --git a/yarrg/web/style.css b/yarrg/web/style.css
new file mode 100755 (executable)
index 0000000..a397e5c
--- /dev/null
@@ -0,0 +1,48 @@
+<%doc>
+
+ This is part of the YARRG website.  YARRG is a tool and website
+ for assisting players of Yohoho Puzzle Pirates.
+
+ Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+ Copyright (C) 2009 Clare Boothby
+
+  YARRG's client code etc. is covered by the ordinary GNU GPL (v3 or later).
+  The YARRG website is covered by the GNU Affero GPL v3 or later, which
+   basically means that every installation of the website will let you
+   download the source.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+ Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+ are used without permission.  This program is not endorsed or
+ sponsored by Three Rings.
+
+
+ This Mason component generates the top-level stylesheet which applies
+ to everything including lookups and documentation.
+
+</%doc>
+<%flags>
+inherit => undef
+</%flags>
+<%init>
+$r->content_type('text/css')
+  if $m->callers(-1) == $m->callers(0);
+</%init>
+
+  body { margin: 0; }
+  div.navoptbar { padding: 1em; background: #e0e0ff; }
+  address { background: #d7d8b3; padding: 1em; }
+  div.docs { padding: 1em; }
+  hr { display: none; }