Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
bf142a78
Commit
bf142a78
authored
14 years ago
by
Renaud Le Gac
Browse files
Options
Downloads
Patches
Plain Diff
add a new helper function get_js_files.
parent
65b410ba
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/plugin_dbui/__init__.py
+2
-1
2 additions, 1 deletion
modules/plugin_dbui/__init__.py
modules/plugin_dbui/helper.py
+35
-16
35 additions, 16 deletions
modules/plugin_dbui/helper.py
views/plugin_dbui/index.html
+35
-0
35 additions, 0 deletions
views/plugin_dbui/index.html
with
72 additions
and
17 deletions
modules/plugin_dbui/__init__.py
+
2
−
1
View file @
bf142a78
...
...
@@ -8,7 +8,8 @@ from directsvc import DBUI, DirectSvc
from
fieldmodifier
import
FieldModifier
from
formmodifier
import
configure_forms
,
FormModifier
from
gridmodifier
import
configure_grids
,
GridModifier
from
helper
import
(
get_extjs_path
,
from
helper
import
(
get_extjs_path
,
get_js_files
,
get_language
,
get_reference_paths
,
get_script_path
)
...
...
This diff is collapsed.
Click to expand it.
modules/plugin_dbui/helper.py
+
35
−
16
View file @
bf142a78
...
...
@@ -74,6 +74,41 @@ def get_extjs_path(environment):
return
os
.
path
.
join
(
os
.
path
.
sep
,
application
,
'
static
'
,
'
plugin_extjs
'
)
def
get_js_files
(
server_path
,
client_path
,
directory
):
"""
Return a list of javascript files stored in the directory.
The alphabetic order is preserved.
"""
li
=
[]
cltdir
=
os
.
path
.
join
(
client_path
,
directory
)
svrdir
=
os
.
path
.
join
(
server_path
,
directory
)
if
os
.
path
.
exists
(
svrdir
):
for
file
in
os
.
listdir
(
svrdir
):
if
file
.
endswith
(
"
.js
"
):
li
.
append
(
os
.
path
.
join
(
cltdir
,
file
))
li
.
sort
()
return
li
def
get_language
(
environment
):
"""
Helper method returning the application language.
The result is compliant with the ExtJS file name.
The dictionary environment contains the keys request, response,
session, plugins, ....
"""
lg
=
environment
[
'
T
'
].
accepted_language
if
len
(
lg
)
==
5
and
lg
[
0
:
2
]
==
lg
[
3
:
5
]:
lg
=
lg
[
0
:
2
]
return
lg
def
get_reference_paths
(
environment
):
"""
Helper method returning a tuple with the server and the local paths.
...
...
@@ -125,22 +160,6 @@ def get_script_path(environment):
return
script
def
get_language
(
environment
):
"""
Helper method returning the application language.
The result is compliant with the ExtJS file name.
The dictionary environment contains the keys request, response,
session, plugins, ....
"""
lg
=
environment
[
'
T
'
].
accepted_language
if
len
(
lg
)
==
5
and
lg
[
0
:
2
]
==
lg
[
3
:
5
]:
lg
=
lg
[
0
:
2
]
return
lg
def
rows_serializer
(
rows
):
"""
Helper function to serialize a gluon.dal.Rows.
...
...
This diff is collapsed.
Click to expand it.
views/plugin_dbui/index.html
0 → 100644
+
35
−
0
View file @
bf142a78
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- $Id: plugin_dbui.html 1129 2011-02-19 13:50:53Z legac $ -->
<meta
http-equiv=
"content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"author"
lang=
"en"
content=
"{{=response.author}}"
/>
<meta
name=
"keywords"
content=
"{{=response.keywords}}"
/>
<meta
name=
"description"
content=
"{{=response.description}}"
/>
<title>
{{=request.application}}
</title>
<!-- extjs css -->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{=pextjs}}/resources/css/ext-all.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{=pextjs}}/examples/shared/icons/silk.css"
/>
<!-- extjs javascript library -->
<script
type=
"text/javascript"
src=
"{{=pextjs}}/adapter/ext/ext-base.js"
></script>
<script
type=
"text/javascript"
src=
"{{=pextjs}}/ext-all.js"
></script>
<script
type=
"text/javascript"
src=
"{{=pextjs}}/src/locale/ext-lang-{{=lg}}.js"
></script>
<!-- dbui javascript library -->
<script
type=
"text/javascript"
src=
"/{{=request.application}}/plugin_dbui/get_api"
></script>
<script
type=
"text/javascript"
src=
"/{{=request.application}}/static/plugin_dbui/dbui.min.js"
></script>
<!-- user javascript library and main script-->
{{for el in response.files:}}
<script
type=
"text/javascript"
src=
"{{=el}}"
></script>
{{pass}}
</head>
<body>
<div
id=
'appmain'
></div>
</body>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment