# Copyright (c) 2001-2005 bivio Software, Inc. All rights reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: item.bview,v 2.1 2005/08/10 15:32:53 nagler Exp $ # # Item detail # view_parent('menu'); view_put( header_title => 'Product Information', menu_content => Form('ItemForm', Grid([[ String(['Model.Item', '->format_name'], 'page_heading'), AmountCell({ field => ['Model.Item', 'list_price'], }), If( ['Model.Inventory', 'quantity'], Join([ AmountCell({ field => ['Model.Inventory', 'quantity'], decimals => 0, }), String(' in stock'), ]), # Else String('Back Ordered', 'error'), ), ImageFormButton({ image => 'add_to_cart', field => 'ok_button', alt => 'Add Item to Your Shopping Cart', }), ], [ Image( ['Model.Product', 'image_name'], Join([ ['Model.Item', '->format_name'], ': ', ['Model.Product', 'description'] ]), ), String(['Model.Product', 'description'], undef, { cell_colspan => 2, cell_align => 'S', }), ]], { id => 'item', string_font => 'page_text', pad => 5, }), ), ); view_pre_execute(sub { my($req) = @_; # load the item's product model and puts on the request (implicitly) $req->get('Model.Item')->get_model('Product'); return; });