From: Marius Gavrilescu Date: Sat, 18 Jun 2016 23:32:19 +0000 (+0100) Subject: Display brand, model, stock and price on details page X-Git-Tag: 0.000_008~2 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=2f1de030471417c7be33909e5787d2b42343c6a7;p=app-web-oof.git Display brand, model, stock and price on details page --- diff --git a/lib/App/Web/Oof.pm b/lib/App/Web/Oof.pm index 23fd09a..9c62d54 100644 --- a/lib/App/Web/Oof.pm +++ b/lib/App/Web/Oof.pm @@ -282,6 +282,17 @@ sub details_app { $tree->fid('pictures')->find('li')->iter3(\@pics, \&details_list_element); $tree->fid('jsonld')->replace_content(encode_json product_to_schemaorg '', %data); + $tree->fid('dd_stock')->replace_content($data{stock}); + $tree->fid('dd_price')->replace_content(stringify_money $data{price}); + for (qw/brand model/) { + if ($data{$_}) { + $tree->fid("dd_$_")->replace_content($data{$_}); + } else { + $tree->fid("dt_$_")->detach; + $tree->fid("dd_$_")->detach; + } + } + for my $ahref ($tree->find('a')) { $ahref->attr(href => "/form?highlight=$id") if $ahref->attr('href') eq '/'; } diff --git a/static/style.css b/static/style.css index 0c289f1..ada9247 100644 --- a/static/style.css +++ b/static/style.css @@ -124,4 +124,8 @@ footer { padding-top: 1em; font-size: 0.8em; text-align: center; -} \ No newline at end of file +} + +dt { + font-weight: bold; +} diff --git a/tmpl/details.html b/tmpl/details.html index 85deb0a..5f6e17a 100644 --- a/tmpl/details.html +++ b/tmpl/details.html @@ -12,6 +12,12 @@

Item

Go to order form. +

+
Brand
+
Model
+
Stock
+
Price
+