allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [08/21] git commit: [#4299] ticket:281 Added combobox to ticket's edit page
Date Fri, 22 Mar 2013 22:54:35 GMT
[#4299] ticket:281 Added combobox to ticket's edit page


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

Branch: refs/heads/master
Commit: 0f9a52e142cde0002400f720ba41e8b1b4840ef4
Parents: 4662ab4
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Mar 1 14:32:59 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Fri Mar 22 21:55:16 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/form_fields.py           |    9 ++++++++-
 Allura/allura/lib/widgets/resources/js/combobox.js |    2 ++
 .../forgetracker/templates/tracker/ticket.html     |    1 -
 ForgeTracker/forgetracker/tracker_main.py          |    1 -
 ForgeTracker/forgetracker/widgets/ticket_form.py   |    2 +-
 5 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0f9a52e1/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index 4322b98..f6ee98b 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -97,8 +97,15 @@ class ProjectUserSelect(ew.InputField):
 class ProjectUserCombo(ew.SingleSelectField):
     template = 'jinja:allura:templates/widgets/project_user_combo.html'
 
+    def to_python(self, value, state):
+        # Skipping validation, 'cause widget has no values initially.
+        # All values loaded later via ajax.
+        return value
+
     def options(self):
-        return []  # will be loaded later via ajax
+        # No options for widget initially.
+        # It'll be populated later via ajax call.
+        return []
 
     def resources(self):
         for r in super(ProjectUserCombo, self).resources():

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0f9a52e1/Allura/allura/lib/widgets/resources/js/combobox.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/combobox.js b/Allura/allura/lib/widgets/resources/js/combobox.js
index a1c59d3..b441f7b 100644
--- a/Allura/allura/lib/widgets/resources/js/combobox.js
+++ b/Allura/allura/lib/widgets/resources/js/combobox.js
@@ -18,6 +18,8 @@
             .insertAfter(select);
 
       function populateSelect(data) {
+        select.children('option').remove();
+        $('<option></option>').val('').appendTo(select);
         for (var i = 0; i < data.options.length; i++) {
           var label = data.options[i].label,
               value = data.options[i].value;

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0f9a52e1/ForgeTracker/forgetracker/templates/tracker/ticket.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/ticket.html b/ForgeTracker/forgetracker/templates/tracker/ticket.html
index 892a45d..1d229fe 100644
--- a/ForgeTracker/forgetracker/templates/tracker/ticket.html
+++ b/ForgeTracker/forgetracker/templates/tracker/ticket.html
@@ -34,7 +34,6 @@
 {% block edit_box %}
 <div class="editbox">
   <div class="form_holder" style="display: none">
-    {{c.user_combo.display()}}
     {{c.ticket_form.display(action='%supdate_ticket_from_widget' % ticket.url(),
       value=ticket, ticket=ticket, show_comment=True)}}
   </div>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0f9a52e1/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index cb6db70..cc477d6 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -1138,7 +1138,6 @@ class TicketController(BaseController):
             c.subscribe_form = W.ticket_subscribe_form
             c.ticket_custom_field = W.ticket_custom_field
             c.vote_form = W.vote_form
-            c.user_combo = ffw.ProjectUserCombo()
             tool_subscribed = M.Mailbox.subscribed()
             if tool_subscribed:
                 subscribed = False

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0f9a52e1/ForgeTracker/forgetracker/widgets/ticket_form.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_form.py b/ForgeTracker/forgetracker/widgets/ticket_form.py
index 44bed56..79b5513 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_form.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_form.py
@@ -54,7 +54,7 @@ class GenericTicketForm(ew.SimpleForm):
                     attrs={'style':'width: 95%'}),
             ew.SingleSelectField(name='status', label='Status',
                 options=lambda: c.app.globals.all_status_names.split()),
-            ffw.ProjectUserSelect(name='assigned_to', label='Assigned To'),
+            ffw.ProjectUserCombo(name='assigned_to', label='Owner'),
             ffw.LabelEdit(label='Labels',name='labels', className='ticket_form_tags'),
             ew.Checkbox(name='private', label='Mark as Private', attrs={'class':'unlabeled'}),
             ew.InputField(name='attachment', label='Attachment', field_type='file', validator=fev.FieldStorageUploadConverter(if_missing=None)),


Mime
View raw message