Rebranded to Tailbone.

This commit is contained in:
Lance Edgar 2013-09-01 07:27:47 -07:00
parent 47944767dc
commit 40efd8a3bc
111 changed files with 188 additions and 209 deletions

View file

@ -0,0 +1,44 @@
<%def name="autocomplete(field_name, service_url, field_value=None, field_display=None, width='300px', selected=None, cleared=None)">
<div id="${field_name}-container" class="autocomplete-container">
${h.hidden(field_name, id=field_name, value=field_value)}
${h.text(field_name+'-textbox', id=field_name+'-textbox', value=field_display,
class_='autocomplete-textbox', style='display: none;' if field_value else '')}
<div id="${field_name}-display" class="autocomplete-display"${'' if field_value else ' style="display: none;"'|n}>
<span>${field_display or ''}</span>
<button type="button" id="${field_name}-change" class="autocomplete-change">Change</button>
</div>
</div>
<script type="text/javascript">
$(function() {
$('#${field_name}-textbox').autocomplete({
source: '${service_url}',
autoFocus: true,
focus: function(event, ui) {
return false;
},
select: function(event, ui) {
$('#${field_name}').val(ui.item.value);
$('#${field_name}-display span:first').text(ui.item.label);
$('#${field_name}-textbox').hide();
$('#${field_name}-display').show();
% if selected:
${selected}(ui.item.value, ui.item.label);
% endif
return false;
}
});
$('#${field_name}-change').click(function() {
$('#${field_name}').val('');
$('#${field_name}-display').hide();
with ($('#${field_name}-textbox')) {
val('');
show();
focus();
}
% if cleared:
${cleared}();
% endif
});
});
</script>
</%def>

View file

