Various tweaks for support of native inventory

certaianly some other things made it in here too..
This commit is contained in:
Lance Edgar 2017-07-19 01:42:18 -05:00
parent eb68eec520
commit 61d504afb8
11 changed files with 129 additions and 16 deletions

View file

@ -10,6 +10,12 @@
var has_execution_options = ${'true' if master.has_execution_options else 'false'};
$(function() {
% if master.has_worksheet:
$('.load-worksheet').click(function() {
$(this).button('disable').button('option', 'label', "Working, please wait...");
location.href = '${url('{}.worksheet'.format(route_prefix), uuid=batch.uuid)}';
});
% endif
$('#refresh-data').click(function() {
$(this)
.button('option', 'disabled', true)
@ -50,7 +56,11 @@
</div>
</%def>
<%def name="leading_buttons()"></%def>
<%def name="leading_buttons()">
% if master.has_worksheet and not batch.executed and request.has_perm('{}.worksheet'.format(permission_prefix)):
<button type="button" class="load-worksheet">Edit as Worksheet</button>
% endif
</%def>
<%def name="refresh_button()">
% if master.viewing and master.batch_refreshable(batch) and request.has_perm('{}.refresh'.format(permission_prefix)):

View file

@ -0,0 +1,45 @@
## -*- coding: utf-8; -*-
<%inherit file="/base.mako" />
<%def name="extra_javascript()">
${parent.extra_javascript()}
<script type="text/javascript">
$(function() {
$('.worksheet .current-entry input').focus(function(event) {
$(this).parents('tr:first').addClass('active');
});
$('.worksheet .current-entry input').blur(function(event) {
$(this).parents('tr:first').removeClass('active');
});
});
</script>
</%def>
<%def name="extra_styles()">
${parent.extra_styles()}
<style type="text/css">
.worksheet tr.active {
border: 5px solid Blue;
}
.worksheet .current-entry {
text-align: center;
}
.worksheet .current-entry input {
text-align: center;
width: 3em;
}
</style>
</%def>
<%def name="worksheet_grid()"></%def>
${self.worksheet_grid()}