Rebranded to Tailbone.
This commit is contained in:
parent
47944767dc
commit
40efd8a3bc
111 changed files with 188 additions and 209 deletions
27
tailbone/templates/products/batch.mako
Normal file
27
tailbone/templates/products/batch.mako
Normal file
|
@ -0,0 +1,27 @@
|
|||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">Create Products Batch</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to Products", url('products'))}</li>
|
||||
</%def>
|
||||
|
||||
<div class="form">
|
||||
|
||||
${h.form(request.current_route_url())}
|
||||
|
||||
<div class="field-wrapper">
|
||||
<label for="provider">Batch Type</label>
|
||||
<div class="field">
|
||||
${h.select('provider', None, providers)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
${h.submit('create', "Create Batch")}
|
||||
<button type="button" onclick="location.href = '${url('products')}';">Cancel</button>
|
||||
</div>
|
||||
|
||||
${h.end_form()}
|
||||
|
||||
</div>
|
12
tailbone/templates/products/crud.mako
Normal file
12
tailbone/templates/products/crud.mako
Normal file
|
@ -0,0 +1,12 @@
|
|||
<%inherit file="/crud.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to Products", url('products'))}</li>
|
||||
% if form.readonly and request.has_perm('products.update'):
|
||||
<li>${h.link_to("Edit this Product", url('product.update', uuid=form.fieldset.model.uuid))}</li>
|
||||
% elif form.updating:
|
||||
<li>${h.link_to("View this Product", url('product.read', uuid=form.fieldset.model.uuid))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
107
tailbone/templates/products/index.mako
Normal file
107
tailbone/templates/products/index.mako
Normal file
|
@ -0,0 +1,107 @@
|
|||
<%inherit file="/grid.mako" />
|
||||
|
||||
<%def name="title()">Products</%def>
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
<style type="text/css">
|
||||
|
||||
table.grid-header td.tools table {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
table.grid-header td.tools table th,
|
||||
table.grid-header td.tools table td {
|
||||
padding: 0px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.grid-header td.tools table #label-quantity {
|
||||
text-align: right;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
div.grid table tbody td.size,
|
||||
div.grid table tbody td.regular_price_uuid,
|
||||
div.grid table tbody td.current_price_uuid {
|
||||
padding-right: 6px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.grid table tbody td.labels {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
% if label_profiles and request.has_perm('products.print_labels'):
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$('div.grid a.print-label').live('click', function() {
|
||||
var quantity = $('#label-quantity').val();
|
||||
if (isNaN(quantity)) {
|
||||
alert("You must provide a valid label quantity.");
|
||||
$('#label-quantity').select();
|
||||
$('#label-quantity').focus();
|
||||
} else {
|
||||
$.ajax({
|
||||
url: '${url('products.print_labels')}',
|
||||
data: {
|
||||
'product': get_uuid(this),
|
||||
'profile': $('#label-profile').val(),
|
||||
'quantity': quantity,
|
||||
},
|
||||
success: function(data) {
|
||||
if (data.error) {
|
||||
alert("An error occurred while attempting to print:\n\n" + data.error);
|
||||
} else if (quantity == '1') {
|
||||
alert("1 label has been printed.");
|
||||
} else {
|
||||
alert(quantity + " labels have been printed.");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="tools()">
|
||||
% if label_profiles and request.has_perm('products.print_labels'):
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Label</td>
|
||||
<td>Qty.</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<td>
|
||||
<select name="label-profile" id="label-profile">
|
||||
% for profile in label_profiles:
|
||||
<option value="${profile.uuid}">${profile.description}</option>
|
||||
% endfor
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="label-quantity" id="label-quantity" value="1" />
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if request.has_perm('products.create'):
|
||||
<li>${h.link_to("Create a new Product", url('product.create'))}</li>
|
||||
% endif
|
||||
% if request.has_perm('batches.create'):
|
||||
<li>${h.link_to("Create Batch from Results", url('products.create_batch'))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
59
tailbone/templates/products/read.mako
Normal file
59
tailbone/templates/products/read.mako
Normal file
|
@ -0,0 +1,59 @@
|
|||
<%inherit file="/products/crud.mako" />
|
||||
|
||||
${parent.body()}
|
||||
|
||||
<% product = form.fieldset.model %>
|
||||
|
||||
<div id="product-codes">
|
||||
<h2>Product Codes:</h2>
|
||||
% if product.codes:
|
||||
<div class="grid hoverable">
|
||||
<table>
|
||||
<thead>
|
||||
<th>Code</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
% for i, code in enumerate(product.codes, 1):
|
||||
<tr class="${'odd' if i % 2 else 'even'}">
|
||||
<td>${code}</td>
|
||||
</tr>
|
||||
% endfor
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
% else:
|
||||
<p>None on file.</p>
|
||||
% endif
|
||||
</div>
|
||||
|
||||
<div id="product-costs">
|
||||
<h2>Product Costs:</h2>
|
||||
% if product.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(product.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>
|
Loading…
Add table
Add a link
Reference in a new issue