@ -0,0 +1,11 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Batches", url('batches'))}</li>
<li>${h.link_to("View Batch Rows", url('batch.rows', uuid=form.fieldset.model.uuid))}</li>
% if not form.readonly:
<li>${h.link_to("View this Batch", url('batch.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,5 @@
<%inherit file="/grid.mako" />
<%def name="title()">Batches</%def>
${parent.body()}

View file

@ -0,0 +1,42 @@
<%inherit file="/base.mako" />
<%def name="title()">Batch Parameters</%def>
<%def name="head_tags()">
${parent.head_tags()}
<script language="javascript" type="text/javascript">
$(function() {
$('#create-batch').click(function() {
disable_button(this, "Creating batch");
disable_button('#cancel');
$('form').submit();
});
});
</script>
</%def>
<%def name="batch_params()"></%def>
<p>Please provide the following values for your new batch:</p>
<br />
<div class="form">
${h.form(request.get_referrer())}
${h.hidden('provider', value=provider)}
${h.hidden('params', value='True')}
${self.batch_params()}
<div class="buttons">
<button type="button" id="create-batch">Create Batch</button>
<button type="button" id="cancel" onclick="location.href = '${request.get_referrer()}';">Cancel</button>
</div>
${h.end_form()}
</div>

View file

@ -0,0 +1,19 @@
<%inherit file="/batches/params.mako" />
<%def name="batch_params()">
<div class="field-wrapper">
<label for="profile">Label Type</label>
<div class="field">
${h.select('profile', None, label_profiles)}
</div>
</div>
<div class="field-wrapper">
<label for="quantity">Quantity</label>
<div class="field">${h.text('quantity', value=1)}</div>
</div>
</%def>
${parent.body()}

View file

@ -0,0 +1,40 @@
<%inherit file="/batches/crud.mako" />
<%def name="context_menu_items()">
${parent.context_menu_items()}
<li>${h.link_to("Edit this Batch", url('batch.update', uuid=form.fieldset.model.uuid))}</li>
<li>${h.link_to("Delete this Batch", url('batch.delete', uuid=form.fieldset.model.uuid))}</li>
</%def>
${parent.body()}
<% batch = form.fieldset.model %>
<h2>Columns</h2>
<div class="grid full hoverable">
<table>
<thead>
<tr>
<th>Name</th>
<th>SIL Name</th>
<th>Display Name</th>
<th>Description</th>
<th>Data Type</th>
<th>Visible</th>
</tr>
</thead>
<tbody>
% for i, column in enumerate(batch.columns, 1):
<tr class="${'odd' if i % 2 else 'even'}">
<td>${column.name}</td>
<td>${column.sil_name}</td>
<td>${column.display_name}</td>
<td>${column.description}</td>
<td>${column.data_type}</td>
<td>${column.visible}</td>
</tr>
% endfor
</tbody>
</table>
</div>

View file

@ -0,0 +1,8 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Batch", url('batch.read', uuid=form.fieldset.model.batch.uuid))}</li>
<li>${h.link_to("Back to Batch Rows", url('batch.rows', uuid=form.fieldset.model.batch.uuid))}</li>
</%def>
${parent.body()}

View file

@ -0,0 +1,46 @@
<%inherit file="/grid.mako" />
<%def name="title()">Batch Rows : ${batch.description}</%def>
<%def name="head_tags()">
${parent.head_tags()}
<script language="javascript" type="text/javascript">
$(function() {
$('#delete-results').click(function() {
var msg = "This will delete all rows matching the current search.\n\n"
+ "PLEASE NOTE that this may include some rows which are not visible "
+ "on your screen.\n(I.e., if there is more than one \"page\" of results.)\n\n"
+ "Are you sure you wish to delete these rows?";
if (confirm(msg)) {
disable_button(this, "Deleting rows");
location.href = '${url('batch.rows.delete', uuid=batch.uuid)}';
}
});
$('#execute-batch').click(function() {
if (confirm("Are you sure you wish to execute this batch?")) {
disable_button(this, "Executing batch");
location.href = '${url('batch.execute', uuid=batch.uuid)}';
}
});
});
</script>
</%def>
<%def name="context_menu_items()">
<li>${h.link_to("Back to Batches", url('batches'))}</li>
<li>${h.link_to("Back to Batch", url('batch.read', uuid=batch.uuid))}</li>
</%def>
<%def name="tools()">
<div class="buttons">
<button type="button" id="delete-results">Delete Results</button>
<button type="button" id="execute-batch">Execute Batch</button>
</div>
</%def>
${parent.body()}

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Brands", url('brands'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Brand", url('brand.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Brand", url('brand.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Brands</%def>
<%def name="context_menu_items()">
% if request.has_perm('brands.create'):
<li>${h.link_to("Create a new Brand", url('brand.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Categories", url('categories'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Category", url('category.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Category", url('category.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Categories</%def>
<%def name="context_menu_items()">
% if request.has_perm('categories.create'):
<li>${h.link_to("Create a new Category", url('category.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,20 @@
<%inherit file="/form.mako" />
<%def name="title()">${"New "+form.pretty_name if form.creating else form.pretty_name+' : '+capture(self.model_title)}</%def>
<%def name="model_title()">${h.literal(str(form.fieldset.model))}</%def>
<%def name="head_tags()">
${parent.head_tags()}
<script type="text/javascript">
$(function() {
$('a.delete').click(function() {
if (! confirm("Do you really wish to delete this object?")) {
return false;
}
});
});
</script>
</%def>
${parent.body()}

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Customer Groups", url('customer_groups'))}</li>
% if form.readonly and request.has_perm('customer_groups.update'):
<li>${h.link_to("Edit this Customer Group", url('customer_group.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Customer Group", url('customer_group.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Customer Groups</%def>
<%def name="context_menu_items()">
% if request.has_perm('customer_groups.create'):
<li>${h.link_to("Create a new Customer Group", url('customer_group.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Customers", url('customers'))}</li>
% if form.readonly and request.has_perm('customers.update'):
<li>${h.link_to("Edit this Customer", url('customer.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Customer", url('customer.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,5 @@
<%inherit file="/grid.mako" />
<%def name="title()">Customers</%def>
${parent.body()}

View file

@ -0,0 +1,51 @@
<%inherit file="/customers/crud.mako" />
${parent.body()}
<% customer = form.fieldset.model %>
<h2>People</h2>
% if customer.people:
<p>Customer account is associated with the following people:</p>
<div class="grid clickable">
<table>
<thead>
<th>First Name</th>
<th>Last Name</th>
</thead>
<tbody>
% for i, person in enumerate(customer.people, 1):
<tr class="${'odd' if i % 2 else 'even'}" url="${url('person.read', uuid=person.uuid)}">
<td>${person.first_name or ''}</td>
<td>${person.last_name or ''}</td>
</tr>
% endfor
</tbody>
</table>
</div>
% else:
<p>Customer account is not associated with any people.</p>
% endif
<h2>Groups</h2>
% if customer.groups:
<p>Customer account belongs to the following groups:</p>
<div class="grid clickable">
<table>
<thead>
<th>ID</th>
<th>Name</th>
</thead>
<tbody>
% for i, group in enumerate(customer.groups, 1):
<tr class="${'odd' if i % 2 else 'even'}" url="${url('customer_group.read', uuid=group.uuid)}">
<td>${group.id}</td>
<td>${group.name or ''}</td>
</tr>
% endfor
</tbody>
</table>
</div>
% else:
<p>Customer account doesn't belong to any groups.</p>
% endif

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Departments", url('departments'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Department", url('department.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Department", url('department.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Departments</%def>
<%def name="context_menu_items()">
% if request.has_perm('departments.create'):
<li>${h.link_to("Create a new Department", url('department.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Employees", url('employees'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Employee", url('employee.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Employee", url('employee.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,5 @@
<%inherit file="/grid.mako" />
<%def name="title()">Employees</%def>
${parent.body()}

View file

@ -0,0 +1,3 @@
<%namespace file="/autocomplete.mako" import="autocomplete" />
${autocomplete(field_name, service_url, field_value, field_display, width=width, selected=selected, cleared=cleared)}

View file

@ -0,0 +1,63 @@
<div ${grid.div_attrs()}>
<table>
<thead>
<tr>
% if grid.checkboxes:
<th class="checkbox">${h.checkbox('check-all')}</th>
% endif
% for field in grid.iter_fields():
${grid.column_header(field)}
% endfor
% for col in grid.extra_columns:
<th>${col.label}</td>
% endfor
% if grid.viewable:
<th>&nbsp;</th>
% endif
% if grid.editable:
<th>&nbsp;</th>
% endif
% if grid.deletable:
<th>&nbsp;</th>
% endif
</tr>
</thead>
<tbody>
% for i, row in enumerate(grid.iter_rows(), 1):
<tr ${grid.get_row_attrs(row, i)}>
% if grid.checkboxes:
<td class="checkbox">${grid.checkbox(row)}</td>
% endif
% for field in grid.iter_fields():
<td class="${grid.cell_class(field)}">${grid.render_field(field)}</td>
% endfor
% for col in grid.extra_columns:
<td class="${col.name}">${col.callback(row)}</td>
% endfor
% if grid.viewable:
<td class="view" url="${grid.get_view_url(row)}">&nbsp;</td>
% endif
% if grid.editable:
<td class="edit" url="${grid.get_edit_url(row)}">&nbsp;</td>
% endif
% if grid.deletable:
<td class="delete" url="${grid.get_delete_url(row)}">&nbsp;</td>
% endif
</tr>
% endfor
</tbody>
</table>
% if grid.pager:
<div class="pager">
<p class="showing">
showing ${grid.pager.first_item} thru ${grid.pager.last_item} of ${grid.pager.item_count}
(page ${grid.pager.page} of ${grid.pager.page_count})
</p>
<p class="page-links">
${h.select('grid-page-count', grid.pager.items_per_page, grid.page_count_options())}
per page&nbsp;
${grid.page_links()}
</p>
</div>
% endif
</div>

View file

@ -0,0 +1,26 @@
<%inherit file="/crud.mako" />
<%def name="head_tags()">
${parent.head_tags()}
<style type="text/css">
div.form div.field-wrapper.format textarea {
width: auto;
}
</style>
</%def>
<%def name="context_menu_items()">
<li>${h.link_to("Back to Label Profiles", url('label_profiles'))}</li>
% if form.updating:
<% profile = form.fieldset.model %>
<% printer = profile.get_printer() %>
% if printer and printer.required_settings:
<li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li>
% endif
<li>${h.link_to("View this Label Profile", url('label_profile.read', uuid=profile.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Label Profiles</%def>
<%def name="context_menu_items()">
% if request.has_perm('label_profiles.create'):
<li>${h.link_to("Create a new Label Profile", url('label_profile.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,48 @@
<%inherit file="/base.mako" />
<%def name="title()">Printer Settings</%def>
<%def name="context_menu_items()">
<li>${h.link_to("Back to Label Profiles", url('label_profiles'))}</li>
<li>${h.link_to("View this Label Profile", url('label_profile.read', uuid=profile.uuid))}</li>
<li>${h.link_to("Edit this Label Profile", url('label_profile.update', uuid=profile.uuid))}</li>
</%def>
<div class="form-wrapper">
<ul class="context-menu">
${self.context_menu_items()}
</ul>
<div class="form">
<div class="field-wrapper">
<label>Label Profile</label>
<div class="field">${profile.description}</div>
</div>
<div class="field-wrapper">
<label>Printer Spec</label>
<div class="field">${profile.printer_spec}</div>
</div>
${h.form(request.current_route_url())}
% for name, display in printer.required_settings.iteritems():
<div class="field-wrapper">
<label for="${name}">${display}</label>
<div class="field">
${h.text(name, value=profile.get_printer_setting(name))}
</div>
</div>
% endfor
<div class="buttons">
${h.submit('update', "Update")}
<button type="button" onclick="location.href = '${url('label_profile.read', uuid=profile.uuid)}';">Cancel</button>
</div>
${h.end_form()}
</div>
</div>

View file

@ -0,0 +1,32 @@
<%inherit file="/labels/profiles/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Label Profiles", url('label_profiles'))}</li>
% if form.readonly and request.has_perm('label_profiles.update'):
<% profile = form.fieldset.model %>
<% printer = profile.get_printer() %>
<li>${h.link_to("Edit this Label Profile", url('label_profile.update', uuid=form.fieldset.model.uuid))}</li>
% if printer and printer.required_settings:
<li>${h.link_to("Edit Printer Settings", url('label_profile.printer_settings', uuid=profile.uuid))}</li>
% endif
% endif
</%def>
${parent.body()}
<% profile = form.fieldset.model %>
<% printer = profile.get_printer() %>
% if printer and printer.required_settings:
<h2>Printer Settings</h2>
<div class="form">
% for name, display in printer.required_settings.iteritems():
<div class="field-wrapper">
<label>${display}</label>
<div class="field">${profile.get_printer_setting(name) or ''}</div>
</div>
% endfor
</div>
% endif

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to People", url('people'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Person", url('person.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Person", url('person.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View 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>

View 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()}

View 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()}

View 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>

View file

@ -0,0 +1,2 @@
<%inherit file="/base.mako" />
${parent.body()}

View file

@ -0,0 +1,29 @@
<%inherit file="/reports/base.mako" />
<%def name="title()">Report : Inventory Worksheet</%def>
<p>Please provide the following criteria to generate your report:</p>
<br />
${h.form(request.current_route_url())}
<div class="field-wrapper">
<label for="department">Department</label>
<div class="field">
<select name="department">
% for department in departments:
<option value="${department.uuid}">${department.name}</option>
% endfor
</select>
</div>
</div>
<div class="field">
${h.checkbox('weighted-only', label=h.literal("Include items sold by weight <strong>only</strong>."))}
</div>
<div class="buttons">
${h.submit('submit', "Generate Report")}
</div>
${h.end_form()}

View file

@ -0,0 +1,88 @@
<%inherit file="/reports/base.mako" />
<%def name="title()">Report : Ordering Worksheet</%def>
<%def name="head_tags()">
${parent.head_tags()}
<style type="text/css">
div.grid {
clear: none;
}
</style>
</%def>
<p>Please provide the following criteria to generate your report:</p>
<br />
${h.form(request.current_route_url())}
${h.hidden('departments', value='')}
<div class="field-wrapper">
${h.hidden('vendor', value='')}
<label for="vendor-name">Vendor:</label>
${h.text('vendor-name', size='40', value='')}
<div id="vendor-display" style="display: none;">
<span>(no vendor)</span>&nbsp;
<button type="button" id="change-vendor">Change</button>
</div>
</div>
<div class="field-wrapper">
<label>Departments:</label>
<div class="grid"></div>
</div>
<div class="field-wrapper">
${h.checkbox('preferred_only', label="Include only those products for which this vendor is preferred.", checked=True)}
</div>
<div class="buttons">
${h.submit('submit', "Generate Report")}
</div>
${h.end_form()}
<script type="text/javascript">
$(function() {
var autocompleter = $('#vendor-name').autocomplete({
serviceUrl: '${url('vendors.autocomplete')}',
width: 300,
onSelect: function(value, data) {
$('#vendor').val(data);
$('#vendor-name').hide();
$('#vendor-name').val('');
$('#vendor-display span').html(value);
$('#vendor-display').show();
loading($('div.grid'));
$('div.grid').load('${url('departments.by_vendor')}', {'uuid': data});
},
});
$('#vendor-name').focus();
$('#change-vendor').click(function() {
$('#vendor').val('');
$('#vendor-display').hide();
$('#vendor-name').show();
$('#vendor-name').focus();
$('div.grid').empty();
});
$('form').submit(function() {
var depts = [];
$('div.grid table tbody tr').each(function() {
if ($(this).find('td.checkbox input[type=checkbox]').is(':checked')) {
depts.push(get_uuid(this));
}
$('#departments').val(depts.toString());
return true;
});
});
});
</script>

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Stores", url('stores'))}</li>
% if form.readonly and request.has_perm('stores.update'):
<li>${h.link_to("Edit this Store", url('store.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Store", url('store.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Stores</%def>
<%def name="context_menu_items()">
% if request.has_perm('stores.create'):
<li>${h.link_to("Create a new Store", url('store.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Subdepartments", url('subdepartments'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Subdepartment", url('subdepartment.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Subdepartment", url('subdepartment.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Subdepartments</%def>
<%def name="context_menu_items()">
% if request.has_perm('subdepartments.create'):
<li>${h.link_to("Create a new Subdepartment", url('subdepartment.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Users", url('users'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this User", url('user.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this User", url('user.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

12
tailbone/templates/vendors/crud.mako vendored Normal file
View file

@ -0,0 +1,12 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Vendors", url('vendors'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Vendor", url('vendor.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Vendor", url('vendor.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

11
tailbone/templates/vendors/index.mako vendored Normal file
View file

@ -0,0 +1,11 @@
<%inherit file="/grid.mako" />
<%def name="title()">Vendors</%def>
<%def name="context_menu_items()">
% if request.has_perm('vendors.create'):
<li>${h.link_to("Create a new Vendor", url('vendor.create'))}</li>
% endif
</%def>
${parent.body()}