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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
eda5d21a
Commit
eda5d21a
authored
Aug 06, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web] Allow Static Web Section to also handle the redirect
parent
450e3622
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
3 deletions
+102
-3
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSection_getDocumentValue.py
..._web_redirect_assist/StaticWebSection_getDocumentValue.py
+1
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSection_getDocumentValue.xml
...web_redirect_assist/StaticWebSection_getDocumentValue.xml
+62
-0
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.py
...rtal_components/test.erp5.testStaticWebSiteRedirection.py
+34
-2
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.xml
...tal_components/test.erp5.testStaticWebSiteRedirection.xml
+5
-1
No files found.
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSection_getDocumentValue.py
0 → 100644
View file @
eda5d21a
return
context
.
StaticWebSite_getDocumentValue
(
name
,
**
kw
)
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_redirect_assist/StaticWebSection_getDocumentValue.xml
0 → 100644
View file @
eda5d21a
<?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>
name, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
StaticWebSection_getDocumentValue
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.py
View file @
eda5d21a
...
...
@@ -35,10 +35,10 @@ import ssl
LOCATION
=
"Location"
WEB_SITE_ID
=
"bouncer"
class
TestStaticWebS
ection
Redirection
(
ERP5TypeTestCase
):
class
TestStaticWebS
ite
Redirection
(
ERP5TypeTestCase
):
def
getTitle
(
self
):
return
"Test Static Web S
ection
Redirection."
return
"Test Static Web S
ite
Redirection."
def
getBusinessTemplateList
(
self
):
return
(
...
...
@@ -182,3 +182,35 @@ class TestStaticWebSectionRedirection(ERP5TypeTestCase):
def
test_302queryStringRedirectFolderDeepNested
(
self
):
self
.
runTestRedirect
(
"foo/bar/baz?baz=bam&cous=cous&the=end"
,
use_moved_temporarily
=
1
)
class
TestStaticWebSectionRedirection
(
TestStaticWebSiteRedirection
):
def
getTitle
(
self
):
return
"Test Static Web Section Redirection."
def
setupWebSite
(
self
,
use_moved_temporarily
=
None
,
**
kw
):
"""
Setup Web Site
"""
if
WEB_SITE_ID
in
self
.
portal
.
web_site_module
.
objectIds
():
self
.
portal
.
web_site_module
.
manage_delObjects
(
WEB_SITE_ID
)
website
=
self
.
portal
.
web_site_module
.
newContent
(
portal_type
=
"Web Site"
,
id
=
WEB_SITE_ID
)
websection
=
website
.
newContent
(
portal_type
=
"Static Web Section"
,
id
=
'foobarsection'
,
layout_configuration_form_id
=
"StaticWebSite_viewRedirectAssistConfiguration"
,
skin_selection_name
=
"RedirectAssist"
,
custom_render_method_id
=
"StaticWebSite_getRedirectSourceUrl"
,
redirect_domain
=
"https://www.example.org"
,
use_moved_temporarily
=
use_moved_temporarily
or
0
,
**
kw
)
website
.
publish
()
self
.
tic
()
return
websection
bt5/erp5_web_ui_test/TestTemplateItem/portal_components/test.erp5.testStaticWebSiteRedirection.xml
View file @
eda5d21a
...
...
@@ -43,7 +43,11 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
<tuple>
<string>
W: 91, 28: Unused variable \'api_path\' (unused-variable)
</string>
<string>
W: 91, 16: Unused variable \'api_netloc\' (unused-variable)
</string>
<string>
W: 91, 4: Unused variable \'api_scheme\' (unused-variable)
</string>
</tuple>
</value>
</item>
<item>
...
...
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