Remove all views etc. for old-style batches

This commit is contained in:
Lance Edgar 2017-05-13 16:44:05 -05:00
parent 9e5b43ca66
commit 2d29174772
16 changed files with 45 additions and 906 deletions
tailbone/templates/products

View file

@ -9,38 +9,34 @@
<%def name="extra_javascript()">
${parent.extra_javascript()}
% if legacy_mode is Undefined:
<script type="text/javascript">
$(function() {
$('#batch_type').selectmenu({
change: function(event, ui) {
$('.params-wrapper').hide();
$('.params-wrapper.' + ui.item.value).show();
}
});
$('.params-wrapper.' + $('#batch_type').val()).show();
$('#make-batch').click(function() {
$(this).button('disable').button('option', 'label', "Working, please wait...");
$(this).parents('form:first').submit();
});
<script type="text/javascript">
$(function() {
$('#batch_type').selectmenu({
change: function(event, ui) {
$('.params-wrapper').hide();
$('.params-wrapper.' + ui.item.value).show();
}
});
</script>
% endif
$('.params-wrapper.' + $('#batch_type').val()).show();
$('#make-batch').click(function() {
$(this).button('disable').button('option', 'label', "Working, please wait...");
$(this).parents('form:first').submit();
});
});
</script>
</%def>
<%def name="extra_styles()">
${parent.extra_styles()}
% if legacy_mode is Undefined:
<style type="text/css">
.params-wrapper {
display: none;
}
</style>
% endif
<style type="text/css">
.params-wrapper {
display: none;
}
</style>
</%def>
<ul id="context-menu">
@ -51,38 +47,20 @@
${h.form(request.current_route_url())}
${h.csrf_token(request)}
% if legacy_mode is not Undefined:
${self.wtfield(form, 'batch_type')}
<div class="field-wrapper">
<label for="provider">Batch Type</label>
<div class="field">
${h.select('provider', None, providers)}
</div>
% for key, pform in params_forms.items():
<div class="params-wrapper ${key}">
% for name in pform._fields:
${self.wtfield(pform, name)}
% endfor
</div>
% endfor
<div class="buttons">
${h.submit('create', "Create Batch")}
${h.link_to("Cancel", url('products'), class_='button')}
</div>
% else: ## new-style batches
${self.wtfield(form, 'batch_type')}
% for key, pform in params_forms.items():
<div class="params-wrapper ${key}">
% for name in pform._fields:
${self.wtfield(pform, name)}
% endfor
</div>
% endfor
<div class="buttons">
<button type="button" id="make-batch">Create Batch</button>
${h.link_to("Cancel", url('products'), class_='button')}
</div>
% endif
<div class="buttons">
<button type="button" id="make-batch">Create Batch</button>
${h.link_to("Cancel", url('products'), class_='button')}
</div>
${h.end_form()}
</div>