From 72b571f4ea4f87663ee49f63c989ee1a1136e279 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Larchev=C3=AAque?= Date: Wed, 20 Apr 2011 12:11:04 -0400 Subject: [PATCH] element de comparaison conversion EUR --- project/dae/templates/dae/poste.html | 42 +++++++++++++--------------------- project/media/js/dae-poste.js | 24 +++++++++++++++++++ 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/project/dae/templates/dae/poste.html b/project/dae/templates/dae/poste.html index c22fbd3..d2c7686 100644 --- a/project/dae/templates/dae/poste.html +++ b/project/dae/templates/dae/poste.html @@ -241,41 +241,31 @@ Demande d'autorisation d'embauche - +
- - - - - + + + + + - - - - - - - - - - + + + + + - - - - - - - - - - + + + + +
Entreprise localeUniversitéFonction publiqueONGAutreUniversitéFonction publiqueEntreprise localeONGAutre
Minimum{{ form.comp_locale_min }}€{{ form.comp_universite_min }}€{{ form.comp_fonctionpub_min }}€{{ form.comp_ong_min }}€{{ form.comp_autre_min }}€{{ form.comp_universite_min }} (){{ form.comp_fonctionpub_min }} (){{ form.comp_locale_min }} (){{ form.comp_ong_min }} (){{ form.comp_autre_min }} ()
Maximum{{ form.comp_locale_max }}€{{ form.comp_universite_max }}€{{ form.comp_fonctionpub_max }}€{{ form.comp_ong_max }}€{{ form.comp_autre_max }}€{{ form.comp_universite_max }} (){{ form.comp_fonctionpub_max }} (){{ form.comp_locale_max }} (){{ form.comp_ong_max }} (){{ form.comp_autre_max }} ()
diff --git a/project/media/js/dae-poste.js b/project/media/js/dae-poste.js index 64b8721..f1756ce 100644 --- a/project/media/js/dae-poste.js +++ b/project/media/js/dae-poste.js @@ -2,6 +2,25 @@ * POSTE *******************************************************************************/ + +function elements_comparaison(devise_id) { + var chargement_devise = $.getJSON("/dae/devise/code", {'devise': devise_id}); + chargement_devise.success(function(data) { + /* data.devise + data.taux_euro + data.devise_code */ + $('#elements-comparaison input').each(function() { + var input = $(this); + var montant = data.taux_euro * parseFloat(input.val()); + input.parent().find(".devise_euro").html(clean_float(montant) + " EUR"); + input.parent().find(".devise").html(data.devise_code); + }); + }); + chargement_devise.error(function(data) { + alert(data.responseText); + }); +} + /* filter les postes en fonction de l'implantation choisie */ function charger_postes(implantation_id) { var selected = $("#id_poste :selected").val(); @@ -190,4 +209,9 @@ $(document).ready(function() { /* on charge les postes reliés à cette implantation */ charger_postes($("#id_implantation :selected").val()); + $('#id_devise_comparaison, #elements-comparaison input').change(function(e) { + elements_comparaison($('#id_devise_comparaison').val()); + }); + elements_comparaison($('#id_devise_comparaison').val()); + }); -- 1.7.10.4