allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#7772] ticket:712 Fix options split at bulk edit form
Date Tue, 13 Jan 2015 21:49:03 GMT
Repository: allura
Updated Branches:
  refs/heads/master 184ffd645 -> 80733fee3


[#7772] ticket:712 Fix options split at bulk edit form


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

Branch: refs/heads/master
Commit: 80733fee35dd809a866717736ecb646296879577
Parents: 184ffd6
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Jan 13 12:19:51 2015 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Tue Jan 13 12:19:51 2015 +0000

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


http://git-wip-us.apache.org/repos/asf/allura/blob/80733fee/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 bfeaf15..c35278c 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/mass_edit_form.html
@@ -76,7 +76,7 @@
           {% elif field.type == 'select' %}
             <select name="{{field.name}}" class="wide">
               <option value="" selected="selected">no change</option>
-              {% for option in field.options.split() %}
+              {% for option in h.split_select_field_options(h.really_unicode(field.options))
%}
                 {% if option.startswith('*') %}
                   <option value="{{option[1:]}}">{{option[1:]}}</option>
                 {% else %}

http://git-wip-us.apache.org/repos/asf/allura/blob/80733fee/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 8506d3a..38fd793 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -506,6 +506,29 @@ class TestFunctionalController(TrackerTestController):
         assert_equal(ticket1.custom_fields._major, True)
         assert_equal(ticket2.custom_fields._major, False)
 
+    def test_mass_edit_select_options_split(self):
+        params = dict(
+            custom_fields=[
+                dict(name='_type',
+                     label='Type',
+                     type='select',
+                     options='Bug "Feature Request"')],
+            open_status_names='aa bb',
+            closed_status_names='cc',
+        )
+        self.app.post(
+            '/admin/bugs/set_custom_fields',
+            params=variable_encode(params))
+        r = self.app.get('/p/test/bugs/edit/')
+        opts = r.html.find('select', attrs={'name': '_type'})
+        opts = opts.findAll('option')
+        assert_equal(opts[0].get('value'), u'')
+        assert_equal(opts[0].getText(), u'no change')
+        assert_equal(opts[1].get('value'), u'Bug')
+        assert_equal(opts[1].getText(), u'Bug')
+        assert_equal(opts[2].get('value'), u'Feature Request')
+        assert_equal(opts[2].getText(), u'Feature Request')
+
     def test_mass_edit_private_field(self):
         kw = {'private': True}
         self.new_ticket(summary='First', **kw)


Mime
View raw message