allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#5494] Refactor mass edit ticket select checkboxes to use multi-value instead of name/join
Date Thu, 04 Apr 2013 19:11:26 GMT
Updated Branches:
  refs/heads/cj/5494 [created] adc806e07


[#5494] Refactor mass edit ticket select checkboxes to use multi-value instead of name/join

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/adc806e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/adc806e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/adc806e0

Branch: refs/heads/cj/5494
Commit: adc806e07679f990273b1644b902364345df0303
Parents: 46780f8
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu Apr 4 19:11:12 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Apr 4 19:11:12 2013 +0000

----------------------------------------------------------------------
 .../templates/tracker_widgets/mass_edit.html       |    2 +-
 .../templates/tracker_widgets/mass_edit_form.html  |    1 -
 ForgeTracker/forgetracker/tracker_main.py          |   10 +---------
 .../forgetracker/widgets/resources/js/mass-edit.js |    4 +++-
 4 files changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/adc806e0/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit.html b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit.html
index 07b3d22..381cf7a 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit.html
@@ -17,7 +17,7 @@
       <tbody class="ticket-list">
         {% for t in tickets %}
         <tr>
-          <td><input type="checkbox" name="{{t._id}}" value=""/></td>
+          <td><input type="checkbox" name="ticket_ids" value="{{t._id}}"/></td>
           <td><a href="{{t.url()}}">{{t.ticket_num}}</a></td>
           <td><a href="{{t.url()}}">{{t.summary}}</a></td>
           <td>{{t._milestone}}</td>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/adc806e0/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
index 7e6e738..1cb215b 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
@@ -72,6 +72,5 @@
       <!-- tg.url(c.app.url+'search/', dict(q=query, limit=limit, sort=sort))}}" class="btn
link">Cancel</a>-->
     </div>
     <div class="grid-12" id="result"></div>
-    <input name="__selected" type="hidden" value="" id="id_selected" />
     <input name="__search" type="hidden" value="" id="id_search" />
 </form>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/adc806e0/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 7cde33e..ebcb2ed 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -737,7 +737,7 @@ class RootController(BaseController):
     @require_post()
     def update_tickets(self, **post_data):
         tickets = TM.Ticket.query.find(dict(
-                _id={'$in':[ObjectId(id) for id in post_data['__selected'].split(',')]},
+                _id={'$in':[ObjectId(id) for id in post_data['__ticket_ids']]},
                 app_config_id=c.app.config._id)).all()
         for ticket in tickets:
             require_access(ticket, 'update')
@@ -802,14 +802,6 @@ class RootController(BaseController):
         flash('Updated {} ticket{}'.format(count, 's' if count != 1 else ''), 'ok')
         redirect('edit/' + post_data['__search'])
 
-# tickets
-# open tickets
-# closed tickets
-# new tickets in the last 7/14/30 days
-# of comments on tickets
-# of new comments on tickets in 7/14/30
-# of ticket changes in the last 7/14/30
-
     def tickets_since(self, when=None):
         count = 0
         if when:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/adc806e0/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
index f9ae973..9be18bb 100644
--- a/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
+++ b/ForgeTracker/forgetracker/widgets/resources/js/mass-edit.js
@@ -17,6 +17,8 @@ $(function(){
             return false;
         }
 
-        $('#id_selected').val($checked.map(function(){ return this.name; }).get().join(','));
+        $checked.each(function() {
+            $('#update-values').append('<input type="hidden" name="__ticket_ids" value="'+$(this).val()+'"/>');
+        });
     });
 });


Mime
View raw message