From d3afd56946607d1f995027a715ff7bbea3d532a4 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 30 Nov 2012 17:51:12 +0100 Subject: [PATCH] Allow stages edition in attribution view Unfortunately, the popup is not closed when the object is saved. It appears this scenario is not planned in Django. --- stages/static/js/attribution.js | 4 ++++ templates/attribution.html | 1 + templates/trainings_list.html | 2 ++ 3 files changed, 7 insertions(+) diff --git a/stages/static/js/attribution.js b/stages/static/js/attribution.js index 8c2f016..e1dec15 100644 --- a/stages/static/js/attribution.js +++ b/stages/static/js/attribution.js @@ -99,6 +99,10 @@ function update_trainings(period_id) { referent.text(parsed[1] +' (' + (parseInt(parsed[2]) - 1) + ')'); }); }); + $('a.edit_training').click(function(ev) { + ev.preventDefault(); + showAddAnotherPopup(this); + }); set_export_visibility(); }); } diff --git a/templates/attribution.html b/templates/attribution.html index 94b22f9..7fe01cd 100644 --- a/templates/attribution.html +++ b/templates/attribution.html @@ -35,6 +35,7 @@ {% block extrahead %} + {% endblock %} diff --git a/templates/trainings_list.html b/templates/trainings_list.html index 327dd92..93bcf5e 100644 --- a/templates/trainings_list.html +++ b/templates/trainings_list.html @@ -1,6 +1,8 @@ +{% load url from future %} {% for obj in trainings %}
  • {{ obj.student }} ({{ obj.student.klass }}) - {{ obj.availability.corporation }} - {{ obj.availability.domain }} {% if obj.referent %} (réf: {{ obj.referent }}){% else %}- Pas de référent{% endif %} +   
  • {% endfor %}