From b380984a1e00ff8763515b91df61e2683f231743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Wed, 24 Aug 2016 02:05:05 +0200 Subject: [PATCH] Reprise de la vue historique MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajout de paramètres à cette vue - `opegroups` contient maintenant une liste de groupes d'opérations et non plus un dictionnaire contenant `opegroup.pk` => `opegroup` --- kfet/templates/kfet/kpsul.html | 13 ++++-- kfet/urls.py | 10 +++- kfet/views.py | 85 ++++++++++++++++++++++++++-------- 3 files changed, 82 insertions(+), 26 deletions(-) diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index 19fca28f..58a006f5 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -1083,14 +1083,19 @@ $(document).ready(function() { } function getHistory() { + var data = { + from: moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm:ss'), + }; + console.log(data); $.ajax({ dataType: "json", - url : "{% url 'kfet.kpsul.history' %}", - method : "GET", + url : "{% url 'kfet.history.json' %}", + method : "POST", + data : data, }) .done(function(data) { - for (var opegroup_id in data) { - addOpeGroup(data[opegroup_id]); + for (var i=0; i