You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/08/21 21:47:18 UTC
[06/18] 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/eb4ac9ce
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/eb4ac9ce
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/eb4ac9ce
Branch: refs/heads/master
Commit: eb4ac9ce81650d2ecbcedb2c35dd99462f881f07
Parents: 6a4654b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Aug 1 15:58:18 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Aug 21 18:49:55 2014 +0000
----------------------------------------------------------------------
Allura/allura/lib/widgets/forms.py | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/eb4ac9ce/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