X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Froutetrade;h=41340201bfc8f4d7ab99d2e87a65046d6178b784;hp=27cf295d19376abb8451f7dbba43f972a7aab100;hb=4ee718187692e362a0e274020a0ad61701f1b2de;hpb=5d7aa1e2df29f74f0fbaa8dcb21fa1f7921f30a8 diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 27cf295..4134020 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -695,12 +695,26 @@ SELECT commodclass, maxposinclass FROM commodclasses WHERE commodclassid = ? END $findclass->execute($f->{'commodclassid'}); my $classinfo= $findclass->fetchrow_hashref(); - $$todo->{'posinclass'}= - sprintf "(%s %d/%d)", - $classinfo->{'commodclass'}, - $f->{'posinclass'}, - $classinfo->{'maxposinclass'} - if $classinfo->{'maxposinclass'} > 9; + if ($classinfo->{'maxposinclass'} >= 8) { + my $maxpic= $classinfo->{'maxposinclass'}; + my $inpic= $f->{'posinclass'}; + my @tmbs= qw(TT T M B BB); + my @tmbds= ( 'in Top fifth of list', + 'in 2nd fifth of the list', + 'in Middle fifth of the list', + 'in 2nd-bottom fifth of list', + 'in Bottom fifth of the list'); + my $tmbi= ($inpic+0.5)*$#tmbs/$maxpic; + my $desc= (sprintf "%s is under %s,". + " commodity %d of %d;". + " i.e. %s or %s", + $f->{'commodname'}, + $classinfo->{'commodclass'}, + $inpic, $maxpic, + $tmbs[$tmbi], $tmbds[$tmbi]); + $$todo->{'posinclass'}= + "
$tmbs[$tmbi]
"; + } } $$todo->{'stallname'}= $stallname; $$todo->{Price}= $price; @@ -764,7 +778,7 @@ END % tr_datarow($m,$dline); <<% $td %>><% $collectdeliver %> <<% $td %>><% $t->{'commodname'} |h %> -<<% $td %>><% $t->{'posinclass'} |h %> +<<% $td %>><% $t->{'posinclass'} %> % % my @stalls= sort keys %{ $t->{Stalls} }; % my $pstall= sub {