pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit 9b3f35c22e2e0ac8c4ef06f9a8968e58ac413c54
parent f2719a07c9a8cdfbf09356c928b151270f693ee6
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Sun, 10 May 2015 17:37:21 -0600

tt: make column sizing perfect

Diffstat:
MDEPS | 1+
Mtt/coarse_list.tt | 5++++-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/DEPS b/DEPS @@ -10,6 +10,7 @@ p5-Lingua-EN-Inflect p5-Math-MatrixReal p5-SVG p5-Template +p5-Template-Plugin-POSIX p5-Term-ReadKey p5-Unix-Syslog p5-libwww diff --git a/tt/coarse_list.tt b/tt/coarse_list.tt @@ -1,4 +1,7 @@ [% WRAPPER wrapper.tt %] +[% USE POSIX %] +[% boundary = POSIX.ceil(list.keys.size / 3.0) %] + <h1>[% name %] ([% list.keys.size %])</h1> [% name_link = name.lower.replace('[ #\/]', '_') %] @@ -12,7 +15,7 @@ my ($logo) = glob("logo/$link.*"); $stash->set("logo", $logo); [% END %] - [% IF i != 0 && (i % ((list.keys.size / 3) + 1)) == 0 %] + [% IF i != 0 && (i % boundary) == 0 %] </ul> </div>