You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/08/20 09:10:46 UTC

[07/23] git commit: [#7278] ticket:612 Display current values on the form (not so easy with *Easy*Widgets)

[#7278] ticket:612 Display current values on the form (not so easy with *Easy*Widgets)


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

Branch: refs/heads/je/42cc_7278
Commit: 2bea10e9cca3ddf37dbabb4ae31cd6e06f1aa5b2
Parents: 5a0408d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Aug 1 15:58:18 2014 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Aug 19 12:31:50 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/forms.py | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/2bea10e9/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index cbe9fa8..c560fb3 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -1109,3 +1109,11 @@ class SearchProjectsForm(ForgeForm):
                     },
                     show_errors=False),
             ])]
+
+    def context_for(self, field):
+        ctx = super(SearchProjectsForm, self).context_for(field)
+        if field.name is None and not ctx.get('value'):
+            # RowField does not pass context down to the children :(
+            render_ctx = ew_core.widget_context.render_context
+            ctx['value'] = {'q': render_ctx.get('q'), 'f': render_ctx.get('f')}
+        return ctx