<script>
$(function() {
var xhr = null;
+ var $french_quota = $('<span id="computed-french-quota"></span>');
+ $french_quota.insertAfter($('#computed-percent-weight_lang_fr'));
$('[type=range]').on('change', function() {
var params = $('[type=range]').serialize();
if (xhr !== null ) xhr.abort();
success: function(data, status, xhr) {
for (var key of Object.keys(data)) {
$('#computed-percent-weight_' + key).text((parseInt(data[key] * 100)) + '%');
+ $french_quota.text(' (' + parseInt(data['french_quota'] * 100) + '% hors instru)');
}
}
});
for weight in weights:
data[weight] = counts[weight] / 1000
+ # second percentage for French tracks quota
+ data['french_quota'] = counts['lang_fr'] / (1000 - counts['instru'])
+
return JsonResponse(data)