extensive commit (see note)
The following changes are included: - Added support for GPC data type. - Added eager import of ``rattail.sil`` in ``before_render`` hook. - Removed ``rattail.pyramid.util`` module. - Added initial batch support: views, templates, creation from Product grid. - Added batch params template for ``PrintLabels`` provider. - Added support for ``rattail.LabelProfile`` class. - Improved Product grid to include filter/sort on Vendor.
This commit is contained in:
parent
563a10a283
commit
cf10fe19e8
36 changed files with 1166 additions and 1529 deletions
|
@ -1,2 +0,0 @@
|
|||
<%inherit file="/base.mako" />
|
||||
${parent.body()}
|
|
@ -1,14 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/crud.mako" />
|
||||
|
||||
<%def name="crud_name()">Batch</%def>
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
% if fieldset.edit:
|
||||
<p>${h.link_to("View Batch Details", url('batch.details', uuid=fieldset.model.uuid))}</p>
|
||||
<p>${h.link_to("Execute this Batch", url('batch.execute', uuid=fieldset.model.uuid))}</p>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
<table class="fieldset">
|
||||
<tr>
|
||||
<td class="label">Columns</td>
|
||||
<td>
|
||||
${columns|n}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
8
rattail/pyramid/templates/batches/crud.mako
Normal file
8
rattail/pyramid/templates/batches/crud.mako
Normal file
|
@ -0,0 +1,8 @@
|
|||
<%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>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,12 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/index.mako" />
|
||||
|
||||
<%def name="title()">Batch : ${batch.name}</%def>
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
<p>${h.link_to("View Batch Properties", url('batch.edit', uuid=batch.uuid))}</p>
|
||||
<p>${h.link_to("Execute this Batch", url('batch.execute', uuid=batch.uuid))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,11 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/index.mako" />
|
||||
|
||||
<%def name="title()">Batch Dictionaries</%def>
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
## <p>${h.link_to("Create a New Dictionary", url('batch_dictionary'))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,9 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/crud.mako" />
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
<p>${h.link_to("Back to Dictionaries", url('batch_dictionaries'))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,8 +0,0 @@
|
|||
<table class="fieldset">
|
||||
<tr class="columns">
|
||||
<td class="label">Supported Columns</td>
|
||||
<td>
|
||||
${grid|n}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
|
@ -1,38 +1,5 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/index.mako" />
|
||||
<%inherit file="/grid.mako" />
|
||||
|
||||
<%def name="title()">Batches</%def>
|
||||
|
||||
<%def name="head_tags()">
|
||||
<style type="text/css">
|
||||
|
||||
div.grid table tbody td.rowcount {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$('div.grid table tbody td.action.execute a').live('click', function() {
|
||||
var tr = $(this).parents('tr:first');
|
||||
var desc = tr.find('td.description').text();
|
||||
if (confirm("Do you really wish to execute this batch?\n\n" + desc)) {
|
||||
var url = '${url('batch.execute', uuid='{uuid}')}';
|
||||
location.href = url.replace(/%7Buuid%7D/, get_uuid(this));
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="menu()">
|
||||
## <p>${h.link_to("Create a New Batch", url('batch.new'))}</p>
|
||||
<p>${h.link_to("Manage Terminals", url('batch_terminals'))}</p>
|
||||
<p>${h.link_to("View Dictionaries", url('batch_dictionaries'))}</p>
|
||||
<p>${h.link_to("SIL Columns", url('sil_columns'))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
||||
|
|
42
rattail/pyramid/templates/batches/params.mako
Normal file
42
rattail/pyramid/templates/batches/params.mako
Normal 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>
|
19
rattail/pyramid/templates/batches/params/print_labels.mako
Normal file
19
rattail/pyramid/templates/batches/params/print_labels.mako
Normal 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()}
|
40
rattail/pyramid/templates/batches/read.mako
Normal file
40
rattail/pyramid/templates/batches/read.mako
Normal 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>
|
8
rattail/pyramid/templates/batches/rows/crud.mako
Normal file
8
rattail/pyramid/templates/batches/rows/crud.mako
Normal file
|
@ -0,0 +1,8 @@
|
|||
<%inherit file="/crud.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to Batch", url('batch', 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()}
|
46
rattail/pyramid/templates/batches/rows/index.mako
Normal file
46
rattail/pyramid/templates/batches/rows/index.mako
Normal 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', 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()}
|
|
@ -1,9 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/crud.mako" />
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
<p>${h.link_to("Back to SIL Columns", url('sil_columns'))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,10 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/index.mako" />
|
||||
|
||||
<%def name="title()">SIL Columns</%def>
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
<table class="wrapper">
|
||||
|
||||
<tr>
|
||||
<td><h2>Supported Fields</h2></td>
|
||||
## <td class="right">${h.link_to("Update Field List", '#', id='update-fields')}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
${grid|n}
|
||||
|
||||
##<script language="javascript" type="text/javascript">
|
||||
##
|
||||
##$(function() {
|
||||
##
|
||||
## $('#update-fields').click(function() {
|
||||
## $('div.grid').load('${url('batches', action='update_terminal')}?uuid=${fieldset.model.uuid}');
|
||||
## return false;
|
||||
## });
|
||||
##
|
||||
##});
|
||||
##
|
||||
##</script>
|
|
@ -1,9 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/crud.mako" />
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
<p>${h.link_to("Back to Batch Terminals", url('batch_terminals'))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
|
@ -1,11 +0,0 @@
|
|||
<%inherit file="/batches/base.mako" />
|
||||
<%inherit file="/index.mako" />
|
||||
|
||||
<%def name="title()">Batch Terminals</%def>
|
||||
|
||||
<%def name="menu()">
|
||||
<p>${h.link_to("Back to Batches", url('batches.list'))}</p>
|
||||
<p>${h.link_to("Create a New Terminal", url('batch_terminal.new'))}</p>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
Loading…
Add table
Add a link
Reference in a new issue