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