pricecharts

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

commit 5181a783bc8ec0cd4294d92d105dd9004e148120
parent 3ba64050a7bcbf6e3d15409afaabbe513fb62578
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Sat,  4 Apr 2015 14:17:50 -0600

pc_fcgi: add manufacturer logos to search results

Diffstat:
Mpc_fcgi | 4++--
Mtt/search.tt | 6+++++-
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/pc_fcgi b/pc_fcgi @@ -72,8 +72,8 @@ my $config = { INCLUDE_PATH => "$http_cfg{htdocs}/tt" }; my $template = Template->new($config) || die $Template::ERROR . "\n"; # try hard here not to use EVAL_PERL in the template -my $sql = "select manufacturer, part_num, lower(part_num) from products " . - "where part_num like ? or manufacturer like ?"; +my $sql = "select manufacturer, part_num, lower(part_num), lower(manufacturer) ". + "from products where part_num like ? or manufacturer like ?"; my $search_sth = $dbh->prepare($sql); # intercept signals to shut down cleanly diff --git a/tt/search.tt b/tt/search.tt @@ -9,7 +9,11 @@ [% FOREACH part_num IN results %] <div class="product"> - <b>[% part_num.0 %]</b> [% part_num.1 %]<br> + <a href="/manufacturers/[% part_num.3 %].html"> + <img alt="[% part_num.0 %]" class="logo_small" + src="/logo/[% part_num.3 %].svg"/></a> + + [% part_num.1 %]<br> <object data="/svg/[% part_num.2 %].svg" type="image/svg+xml"> </object>