batch historique
authorOlivier Larchevêque <olivier.larcheveque@auf.org>
Tue, 31 Jul 2012 13:03:54 +0000 (09:03 -0400)
committerOlivier Larchevêque <olivier.larcheveque@auf.org>
Tue, 31 Jul 2012 13:03:54 +0000 (09:03 -0400)
project/assets/js/tous-aucun.js [new file with mode: 0644]
project/rh/historique.py
project/rh/templates/rh/rapports/historique_des_modifications.html
project/rh/views.py

diff --git a/project/assets/js/tous-aucun.js b/project/assets/js/tous-aucun.js
new file mode 100644 (file)
index 0000000..564e37c
--- /dev/null
@@ -0,0 +1,12 @@
+
+$(document).ready(function() {
+
+        $(".tous-handler").click(function() {
+            $('.check-batch input[type=checkbox]').attr('checked', true);
+            });
+
+        $(".aucun-handler").click(function() {
+            $('.check-batch input[type=checkbox]').attr('checked', false);
+            });
+
+        });
index 176d708..141a250 100644 (file)
@@ -64,7 +64,8 @@ def get_active_revisions():
                 filter(version__content_type__app_label="rh").
                 exclude(user__isnull=True).
                 exclude(id__in=ids_revisions_traitees).
-                order_by('-date_created'))
+                order_by('-date_created').
+                distinct('id'))
 
 
 class TodoForm(forms.Form):
index 31fcaaa..823483c 100644 (file)
@@ -6,7 +6,12 @@
   <script type="text/javascript" src="/admin/jsi18n"></script>
   <script type="text/javascript" src="{{ STATIC_URL }}/admin/js/core.js"></script>
   <script type="text/javascript" src="{{ STATIC_URL }}admin/js/admin/RelatedObjectLookups.js"></script>
+  <script type="text/javascript" src="{{ STATIC_URL }}/js/jquery-1.5.1.min.js"></script>
+  <script type="text/javascript" src="{{ STATIC_URL }}/js/tous-aucun.js"></script>
   {{ block.super }}
+  <style>
+      .tous-handler, .aucun-handler {cursor: pointer;}
+  </style>
 {% endblock %}
 
 {% block title %}
 <br />
 
 <form method="post">
-    <table id="result_list" class="results">
+    <table id="result_list" class="results check-batch">
       <thead>
           <tr>
               {% for h in headers %}
                 <th>{{ h }}</th>
               {% endfor %}
+              <th>Traité (<span class="tous-handler">tous</span>/<span
+                      class="aucun-handler">aucun</span>)</th>
           </tr>
       </thead>
       {% for revision in revisions %}
index 59b7e4b..eb8310d 100644 (file)
@@ -849,7 +849,7 @@ def historique_des_modifications(request,):
     
     c = {
             'headers': ('Date', 'Auteur', 'Type', 'Objet', 'Historique',
-                'Commentaire',  'Traité'),
+                'Commentaire', ),
             'revisions': results,
             'page': page_revisions,
             'form': form,