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
Leo Le Bouter
erp5
Commits
66a2c883
Commit
66a2c883
authored
Nov 21, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_core/xhtml_style] Handle xhtml only view action
parent
71a3f9af
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
366 additions
and
4 deletions
+366
-4
bt5/erp5_ui_test/ActionTemplateItem/portal_types/Foo/view_onlyxhtml.xml
...st/ActionTemplateItem/portal_types/Foo/view_onlyxhtml.xml
+79
-0
bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testTabOnlyXHTML.xml
...lateItem/portal_tests/document_zuite/testTabOnlyXHTML.xml
+58
-0
bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testTabOnlyXHTML.zpt
...lateItem/portal_tests/document_zuite/testTabOnlyXHTML.zpt
+33
-0
bt5/erp5_ui_test/bt/template_action_path_list
bt5/erp5_ui_test/bt/template_action_path_list
+1
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_zuite/testPageTabViewsOnlyXHTMLLinkList.xml
...derjs_ui_page_zuite/testPageTabViewsOnlyXHTMLLinkList.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_zuite/testPageTabViewsOnlyXHTMLLinkList.zpt
...derjs_ui_page_zuite/testPageTabViewsOnlyXHTMLLinkList.zpt
+39
-0
product/ERP5/bootstrap/erp5_core/PathTemplateItem/portal_categories/action_type/object_onlyxhtml_view.xml
...m/portal_categories/action_type/object_onlyxhtml_view.xml
+85
-0
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_filterDuplicateActions.py
...tal_skins/erp5_xhtml_style/Base_filterDuplicateActions.py
+13
-4
No files found.
bt5/erp5_ui_test/ActionTemplateItem/portal_types/Foo/view_onlyxhtml.xml
0 → 100644
View file @
66a2c883
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_onlyxhtml_view
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_onlyxhtml_view
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Visible only in XHTML style
</string>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
view_onlyxhtml
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
2.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
View Only XHTML
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Base_viewMetadata
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testTabOnlyXHTML.xml
0 → 100644
View file @
66a2c883
<?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>
testTabOnlyXHTML
</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_ui_test/PathTemplateItem/portal_tests/document_zuite/testTabOnlyXHTML.zpt
0 → 100644
View file @
66a2c883
<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 Add Object
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test View Tab only for ERP5JS
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/PTZuite_CommonTemplate/macros/init"
/>
<!-- First, create the document -->
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/FooModule_createObjects?portal_type=Foo
&
num:int=1
</td>
<td></td>
</tr>
<tr>
<td>
open
</td>
<td>
${base_url}/foo_module/0
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//*[@class="actions"]//ul/li[2]//span[text()="View Only XHTML"]
</td>
<td></td>
</tr>
</table>
</body>
</html>
\ No newline at end of file
bt5/erp5_ui_test/bt/template_action_path_list
View file @
66a2c883
...
...
@@ -41,6 +41,7 @@ Foo | view_hidden_positive_only_quantity
Foo | view_listbox
Foo | view_multiple_listbox
Foo | view_onlyjio
Foo | view_onlyxhtml
Foo | view_planning
Foo | view_print_dialog
Foo | view_printout_form
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_zuite/testPageTabViewsOnlyXHTMLLinkList.xml
0 → 100644
View file @
66a2c883
<?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>
testPageTabViewsOnlyXHTMLLinkList
</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_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_zuite/testPageTabViewsOnlyXHTMLLinkList.zpt
0 → 100644
View file @
66a2c883
<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 Page Front
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Page Tab Link List
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/PTZuite_CommonTemplate/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/foo_module/1?page=tab
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded"
/>
<!-- Wait for gadget to be loaded -->
<tr>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_tab.html']
</td>
<td></td>
</tr>
<!-- Generate links to parents -->
<tr>
<td>
assertElementNotPresent
</td>
<td>
//div[@data-gadget-scope='m']//a[text()='View Only XHTML' and contains(@href, '#!display_with_history') and contains(@href, 'u.page=')]
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
product/ERP5/bootstrap/erp5_core/PathTemplateItem/portal_categories/action_type/object_onlyxhtml_view.xml
0 → 100644
View file @
66a2c883
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_folders_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Copy_or_Move_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_onlyjio_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
object_onlyxhtml_view
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
object_onlyxhtml_view
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_filterDuplicateActions.py
View file @
66a2c883
...
...
@@ -10,25 +10,34 @@ def filterDuplicateActions(actions):
new_actions
=
{}
for
action_category
,
action_list
in
actions
.
items
():
existing_actions
=
set
()
new_actions
[
action_category
]
=
[]
if
action_category
==
'object_onlyxhtml_view'
:
action_category
=
'object_view'
new_actions
.
setdefault
(
action_category
,
[])
existing_actions
=
set
([
x
[
'id'
]
for
x
in
new_actions
[
action_category
]])
keep_action
=
new_actions
[
action_category
].
append
for
action
in
action_list
:
if
action
[
'id'
]
not
in
existing_actions
:
existing_actions
.
add
(
action
[
'id'
])
keep_action
(
action
)
if
(
action_category
==
'object_view'
):
new_actions
[
action_category
].
sort
(
key
=
lambda
x
:
x
.
get
(
'priority'
,
1.0
))
return
new_actions
def
hasDuplicateActions
(
portal_type
,
user_name
):
# Compare the count of action categories and actions
# Give every category a amount of 1000, as
# 'object_onlyxhtml_view' is transformed into 'object_view'
len_actions
=
0
len_filtered_actions
=
0
for
cat
in
actions
.
values
():
len_actions
+=
len
(
cat
)
len_actions
+=
1000
+
len
(
cat
)
filtered_actions
=
filterDuplicateActions
(
actions
)
for
cat
in
filtered_actions
.
values
():
len_filtered_actions
+=
len
(
cat
)
len_filtered_actions
+=
1000
+
len
(
cat
)
return
len_actions
!=
len_filtered_actions
...
...
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