improve Product view template
This commit is contained in:
parent
2cbe1a0c44
commit
4051d125c2
|
@ -1,4 +1,3 @@
|
||||||
<%inherit file="/products/base.mako" />
|
|
||||||
<%inherit file="/crud.mako" />
|
<%inherit file="/crud.mako" />
|
||||||
|
|
||||||
<%def name="context_menu_items()">
|
<%def name="context_menu_items()">
|
||||||
|
|
|
@ -1,2 +1,46 @@
|
||||||
<%inherit file="/products/crud.mako" />
|
<%inherit file="/products/crud.mako" />
|
||||||
|
|
||||||
|
<%def name="head_tags()">
|
||||||
|
${parent.head_tags()}
|
||||||
|
<style type="text/css">
|
||||||
|
|
||||||
|
#product-costs td.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</%def>
|
||||||
|
|
||||||
${parent.body()}
|
${parent.body()}
|
||||||
|
|
||||||
|
<div id="product-costs">
|
||||||
|
<h2>Product Costs:</h2>
|
||||||
|
% if fieldset.model.costs:
|
||||||
|
<div class="grid hoverable">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<th>Pref.</th>
|
||||||
|
<th>Vendor</th>
|
||||||
|
<th>Code</th>
|
||||||
|
<th>Case Size</th>
|
||||||
|
<th>Case Cost</th>
|
||||||
|
<th>Unit Cost</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
% for i, cost in enumerate(fieldset.model.costs, 1):
|
||||||
|
<tr class="${'odd' if i % 2 else 'even'}">
|
||||||
|
<td class="center">${'X' if cost.preference == 1 else ''}</td>
|
||||||
|
<td>${cost.vendor}</td>
|
||||||
|
<td class="center">${cost.code}</td>
|
||||||
|
<td class="center">${cost.case_size}</td>
|
||||||
|
<td class="right">${'$ %0.2f' % cost.case_cost if cost.case_cost is not None else ''}</td>
|
||||||
|
<td class="right">${'$ %0.4f' % cost.unit_cost if cost.unit_cost is not None else ''}</td>
|
||||||
|
</tr>
|
||||||
|
% endfor
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
% else:
|
||||||
|
<p>None on file.</p>
|
||||||
|
% endif
|
||||||
|
</div>
|
||||||
|
|
|
@ -143,6 +143,9 @@ class ProductCrud(Crud):
|
||||||
|
|
||||||
def fieldset(self, obj):
|
def fieldset(self, obj):
|
||||||
fs = self.make_fieldset(obj)
|
fs = self.make_fieldset(obj)
|
||||||
|
fs.upc.set(renderer=UpcFieldRenderer)
|
||||||
|
fs.regular_price.set(renderer=PriceFieldRenderer)
|
||||||
|
fs.current_price.set(renderer=PriceFieldRenderer)
|
||||||
fs.configure(
|
fs.configure(
|
||||||
include=[
|
include=[
|
||||||
fs.upc.label("UPC"),
|
fs.upc.label("UPC"),
|
||||||
|
@ -151,6 +154,8 @@ class ProductCrud(Crud):
|
||||||
fs.size,
|
fs.size,
|
||||||
fs.department,
|
fs.department,
|
||||||
fs.subdepartment,
|
fs.subdepartment,
|
||||||
|
fs.regular_price,
|
||||||
|
fs.current_price,
|
||||||
])
|
])
|
||||||
return fs
|
return fs
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue