chiark / gitweb /
Make colourful pages pass W3C HTML and CSS validators
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 29 Oct 2009 15:58:40 +0000 (15:58 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 29 Oct 2009 15:58:40 +0000 (15:58 +0000)
yarrg/web/autohandler
yarrg/web/devel
yarrg/web/docs
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/style.css [new file with mode: 0755]

index 8096e66a61ba23b41181904fab5b596c5a2a5405..8ff09966b953143dfd474a4a0d43c66913f47c38 100644 (file)
@@ -94,11 +94,5 @@ $r->content_type('text/html; charset=UTF-8');
     which contains mostly contributions from YARRG users and is not
     covered by the AGPL.
 -->
-<style type="text/css">
-  body { margin: 0; }
-  div.navoptbar { padding: 1em; background: #e0e0ff; }
-  address { background: #d7d8b3; padding: 1em; }
-  div.docs { padding: 1em; }
-  hr { display: none; }
-</style>
+
 % $m->call_next();
index b29dc421fc1b80762a6eef2bcca5d57653c366c6..fed459f5b8e1df457e9de2eaf8456944c76b9c3c 100755 (executable)
@@ -35,6 +35,7 @@
 </%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">
index 6edf934b4fb783ff6e499fea666bce836cfa49be..02cbeebdc90ba63569582c2fbd3bd21fa90ae9e2 100755 (executable)
@@ -34,6 +34,7 @@
 
 </%doc>
 <html lang="en"><head><title>Website documentation - YARRG</title>
+<link rel="stylesheet" type="text/css" href="style.css">
 </head><body>
 
 <div class="navoptbar">
index 87a2ab0fe0f9d0ceeb9ecba27ed9a2c1fd8993d6..13f553bafe7d0420f4f84fe7db553affb6fb2eb6 100755 (executable)
@@ -35,6 +35,7 @@
 </%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">
index 6021531c39b6b631fcf0c638db27ac2de0dca8f8..365ed58129407277626411e60f96b8bc8fe2ba1e 100755 (executable)
@@ -128,6 +128,7 @@ $ours
 
 <html lang="en"><head><title><% ucfirst $ahtml{Query} %> - YARRG</title>
 <style type="text/css">
+<& style.css &>
   body { color: #000000; background: #c5c7ae; }
   div.query { background: #d7d8b3; padding: 1em; }
   div.results { padding: 1em; }
@@ -273,7 +274,6 @@ $debug => 0
        return 0;
     }
  &>
-</div>
 
 %#---------- debugging and epilogue ----------
 
index 419febc976277efae36a682129fabd428c657061..fd2044d97b4463457d88776b71dc0000b45590ea 100644 (file)
@@ -142,6 +142,7 @@ Time since this page loaded:
 <& "lookup:formhidden", ours => sub { 0; } &>
 </form>
 
+</div>
 <%init>
 use POSIX;
 use CommodsWeb;
index 153ea792c92e7f9abcc9eac7472d37c72bdb7fca..8d55f2686130568ba92d2c578dd787d2362e368e 100644 (file)
@@ -75,7 +75,8 @@ my $qa= \%ARGS;
 <%perl>
 
 $emsgokorprint->($emsg) or $cmid=undef;
-return unless defined $cmid;
+print("</div>"), return
+       unless defined $cmid;
 $someresults->();
 
 #---------- actually compute the results and print them ----------
@@ -215,3 +216,4 @@ No offers.
 <%perl>
 }
 </%perl>
+</div>
index 6dc70f47d015f9813e828111c41c7ab6363b2066..779d80407dc767857e2a74fd389e07432a6b0f96 100644 (file)
@@ -87,7 +87,8 @@ my $qa= \%ARGS;
 <%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->(); }
 
@@ -224,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 eeb4331eb067b7645dadb2506995d0a4323d600b..a4e9a067e1b4c40b9c31215ad1bcc9abaee3f2fb 100644 (file)
@@ -64,10 +64,6 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' };
 
 </%perl>
 
-<div class="query">
-
-<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}) {
@@ -79,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,
@@ -126,4 +126,5 @@ foreach my $warningf (@warningfs) {
    routeparams => $routeparams
  &>
 % }
+</div>
 </form>
index 2816086c068c9ed39a92e2e0221c649048f3dee9..9c583b8899338489228249fef319dc360e7d3883 100644 (file)
@@ -112,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 ----------
 
@@ -296,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;
@@ -347,3 +348,5 @@ Per league values count each island visited as one
 (additional) league; the `Dist.' column is however the actual distance
 to be sailed.  All profit figures are somewhat approximate; get a
 complete trading plan for a route for accurate information.
+
+</div>
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; }