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
140
Merge Requests
140
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
82fb9112
Commit
82fb9112
authored
Jan 02, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_project_ui: refactor in home page query
parent
6a951a69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_viewQuickOverview/my_info_gadget_field.xml
...roject/Project_viewQuickOverview/my_info_gadget_field.xml
+1
-1
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
+18
-11
No files found.
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/Project_viewQuickOverview/my_info_gadget_field.xml
View file @
82fb9112
...
...
@@ -253,7 +253,7 @@
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: {"project_title":here.getTitle(), "jio_key": here.getRelativeUrl(), "project_reference": here.getReference()}
</string>
</value>
<value>
<string>
python: {"project_title":here.getTitle(), "jio_key": here.getRelativeUrl(), "project_reference": here.getReference()
, "home_page_preference": "project_home_page"
}
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js
View file @
82fb9112
...
...
@@ -110,14 +110,14 @@
}));
}
function
getWebPageInfo
(
gadget
,
project_reference
)
{
//TODO fully remove project_reference (render options, TALES exp, etc)
function
getWebPageInfo
(
gadget
,
project_reference
,
home_page_preference
)
{
var
id
,
content
,
edit_view
,
redirector_ulr
,
query
,
query_list
=
[],
valid_state_list
=
[
"
shared_alive
"
,
"
released_alive
"
,
"
published_alive
"
];
query_list
=
[];
query_list
.
push
(
new
SimpleQuery
({
key
:
"
portal_type
"
,
operator
:
"
=
"
,
...
...
@@ -125,10 +125,16 @@
value
:
"
Web Page
"
}));
query_list
.
push
(
new
SimpleQuery
({
key
:
"
referenc
e
"
,
key
:
"
validation_stat
e
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
project_reference
+
'
-Home.Page
'
value
:
(
"
shared_alive
"
,
"
released_alive
"
,
"
published_alive
"
)
}));
query_list
.
push
(
new
SimpleQuery
({
key
:
"
publication_section
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
(
'
project_home_page
'
)
}));
query
=
new
ComplexQuery
({
operator
:
"
AND
"
,
...
...
@@ -140,15 +146,15 @@
redirector_ulr
=
url
;
return
gadget
.
jio_allDocs
({
query
:
Query
.
objectToSearchText
(
query
),
select_list
:
[
'
validation_state
'
,
'
text_content
'
]
select_list
:
[
'
validation_state
'
,
'
text_content
'
,
'
publication_section
'
]
});
})
.
push
(
function
(
result_list
)
{
if
(
result_list
.
data
.
rows
[
0
])
{
var
i
,
state
,
web_page
;
var
i
,
web_page
,
publication_section
;
for
(
i
=
0
;
i
<
result_list
.
data
.
rows
.
length
;
i
=
i
+
1
)
{
state
=
result_list
.
data
.
rows
[
i
].
value
.
validation_state
;
if
(
valid_state_list
.
includes
(
state
)
)
{
publication_section
=
result_list
.
data
.
rows
[
i
].
value
.
publication_section
;
if
(
publication_section
===
home_page_preference
)
{
web_page
=
result_list
.
data
.
rows
[
i
];
break
;
}
...
...
@@ -196,7 +202,8 @@
var
state_dict
=
{
jio_key
:
options
.
jio_key
||
""
,
project_title
:
options
.
project_title
,
project_reference
:
options
.
project_reference
project_reference
:
options
.
project_reference
,
home_page_preference
:
options
.
home_page_preference
};
return
this
.
changeState
(
state_dict
);
})
...
...
@@ -208,7 +215,7 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
getWebPageInfo
(
gadget
,
modification_dict
.
project_reference
),
getWebPageInfo
(
gadget
,
modification_dict
.
project_reference
,
modification_dict
.
home_page_preference
),
gadget
.
getDeclaredGadget
(
"
editor
"
),
gadget
.
getSetting
(
"
hateoas_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