From d69ebaca198cc1fc7884a95753369b43779ec52b Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Sat, 14 Dec 2013 14:55:15 +0100 Subject: [PATCH] =?utf8?q?the=20validatebutton=20test=20view=20in=20trash?= =?utf8?q?=20accepts=20special=20argument=20=E2=80=98logged=E2=80=99=20so?= =?utf8?q?=20we=20can=20pass=20=E2=80=98$user=5Fhrn=E2=80=99=20in=20the=20?= =?utf8?q?pi=5Fauthorities=20query,=20like=20our=20real=20views=20will=20d?= =?utf8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- trash/simplevalidatebutton.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/trash/simplevalidatebutton.py b/trash/simplevalidatebutton.py index ff77ee2f..b4bd6382 100644 --- a/trash/simplevalidatebutton.py +++ b/trash/simplevalidatebutton.py @@ -16,8 +16,10 @@ class SimpleValidateButtonView (TemplateView): # mention a user name in the URL as .../trash/simplevalidatebutton/ple.inria.thierry_parmentelat def get (self, request, username='ple.inria.thierry_parmentelat'): + if username=='logged': username='$user_hrn' + page=Page(request) - page.expose_js_metadata() + query_pi_auths = Query.get('ple:user').filter_by('user_hrn', '==', username ).select('pi_authorities') page.enqueue_query(query_pi_auths) @@ -28,16 +30,16 @@ class SimpleValidateButtonView (TemplateView): # see above domid='topmenu-validation', query=query_pi_auths, - # this one is the target for a $.show() when the query comes back + # this one is the target for enabling when the query comes back button_domid="topmenu-validation") + # there is a need to call render() for exposing the query and creating the js plugin + # even though this returns an empty string + validatebutton.render(request) + # variables that will get passed to the view-unfold1.html template template_env = {} - # there is a need to call render() for exposing the query and creating the js plugin - # even though this returns an empty string - rendered=validatebutton.render(request) - # write something of our own instead template_env ['unfold_main'] = '

Some title

' -- 2.43.0