From 29010a75143814a91b4f5200454bea879280e7c1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 28 Oct 2009 22:20:14 +0000 Subject: [PATCH] WIP colouring in --- yarrg/web/autohandler | 8 +++++++- yarrg/web/devel | 4 ++++ yarrg/web/docs | 4 ++++ yarrg/web/dumptable | 2 +- yarrg/web/intro | 5 ++++- yarrg/web/lookup | 20 +++++++++++--------- yarrg/web/query_age | 4 ++-- yarrg/web/query_commod | 5 ++++- yarrg/web/query_offers | 5 ++++- yarrg/web/query_route | 4 ++++ yarrg/web/query_routesearch | 10 ++++------ yarrg/web/routetrade | 6 +++--- 12 files changed, 52 insertions(+), 25 deletions(-) diff --git a/yarrg/web/autohandler b/yarrg/web/autohandler index 8ff0996..8096e66 100644 --- a/yarrg/web/autohandler +++ b/yarrg/web/autohandler @@ -94,5 +94,11 @@ $r->content_type('text/html; charset=UTF-8'); which contains mostly contributions from YARRG users and is not covered by the AGPL. --> - + % $m->call_next(); diff --git a/yarrg/web/devel b/yarrg/web/devel index fecd77d..b29dc42 100755 --- a/yarrg/web/devel +++ b/yarrg/web/devel @@ -37,6 +37,7 @@ YARRG (Yet Another Revenue Research Gatherer) + +

YARRG development, contribution and troubleshooting

@@ -141,4 +144,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. +
<& footer, isdevel => 1 &> diff --git a/yarrg/web/docs b/yarrg/web/docs index 9feaa6b..6edf934 100755 --- a/yarrg/web/docs +++ b/yarrg/web/docs @@ -36,6 +36,7 @@ Website documentation - YARRG + +

Looking up data in YARRG

@@ -202,4 +205,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! +
<& footer &> diff --git a/yarrg/web/dumptable b/yarrg/web/dumptable index 739f14d..4e1fb3e 100644 --- a/yarrg/web/dumptable +++ b/yarrg/web/dumptable @@ -59,7 +59,7 @@ $cols => $sth->{NAME} $qa => undef % if (!$qa || $qa->{'debug'}) { - +
% foreach my $field (@$cols) {
<% $field |h %> diff --git a/yarrg/web/intro b/yarrg/web/intro index 825189b..87a2ab0 100755 --- a/yarrg/web/intro +++ b/yarrg/web/intro @@ -37,6 +37,7 @@ YARRG (Yet Another Revenue Research Gatherer) + +

Introduction to YARRG

YARRG (Yet Another Revenue Research Gatherer) is a third-party tool @@ -122,4 +124,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. +
<& footer &> diff --git a/yarrg/web/lookup b/yarrg/web/lookup index 56b34fc..6021531 100755 --- a/yarrg/web/lookup +++ b/yarrg/web/lookup @@ -128,12 +128,12 @@ $ours <% ucfirst $ahtml{Query} %> - YARRG <&| script &> function register_onload(f) { @@ -147,6 +147,7 @@ tr.datarow1 { background: #ffffff; } % if (!printable($m)) { +
% } @@ -271,16 +273,16 @@ $debug => 0 return 0; } &> - -

+ %#---------- debugging and epilogue ---------- % if ($debug) { -

+

 Debug log:
 
+
% } <&| script &> diff --git a/yarrg/web/query_age b/yarrg/web/query_age index 7cfe54e..419febc 100644 --- a/yarrg/web/query_age +++ b/yarrg/web/query_age @@ -52,6 +52,7 @@ my $sth= $dbh->prepare("SELECT archipelago, islandid, islandname, timestamp $sth->execute(); +
<& SELF:pageload &> <%method pageload> @@ -69,12 +70,11 @@ $sth->execute(); $now $fetchrow - +
% my $row; % my %da_ages; % my %ts_sortkeys; diff --git a/yarrg/web/query_commod b/yarrg/web/query_commod index 3b2bf35..153ea79 100644 --- a/yarrg/web/query_commod +++ b/yarrg/web/query_commod @@ -50,6 +50,7 @@ my ($commodname,$cmid); my $qa= \%ARGS; +

Commodity enquiry

% $prselector->('BuySell'); @@ -69,6 +70,8 @@ my $qa= \%ARGS; %#========== results ========== +
+
<%perl> $emsgokorprint->($emsg) or $cmid=undef; @@ -109,7 +112,7 @@ foreach my $bs (split /_/, $ARGS{BuySell}) { % my $rowix= 0; % while ($island= $islands->fetchrow_hashref) { % if (!$rowix) { -
Archipelago Island Age -
+
diff --git a/yarrg/web/query_offers b/yarrg/web/query_offers index 76f45c0..6dc70f4 100644 --- a/yarrg/web/query_offers +++ b/yarrg/web/query_offers @@ -54,6 +54,7 @@ my ($commodname,$cmid); my $qa= \%ARGS; +

Prices for commodity at location(s)

% $prselector->('BuySell'); @@ -79,6 +80,8 @@ my $qa= \%ARGS; <& "lookup:formhidden", ours => $ours &> +
+
%#========== results ========== <%perl> @@ -166,7 +169,7 @@ foreach my $bs (split /_/, $qa->{BuySell}) { % while ($row= $sth->fetchrow_arrayref) { % if (!$rowix) { -
+
diff --git a/yarrg/web/query_route b/yarrg/web/query_route index fb32bcd..eeb4331 100644 --- a/yarrg/web/query_route +++ b/yarrg/web/query_route @@ -64,6 +64,8 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' }; +
+

Specify route

% # Sadly we need to do this rather hacky thing to make it be a POST @@ -100,6 +102,8 @@ my $goupdate= sub { $be_post ? 'Update' : 'Go' }; % }; <& "lookup:formhidden", ours => $ours &> +
+
<%perl> #========== results ========== diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch index 89a8137..2816086 100644 --- a/yarrg/web/query_routesearch +++ b/yarrg/web/query_routesearch @@ -67,6 +67,7 @@ my $maxcountea=15; +

Find most profitable routes and trades

% if ($qa->{Dropdowns}) { @@ -102,6 +103,8 @@ This feature is not available from the "drop down menus" interface. % } +
+
<%perl> if (!$emsg && $maxdist > $maxmaxdist) { @@ -273,7 +276,7 @@ $someresults->(); % } else {

Best routes for profit per league

% } -
+
@@ -344,8 +347,3 @@ 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. - -<%perl> - - - diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 09e908b..ce319fa 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -625,7 +625,7 @@ Generated by YARRG at <% %

Voyage trading plan

-
> +
> % my $tbody= sub { % if (!printable($m)) { return ''; } %# return "' : '';

Relevant trades

-

"; @@ -857,7 +857,7 @@ Islands shown in reverse order of visits.
% my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : ''; % my $cdstall= $qa->{ShowStalls} ? '
Stall
+
<% $qa->{ShowStalls} ? '' : '' %> @@ -965,7 +965,7 @@ Islands shown in reverse order of visits.
throw => 'trades_sort', tbrow => 'trades_total' &> ts_sortkeys= <% to_json_protecttags(\%ts_sortkeys) %>; - +

% } # !printable -- 2.30.2