Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
w2pext
plugin_dbui
Commits
2a0359b5
Commit
2a0359b5
authored
Jan 28, 2012
by
Renaud Le Gac
Browse files
Improve API for the PanelWithUrlSelector configurator.
parent
6d085619
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
9 deletions
+27
-9
models/widgets.py
models/widgets.py
+2
-1
modules/plugin_dbui/navtree.py
modules/plugin_dbui/navtree.py
+25
-8
No files found.
models/widgets.py
View file @
2a0359b5
...
...
@@ -192,7 +192,8 @@ cfg = dbui.to_urlPanel(URL(c="reports", f="report_1"))
reportNode
.
add_child
(
T
(
'report_1'
),
cfg
)
form_items
=
cvtSvc
.
to_form_items
(
dummy
.
foo1
)
cfg
=
dbui
.
to_panelWithUrlSelector
(
URL
(
c
=
"reports"
,
f
=
"report_2"
),
form_items
)
cfg
=
dbui
.
to_panelWithUrlSelector
(
form_items
,
baseUrl
=
URL
(
c
=
"reports"
,
f
=
"report_2"
))
reportNode
.
add_child
(
T
(
'report_2'
),
cfg
)
viewportModifier
=
dbui
.
ViewportModifier
()
...
...
modules/plugin_dbui/navtree.py
View file @
2a0359b5
...
...
@@ -9,30 +9,47 @@ from gluon import current
from
helper
import
is_mathjax
def
to_panelWithUrlSelector
(
baseUrl
,
formItems
,
def
to_panelWithUrlSelector
(
formItems
,
application
=
None
,
baseUrl
=
None
,
controller
=
None
,
ctrlField
=
None
,
title
=
'Configure'
):
"""Return the configuration dictionary for an App.PanelWithUrlSelector.
the main panel displays the URL content while the selector panel shows
a form allowing to change the URL setting.
application and controller
The web2py way of defining the URL: /application/controller.
If the application is not defined the URL is:
/current application/controller.
These keyword arguments make sense when using the ctrlField.
See also baseUrl.
baseUrl
well-formed URL string, i.e http://blabla
Well-formed URL string, i.e http://blabla
See also application and controller
ctrlField
n
ame of the form field defining the controller
N
ame of the form field defining the controller
When define the URL become http://blabla/ctrlFieldValue
formItems
a
list of configuration dictionary defining the
A
list of configuration dictionary defining the
widget embedded in the form
title
t
itle of the box surrounding form widgets
T
itle of the box surrounding form widgets
"""
cfg
=
{
'baseUrl'
:
baseUrl
,
url
=
baseUrl
if
not
url
:
if
application
:
url
=
'/%s/%s'
%
(
application
,
controller
)
else
:
url
=
'/%s/%s'
%
(
current
.
request
.
application
,
controller
)
cfg
=
{
'baseUrl'
:
url
,
'ctrlField'
:
ctrlField
,
'panelCfg'
:
None
,
'selectorCfg'
:
None
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment