Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
erp5
Commits
28245f7c
Commit
28245f7c
authored
Sep 16, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_js_style: add support for dialog
Only basic fields are supported (no gadgetfield for now).
parent
226a4204
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1092 additions
and
6 deletions
+1092
-6
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/dialog_main.xml
...ateItem/portal_skins/erp5_web_js_style_ui/dialog_main.xml
+58
-0
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/dialog_main.zpt
...ateItem/portal_skins/erp5_web_js_style_ui/dialog_main.zpt
+62
-0
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
...plateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
+27
-1
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/view_main.zpt
...plateItem/portal_skins/erp5_web_js_style_ui/view_main.zpt
+2
-0
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteForm.xml
...em/portal_tests/js_style_zuite/testJsStyleWebSiteForm.xml
+58
-0
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteForm.zpt
...em/portal_tests/js_style_zuite/testJsStyleWebSiteForm.zpt
+216
-0
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteNoStyleForm.xml
...al_tests/js_style_zuite/testJsStyleWebSiteNoStyleForm.xml
+58
-0
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteNoStyleForm.zpt
...al_tests/js_style_zuite/testJsStyleWebSiteNoStyleForm.zpt
+148
-0
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/ERP5Site_createWebJSStyleZuiteTestData.py
...b_js_style_test/ERP5Site_createWebJSStyleZuiteTestData.py
+10
-1
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_submitJSStyleTestForm.py
...s/erp5_web_js_style_test/WebSite_submitJSStyleTestForm.py
+1
-0
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_submitJSStyleTestForm.xml
.../erp5_web_js_style_test/WebSite_submitJSStyleTestForm.xml
+62
-0
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_viewJSStyleTestForm.xml
...ns/erp5_web_js_style_test/WebSite_viewJSStyleTestForm.xml
+140
-0
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_viewJSStyleTestForm/your_id.xml
...web_js_style_test/WebSite_viewJSStyleTestForm/your_id.xml
+117
-0
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_viewJSStyleTestForm/your_title.xml
..._js_style_test/WebSite_viewJSStyleTestForm/your_title.xml
+112
-0
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/jsstyle_demo.html.html
...ortal_skins/erp5_web_js_style_test/jsstyle_demo.html.html
+1
-0
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/jsstyle_demo.js.js
...em/portal_skins/erp5_web_js_style_test/jsstyle_demo.js.js
+20
-4
No files found.
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/dialog_main.xml
0 → 100644
View file @
28245f7c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
dialog_main
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/dialog_main.zpt
0 → 100644
View file @
28245f7c
<tal:block
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
xmlns:i18n=
"http://xml.zope.org/namespaces/i18n"
>
<tal:block
metal:define-macro=
"master"
>
<tal:block
tal:define=
"
dummy python: request.set('is_web_mode', True);
dummy python: request.set('ignore_layout', False);
dummy python: request.set('editable_mode', True);
dialog_category python: '';
web_site python: here.getWebSiteValue();
web_section python: here.getWebSectionValue();
global_definitions_macros here/global_definitions/macros;"
>
<tal:block
metal:use-macro=
"global_definitions_macros/header_definitions"
/>
<html>
<head>
<base
tal:attributes=
"href python: '%s/' % web_section.absolute_url()"
/>
<meta
name=
"viewport"
content=
"width=device-width,height=device-height,initial-scale=1"
/>
<title
tal:content=
"python: here.getTranslatedTitle() or web_site.getTranslatedTitle()"
></title>
<noscript>
<link
rel=
"stylesheet"
href=
"jsstyle.css"
>
</noscript>
<!-- Prevent conflicts with Web Page reference provided by erp5_web_renderjs_ui -->
<script
src=
"portal_skins/erp5_xhtml_style/rsvp.js"
></script>
<script
src=
"portal_skins/erp5_xhtml_style/renderjs.js"
></script>
<script
src=
"gadget_global.js"
></script>
<script
src=
"jsstyle.js"
></script>
</head>
<body
tal:attributes=
"data-nostyle-gadget-url python: web_site.getLayoutProperty('configuration_style_gadget_url', default='')"
>
<tal:block
tal:content=
"structure python: web_site.WebSite_generateNavigationHTML()"
></tal:block>
<main>
<p
tal:content=
"request/portal_status_message | nothing"
id=
"portal_status_message"
/>
<tal:block
tal:condition=
"request/field_errors | nothing"
>
<p
id=
"information_area"
i18n:translate=
""
i18n:domain=
"ui"
>
Input data has errors. Please look at the error messages below.
</p>
</tal:block>
<form
id=
"main_form"
tal:attributes=
"enctype enctype | form/Form_getEnctype | nothing;
action url;
method python:str(path('form/method | string:post')).lower()"
>
<input
type=
"hidden"
name=
"dialog_method"
tal:attributes=
"value form/action"
/>
<input
type=
"hidden"
name=
"dialog_id"
tal:attributes=
"value form/id | template/id"
/>
<tal:block
metal:define-slot=
"main"
/>
<button
tal:condition=
"form/action|nothing"
accesskey=
"V"
id=
"dialog_submit_button"
name=
"Base_callDialogMethod:method"
type=
"submit"
>
<span
i18n:translate=
""
i18n:domain=
"ui"
tal:content=
"python:here.Base_getFormViewDialogActionButtonTitle(form)"
>
Submit
</span>
</button>
</form>
</main>
</body>
</html>
</tal:block>
</tal:block>
</tal:block>
\ No newline at end of file
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
View file @
28245f7c
...
@@ -109,6 +109,25 @@
...
@@ -109,6 +109,25 @@
return
sitemap
;
return
sitemap
;
}
}
function
parseFormElement
(
form_element
)
{
var
result
;
if
(
form_element
!==
null
)
{
return
form_element
.
outerHTML
;
}
return
result
;
}
function
parseStatusMessage
(
status_element
,
information_element
)
{
var
result
=
""
;
if
(
status_element
!==
null
)
{
result
=
status_element
.
textContent
;
}
if
(
information_element
!==
null
)
{
result
=
information_element
.
textContent
;
}
return
result
;
}
function
parsePageContent
(
body_element
)
{
function
parsePageContent
(
body_element
)
{
return
{
return
{
html_content
:
body_element
.
querySelector
(
'
main
'
).
innerHTML
,
html_content
:
body_element
.
querySelector
(
'
main
'
).
innerHTML
,
...
@@ -117,7 +136,14 @@
...
@@ -117,7 +136,14 @@
),
),
sitemap
:
parseSitemapElement
(
sitemap
:
parseSitemapElement
(
body_element
.
querySelector
(
'
nav#sitemap
'
)
body_element
.
querySelector
(
'
nav#sitemap
'
)
)
),
form_html_content
:
parseFormElement
(
body_element
.
querySelector
(
'
form#main_form
'
)
),
portal_status_message
:
parseStatusMessage
(
body_element
.
querySelector
(
'
p#portal_status_message
'
),
body_element
.
querySelector
(
'
p#information_area
'
)
),
};
};
}
}
...
...
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/view_main.zpt
View file @
28245f7c
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
</head>
</head>
<body
tal:attributes=
"data-nostyle-gadget-url python: web_site.getLayoutProperty('configuration_style_gadget_url', default='')"
>
<body
tal:attributes=
"data-nostyle-gadget-url python: web_site.getLayoutProperty('configuration_style_gadget_url', default='')"
>
<tal:block
tal:content=
"structure python: web_site.WebSite_generateNavigationHTML()"
></tal:block>
<tal:block
tal:content=
"structure python: web_site.WebSite_generateNavigationHTML()"
></tal:block>
<p
tal:content=
"request/portal_status_message | nothing"
id=
"portal_status_message"
/>
<main><tal:block
metal:define-slot=
"main"
/></main>
<main><tal:block
metal:define-slot=
"main"
/></main>
</body>
</body>
</html>
</html>
...
...
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteForm.xml
0 → 100644
View file @
28245f7c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testJsStyleWebSiteForm
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteForm.zpt
0 → 100644
View file @
28245f7c
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test JS Style Demo Style
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test JS Style Demo Style
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/ERP5Site_createWebJSStyleZuiteTestData?configuration=form
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Web Site created.
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
<!-- Initialize -->
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_web_js_style_test_site/
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//header/h1[text()='JS Style Demo']
</td>
<td></td>
</tr>
<tr>
<td
colspan=
"3"
><b>
Check the page content uses the web site
</b></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//main//form
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//main//form
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='gadget_style_url'][contains(text(), 'erp5_web_js_style_test_site/jsstyle_demo.html')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='render_count'][contains(text(), '1')]
</td>
<td></td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_your_id
</td>
<td>
erp5_web_js_style_test_site
</td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_your_title
</td>
<td>
Demo Form
</td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//button[@id='dialog_submit_button']//span[text()='Do It']
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='portal_status_message' and contains(text(), '')]
</td>
<td></td>
</tr>
<tr>
<td
colspan=
"3"
><b>
Check the form validation
</b></td>
</tr>
<tr>
<td>
type
</td>
<td>
field_your_id
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
dialog_submit_button
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//header/h1[text()='JS Style Demo']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//main//form
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//main//form
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='gadget_style_url'][contains(text(), 'erp5_web_js_style_test_site/jsstyle_demo.html')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='render_count'][contains(text(), '1')]
</td>
<td></td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_your_id
</td>
<td></td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_your_title
</td>
<td>
Demo Form
</td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='portal_status_message' and contains(text(), 'Input data has errors. Please look at the error messages below.')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//span[@class='error' and contains(text(), 'Input is required but no input given.')]
</td>
<td></td>
</tr>
<tr>
<td
colspan=
"3"
><b>
Check the form submission
</b></td>
</tr>
<tr>
<td>
type
</td>
<td>
field_your_id
</td>
<td>
a
</td>
</tr>
<tr>
<td>
type
</td>
<td>
field_your_title
</td>
<td>
b
</td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
dialog_submit_button
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//header/h1[text()='JS Style Demo']
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//main//form
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//main//form
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='gadget_style_url'][contains(text(), 'erp5_web_js_style_test_site/jsstyle_demo.html')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='render_count'][contains(text(), '1')]
</td>
<td></td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_your_id
</td>
<td>
erp5_web_js_style_test_site
</td>
</tr>
<tr>
<td>
assertValue
</td>
<td>
field_your_title
</td>
<td>
Demo Form
</td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='portal_status_message' and contains(text(), 'Submitted a b')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementNotPresent
</td>
<td>
//span[@class='error' and contains(text(), 'Input is required but no input given.')]
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteNoStyleForm.xml
0 → 100644
View file @
28245f7c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
testJsStyleWebSiteNoStyleForm
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_js_style_test/PathTemplateItem/portal_tests/js_style_zuite/testJsStyleWebSiteNoStyleForm.zpt
0 → 100644
View file @
28245f7c
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test JS Style Demo Style
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test JS Style Demo Style
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/ERP5Site_createWebJSStyleZuiteTestData?configuration=nostyleform
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Web Site created.
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
<!-- Initialize -->
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/erp5_web_js_style_test_site/
</td>
<td></td>
</tr>
<tr>
<td>
waitForTextPresent
</td>
<td>
No Style Form
</td>
<td></td>
</tr>
<tr>
<td
colspan=
"3"
><b>
Check the form content
</b></td>
</tr>
<tr>
<td>
verifyValue
</td>
<td>
field_your_id
</td>
<td>
erp5_web_js_style_test_site
</td>
</tr>
<tr>
<td>
verifyValue
</td>
<td>
field_your_title
</td>
<td>
No Style Form
</td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//button[@id='dialog_submit_button']//span[text()='Do It']
</td>
<td></td>
</tr>
<tr>
<td
colspan=
"3"
><b>
Check the form validation
</b></td>
</tr>
<tr>
<td>
type
</td>
<td>
field_your_id
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
dialog_submit_button
</td>
<td></td>
</tr>
<tr>
<td>
verifyValue
</td>
<td>
field_your_id
</td>
<td></td>
</tr>
<tr>
<td>
verifyValue
</td>
<td>
field_your_title
</td>
<td>
No Style Form
</td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='information_area' and contains(text(), 'Input data has errors. Please look at the error messages below.')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='portal_status_message' and contains(text(), '')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//span[@class='error' and contains(text(), 'Input is required but no input given.')]
</td>
<td></td>
</tr>
<tr>
<td
colspan=
"3"
><b>
Check the form submission
</b></td>
</tr>
<tr>
<td>
type
</td>
<td>
field_your_id
</td>
<td>
a
</td>
</tr>
<tr>
<td>
type
</td>
<td>
field_your_title
</td>
<td>
b
</td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
dialog_submit_button
</td>
<td></td>
</tr>
<tr>
<td>
verifyValue
</td>
<td>
field_your_id
</td>
<td>
erp5_web_js_style_test_site
</td>
</tr>
<tr>
<td>
verifyValue
</td>
<td>
field_your_title
</td>
<td>
No Style Form
</td>
</tr>
<tr>
<td>
assertElementNotPresent
</td>
<td>
//p[@id='information_area']
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//p[@id='portal_status_message' and contains(text(), 'Submitted a b')]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementNotPresent
</td>
<td>
//span[@class='error' and contains(text(), 'Input is required but no input given.')]
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/ERP5Site_createWebJSStyleZuiteTestData.py
View file @
28245f7c
...
@@ -121,6 +121,10 @@ configuration_dict = {
...
@@ -121,6 +121,10 @@ configuration_dict = {
'nostyle'
:
{
'nostyle'
:
{
'title'
:
'No Style'
'title'
:
'No Style'
},
},
'nostyleform'
:
{
'title'
:
"No Style Form"
,
'custom_render_method_id'
:
'WebSite_viewJSStyleTestForm'
},
'section'
:
{
'section'
:
{
'configuration_style_gadget_url'
:
"jsstyle_demo.html"
,
'configuration_style_gadget_url'
:
"jsstyle_demo.html"
,
'title'
:
"Demo Style"
,
'title'
:
"Demo Style"
,
...
@@ -132,7 +136,12 @@ configuration_dict = {
...
@@ -132,7 +136,12 @@ configuration_dict = {
'language'
:
"en"
,
'language'
:
"en"
,
'aggregate_value'
:
module
.
restrictedTraverse
(
web_page_frontend_en_id
),
'aggregate_value'
:
module
.
restrictedTraverse
(
web_page_frontend_en_id
),
'title'
:
"Demo Style With Language"
,
'title'
:
"Demo Style With Language"
,
}
},
'form'
:
{
'configuration_style_gadget_url'
:
"jsstyle_demo.html"
,
'title'
:
"Demo Form"
,
'custom_render_method_id'
:
'WebSite_viewJSStyleTestForm'
},
}
}
### Web site
### Web site
...
...
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_submitJSStyleTestForm.py
0 → 100644
View file @
28245f7c
return
context
.
Base_redirect
(
keep_items
=
{
"portal_status_message"
:
'Submitted %s %s'
%
(
id
,
title
)})
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_submitJSStyleTestForm.xml
0 → 100644
View file @
28245f7c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
id=None, title=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSite_submitJSStyleTestForm
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_viewJSStyleTestForm.xml
0 → 100644
View file @
28245f7c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
WebSite_submitJSStyleTestForm
</string>
</value>
</item>
<item>
<key>
<string>
action_title
</string>
</key>
<value>
<string>
Do It
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
enctype
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<list>
<string>
left
</string>
<string>
right
</string>
<string>
center
</string>
<string>
bottom
</string>
<string>
hidden
</string>
</list>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
bottom
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
center
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
left
</string>
</key>
<value>
<list>
<string>
your_id
</string>
<string>
your_title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSite_viewJSStyleTestForm
</string>
</value>
</item>
<item>
<key>
<string>
method
</string>
</key>
<value>
<string>
POST
</string>
</value>
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
WebSite_viewJSStyleTestForm
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
ERP5 Form
</string>
</value>
</item>
<item>
<key>
<string>
pt
</string>
</key>
<value>
<string>
form_dialog
</string>
</value>
</item>
<item>
<key>
<string>
row_length
</string>
</key>
<value>
<int>
4
</int>
</value>
</item>
<item>
<key>
<string>
stored_encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
unicode_mode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
update_action
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_viewJSStyleTestForm/your_id.xml
0 → 100644
View file @
28245f7c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
required
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_id
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
required
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
ID
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
here/getId
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/WebSite_viewJSStyleTestForm/your_title.xml
0 → 100644
View file @
28245f7c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_title
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Title
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
here/getTitle
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/jsstyle_demo.html.html
View file @
28245f7c
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<header><h1>
JS Style Demo
</h1></header>
<header><h1>
JS Style Demo
</h1></header>
<p
id=
"gadget_style_url"
></p>
<p
id=
"gadget_style_url"
></p>
<p
id=
"render_count"
></p>
<p
id=
"render_count"
></p>
<p
id=
"portal_status_message"
></p>
<nav
id=
"language"
></nav>
<nav
id=
"language"
></nav>
<nav
id=
"sitemap"
></nav>
<nav
id=
"sitemap"
></nav>
<main></main>
<main></main>
...
...
bt5/erp5_web_js_style_test/SkinTemplateItem/portal_skins/erp5_web_js_style_test/jsstyle_demo.js.js
View file @
28245f7c
...
@@ -38,6 +38,8 @@
...
@@ -38,6 +38,8 @@
language_list
:
JSON
.
stringify
(
parsed_content
.
language_list
||
[]),
language_list
:
JSON
.
stringify
(
parsed_content
.
language_list
||
[]),
sitemap
:
JSON
.
stringify
(
parsed_content
.
sitemap
||
{}),
sitemap
:
JSON
.
stringify
(
parsed_content
.
sitemap
||
{}),
page_title
:
parsed_content
.
page_title
||
""
,
page_title
:
parsed_content
.
page_title
||
""
,
portal_status_message
:
parsed_content
.
portal_status_message
||
""
,
form_html_content
:
parsed_content
.
form_html_content
,
html_content
:
html_content
||
""
,
html_content
:
html_content
||
""
,
render_count
:
this
.
state
.
render_count
+
1
render_count
:
this
.
state
.
render_count
+
1
};
};
...
@@ -53,12 +55,26 @@
...
@@ -53,12 +55,26 @@
if
(
modification_dict
.
hasOwnProperty
(
'
page_title
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
page_title
'
))
{
document
.
title
=
gadget
.
state
.
page_title
;
document
.
title
=
gadget
.
state
.
page_title
;
}
}
if
(
modification_dict
.
hasOwnProperty
(
'
html_content
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
portal_status_message
'
))
{
domsugar
(
gadget
.
element
.
querySelector
(
'
main
'
),
{
domsugar
(
gadget
.
element
.
querySelector
(
'
p#portal_status_message
'
),
{
html
:
domsugar
(
'
div
'
,
{
html
:
gadget
.
state
.
html_content
})
text
:
gadget
.
state
.
portal_status_message
.
querySelector
(
'
div.input
'
).
firstChild
.
innerHTML
});
});
}
}
if
((
modification_dict
.
hasOwnProperty
(
'
form_html_content
'
))
||
(
modification_dict
.
hasOwnProperty
(
'
html_content
'
)))
{
if
(
gadget
.
state
.
form_html_content
)
{
// In case of form, display it directly
domsugar
(
gadget
.
element
.
querySelector
(
'
main
'
),
{
html
:
gadget
.
state
.
form_html_content
});
}
else
{
// Try to find the Web Page content only
domsugar
(
gadget
.
element
.
querySelector
(
'
main
'
),
{
html
:
domsugar
(
'
div
'
,
{
html
:
gadget
.
state
.
html_content
})
.
querySelector
(
'
div.input
'
).
firstChild
.
innerHTML
});
}
}
if
(
modification_dict
.
hasOwnProperty
(
'
gadget_style_url
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
gadget_style_url
'
))
{
domsugar
(
gadget
.
element
.
querySelector
(
'
p#gadget_style_url
'
),
{
domsugar
(
gadget
.
element
.
querySelector
(
'
p#gadget_style_url
'
),
{
text
:
gadget
.
state
.
gadget_style_url
text
:
gadget
.
state
.
gadget_style_url
...
...
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