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
Labels
Merge Requests
144
Merge Requests
144
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
12f498d3
Commit
12f498d3
authored
Nov 04, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_project_ui: get project web page using jio
parent
a7359e8e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
30 deletions
+28
-30
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_getRenderJSExtraInfoParameterList.py
..._web_project/Project_getRenderJSExtraInfoParameterList.py
+1
-24
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js
...m/portal_skins/erp5_web_project/gadget_project_info.js.js
+27
-6
No files found.
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_getRenderJSExtraInfoParameterList.py
View file @
12f498d3
...
@@ -3,28 +3,5 @@
...
@@ -3,28 +3,5 @@
Return parameters to correctly display the RenderJS gadget
Return parameters to correctly display the RenderJS gadget
================================================================================
================================================================================
"""
"""
# parameters
# ------------------------------------------------------------------------------
# context_url: relative url of the context calling this script
from
Products.ERP5Type.Log
import
log
return
[(
'project_title'
,
context
.
getTitle
()),
(
'jio_key'
,
context
.
getRelativeUrl
()),
(
'project_reference'
,
context
.
getReference
())]
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
reference
=
str
(
context
.
getReference
())
+
"-Home.Page"
home_page
=
portal_catalog
.
getResultValue
(
portal_type
=
'Web Page'
,
reference
=
reference
,
validation_state
=
"published_alive"
)
if
home_page
:
content
=
home_page
.
getTextContent
()
else
:
content
=
""
if
home_page
:
home_page_jio_key
=
home_page
.
getRelativeUrl
()
else
:
home_page_jio_key
=
""
return
[(
'project_title'
,
context
.
getTitle
()),
(
'jio_key'
,
context
.
getRelativeUrl
()),
(
'home_page_jio_key'
,
home_page_jio_key
),
(
'home_page_content'
,
content
)]
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js
View file @
12f498d3
...
@@ -46,6 +46,23 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
...
@@ -46,6 +46,23 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
});
});
}
}
function
getWebPage
(
gadget
,
project_reference
)
{
var
query
=
'
portal_type:="Web Page" AND reference:"
'
+
project_reference
+
'
-Home.Page" AND validation_state:"published_alive"
'
,
id
,
content
;
return
gadget
.
jio_allDocs
({
query
:
query
,
limit
:
1
,
select_list
:
[
'
id
'
,
'
text_content
'
]
})
.
push
(
function
(
result_list
)
{
if
(
result_list
.
data
.
rows
)
{
id
=
result_list
.
data
.
rows
[
0
].
id
;
content
=
result_list
.
data
.
rows
[
0
].
value
.
text_content
;
}
return
{
"
id
"
:
id
,
"
content
"
:
content
};
});
}
function
getUrlParameters
(
jio_key
,
view
,
sort_list
,
column_list
,
extended_search
)
{
function
getUrlParameters
(
jio_key
,
view
,
sort_list
,
column_list
,
extended_search
)
{
return
{
return
{
command
:
'
push_history
'
,
command
:
'
push_history
'
,
...
@@ -72,8 +89,7 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
...
@@ -72,8 +89,7 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
var
state_dict
=
{
var
state_dict
=
{
jio_key
:
options
.
jio_key
||
""
,
jio_key
:
options
.
jio_key
||
""
,
project_title
:
options
.
project_title
,
project_title
:
options
.
project_title
,
home_page_content
:
options
.
home_page_content
,
project_reference
:
options
.
project_reference
home_page_jio_key
:
options
.
home_page_jio_key
};
};
return
this
.
changeState
(
state_dict
);
return
this
.
changeState
(
state_dict
);
})
})
...
@@ -81,9 +97,14 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
...
@@ -81,9 +97,14 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
.
onStateChange
(
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
,
var
gadget
=
this
,
base_site
=
window
.
location
.
origin
+
window
.
location
.
pathname
,
base_site
=
window
.
location
.
origin
+
window
.
location
.
pathname
,
project_url
=
base_site
+
modification_dict
.
jio_key
;
project_url
=
base_site
+
modification_dict
.
jio_key
,
web_page_info
;
setLastTestResult
(
gadget
,
modification_dict
.
project_title
,
document
.
getElementById
(
"
test_result_span
"
));
setLastTestResult
(
gadget
,
modification_dict
.
project_title
,
document
.
getElementById
(
"
test_result_span
"
));
return
gadget
.
jio_getAttachment
(
modification_dict
.
jio_key
,
"
links
"
)
return
getWebPage
(
gadget
,
modification_dict
.
project_reference
)
.
push
(
function
(
result
)
{
web_page_info
=
result
;
return
gadget
.
jio_getAttachment
(
modification_dict
.
jio_key
,
"
links
"
);
})
.
push
(
function
(
erp5_document
)
{
.
push
(
function
(
erp5_document
)
{
var
milestone_view
=
getActionListByName
(
ensureArray
(
erp5_document
.
_links
.
view
),
"
milestone
"
);
var
milestone_view
=
getActionListByName
(
ensureArray
(
erp5_document
.
_links
.
view
),
"
milestone
"
);
return
gadget
.
getUrlForList
([
getUrlParameters
(
'
milestone_module
'
,
milestone_view
,
[[
"
stop_date
"
,
"
ascending
"
]]),
return
gadget
.
getUrlForList
([
getUrlParameters
(
'
milestone_module
'
,
milestone_view
,
[[
"
stop_date
"
,
"
ascending
"
]]),
...
@@ -115,7 +136,7 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
...
@@ -115,7 +136,7 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
[
"
title
"
,
"
delivery.start_date
"
,
"
delivery.stop_date
"
,
"
destination_decision_title
"
,
[
"
title
"
,
"
delivery.start_date
"
,
"
delivery.stop_date
"
,
"
destination_decision_title
"
,
"
source_title
"
,
"
destination_title
"
,
"
total_quantity
"
,
"
task_line_quantity_unit_title
"
],
"
source_title
"
,
"
destination_title
"
,
"
total_quantity
"
,
"
task_line_quantity_unit_title
"
],
(
'
source_project_title: "
'
+
modification_dict
.
project_title
+
'
" AND selection_domain_state_task_domain: "not_confirmed"
'
)),
(
'
source_project_title: "
'
+
modification_dict
.
project_title
+
'
" AND selection_domain_state_task_domain: "not_confirmed"
'
)),
getUrlParameters
(
modification_dict
.
home_page_jio_key
,
"
view
"
)
]);
getUrlParameters
(
web_page_info
.
id
,
"
view
"
)
]);
})
})
.
push
(
function
(
url_list
)
{
.
push
(
function
(
url_list
)
{
enableLink
(
document
.
getElementById
(
"
milestone_link
"
),
url_list
[
0
]);
enableLink
(
document
.
getElementById
(
"
milestone_link
"
),
url_list
[
0
]);
...
@@ -132,7 +153,7 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
...
@@ -132,7 +153,7 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
return
gadget
.
getDeclaredGadget
(
"
editor
"
);
return
gadget
.
getDeclaredGadget
(
"
editor
"
);
})
})
.
push
(
function
(
editor
)
{
.
push
(
function
(
editor
)
{
editor
.
render
({
"
editor
"
:
"
fck_editor
"
,
"
editable
"
:
false
,
"
value
"
:
modification_dict
.
home_page_
content
});
editor
.
render
({
"
editor
"
:
"
fck_editor
"
,
"
editable
"
:
false
,
"
value
"
:
web_page_info
.
content
});
});
});
})
})
...
...
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