$(document).ready(function() { $(window).scroll(function() { if ($(window).width() >= 768 && $(this).scrollTop() > 72.6) { $('.col-content-left').css({'position':'fixed', 'top':'50px'}); $('.col-content-right').addClass('col-sm-offset-4 col-md-offset-3'); } else { $('.col-content-left').css({'position':'relative', 'top':'0'}); $('.col-content-right').removeClass('col-sm-offset-4 col-md-offset-3'); } }); if (typeof Cookies !== 'undefined') { // Retrieving csrf token csrftoken = Cookies.get('csrftoken'); // Appending csrf token to ajax post requests function csrfSafeMethod(method) { // these HTTP methods do not require CSRF protection return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); } $.ajaxSetup({ beforeSend: function(xhr, settings) { if (!csrfSafeMethod(settings.type) && !this.crossDomain) { xhr.setRequestHeader("X-CSRFToken", csrftoken); } } }); } }); function dateUTCToParis(date) { return moment.tz(date, 'UTC').tz('Europe/Paris'); } function amountDisplay(amount, is_cof=false, tri='') { if (tri == 'LIQ') return (- amount).toFixed(2) +'€'; return amountToUKF(amount, is_cof); } function amountToUKF(amount, is_cof=false) { var coef_cof = is_cof ? 1 + settings['subvention_cof'] / 100 : 1; return Math.round(amount * coef_cof * 10); } function isValidTrigramme(trigramme) { var pattern = /^[^a-z]{3}$/; return trigramme.match(pattern); } function getErrorsHtml(data) { var content = ''; if ('operation_group' in data['errors']) { content += 'Général'; content += '