Various tweaks for support of native inventory
certaianly some other things made it in here too..
This commit is contained in:
parent
eb68eec520
commit
61d504afb8
11 changed files with 129 additions and 16 deletions
|
@ -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)):
|
||||
|
|
45
tailbone/templates/batch/worksheet.mako
Normal file
45
tailbone/templates/batch/worksheet.mako
Normal 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()}
|
|
@ -8,7 +8,7 @@
|
|||
## ##############################################################################
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${model_title_plural}</%def>
|
||||
<%def name="title()">${index_title}</%def>
|
||||
|
||||
<%def name="extra_javascript()">
|
||||
${parent.extra_javascript()}
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
<%def name="title()">${model_title}</%def>
|
||||
|
||||
<%def name="content_title()">
|
||||
<h1>Row ${instance.sequence}</h1>
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
<li>${h.link_to("Back to {}".format(parent_model_title), index_url)}</li>
|
||||
% if master.rows_editable and instance_editable and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
% if master:
|
||||
<span class="global">»</span>
|
||||
% if master.listing:
|
||||
<span class="global">${model_title_plural}</span>
|
||||
<span class="global">${index_title}</span>
|
||||
% else:
|
||||
${h.link_to(index_title, index_url, class_='global')}
|
||||
% if instance_url is not Undefined:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue