Exclude JS for refreshing batch unless it's relevant

This commit is contained in:
Lance Edgar 2018-01-06 19:26:31 -06:00
parent 50d6f1f95a
commit aa4051a7cd

View file

@ -16,12 +16,14 @@
location.href = '${url('{}.worksheet'.format(route_prefix), uuid=batch.uuid)}'; location.href = '${url('{}.worksheet'.format(route_prefix), uuid=batch.uuid)}';
}); });
% endif % endif
% if master.batch_refreshable(batch) and request.has_perm('{}.refresh'.format(permission_prefix)):
$('#refresh-data').click(function() { $('#refresh-data').click(function() {
$(this) $(this)
.button('option', 'disabled', true) .button('option', 'disabled', true)
.button('option', 'label', "Working, please wait..."); .button('option', 'label', "Working, please wait...");
location.href = '${url('{}.refresh'.format(route_prefix), uuid=batch.uuid)}'; location.href = '${url('{}.refresh'.format(route_prefix), uuid=batch.uuid)}';
}); });
% endif
}); });
</script> </script>