incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [3/4] git commit: [#4429] ticket:458 changed boolean checkbox to select in bulk edit
Date Thu, 24 Oct 2013 17:19:56 GMT
[#4429] ticket:458 changed boolean checkbox to select in bulk edit


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

Branch: refs/heads/master
Commit: 4d51f911254e83f97ff72ee0a7998aed7a34c6e8
Parents: 1d55431
Author: coldmind <sokandpal@yandex.ru>
Authored: Tue Oct 22 20:49:09 2013 +0300
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Oct 24 16:59:23 2013 +0000

----------------------------------------------------------------------
 .../tracker_widgets/mass_edit_form.html         |  7 ++-
 .../forgetracker/tests/functional/test_root.py  | 46 ++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4d51f911/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 7eb4019..b6f2942 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
@@ -54,7 +54,12 @@
         <div class="grid-6">
           <label for="{{field.id}}" class="cr">{{field.label}}:</label>
           {% if field.type == 'boolean' %}
-            <input name="{{field.name}}" id="{{field.name}}" type="checkbox" value="True"/>
+            <!-- <input name="{{field.name}}" id="{{field.name}}" type="checkbox" value="True"/>-->
+            <select name="{{field.name}}" id="{{field.name}}">
+                <option value="" selected="selected">Don't change</option>
+                <option value="True">True</option>
+                <option value="False">False</option>
+            </select>
           {% elif field.type == 'select' %}
             <select name="{{field.name}}" class="wide">
               <option value="" selected="selected">no change</option>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4d51f911/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 9d00bc5..b31d755 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -333,6 +333,52 @@ class TestFunctionalController(TrackerTestController):
         r = self.app.get('/p/test/bugs/2/')
         assert '<li><strong>Status</strong>: open --&gt; accepted</li>'
in r
 
+        params = dict(
+            custom_fields=[
+                dict(name='_major', label='Major', type='boolean'), ],
+                open_status_names='aa bb',
+                closed_status_names='cc',
+                )
+        self.app.post(
+            '/admin/bugs/set_custom_fields',
+            params=variable_encode(params))
+        kw = {'custom_fields._major': 'True'}
+        self.new_ticket(summary='First Custom', **kw)
+        kw = {'custom_fields._major': ''}
+        self.new_ticket(summary='Second Custom', **kw)
+        third_ticket = tm.Ticket.query.find({
+            'summary': 'First Custom'}).first()
+        fourth_ticket = tm.Ticket.query.find({
+            'summary': 'Second Custom'}).first()
+
+        self.app.post('/p/test/bugs/update_tickets', {
+                      '__search': '',
+                      '__ticket_ids': (
+                          third_ticket._id,
+                          fourth_ticket._id,),
+                      'status': 'accepted',
+                      '_major': 'False'
+                      })
+        M.MonQTask.run_ready()
+        r = self.app.get('/p/test/bugs/3/')
+        assert '<li><strong>Major</strong>: True --&gt; False</li>'
in r
+        r = self.app.get('/p/test/bugs/4/')
+        assert '<li><strong>Major</strong>: True --&gt; False</li>'
not in r
+
+        self.app.post('/p/test/bugs/update_tickets', {
+                      '__search': '',
+                      '__ticket_ids': (
+                          third_ticket._id,
+                          fourth_ticket._id,),
+                      'status': 'accepted',
+                      '_major': 'True'
+                      })
+        M.MonQTask.run_ready()
+        r = self.app.get('/p/test/bugs/3/')
+        assert '<li><strong>Major</strong>: False --&gt; True</li>'
in r
+        r = self.app.get('/p/test/bugs/4/')
+        assert '<li><strong>Major</strong>: False --&gt; True</li>'
in r
+
     def test_private_ticket(self):
         ticket_view = self.new_ticket(summary='Public Ticket').follow()
         assert_true('<label class="simple">Private:</label> No' in ticket_view)


Mime
View raw message