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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
1fd20fa9
Commit
1fd20fa9
authored
Dec 18, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "[erp5_web_renderjs_ui] Use RSVP.hash"
This reverts commit
42f37e39
.
parent
42f37e39
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
215 additions
and
210 deletions
+215
-210
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
...lateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
+64
-47
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.xml
...ateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.xml
+151
-163
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
View file @
1fd20fa9
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*/
*/
function
modifyBreadcrumbList
(
gadget
,
parent_link
,
breadcrumb_action_list
)
{
function
modifyBreadcrumbList
(
gadget
,
parent_link
,
breadcrumb_action_list
)
{
if
(
parent_link
===
undefined
)
{
if
(
parent_link
===
undefined
)
{
return
breadcrumb_action_list
;
return
;
}
}
var
uri
=
new
URI
(
parent_link
.
href
),
var
uri
=
new
URI
(
parent_link
.
href
),
jio_key
=
uri
.
segment
(
2
);
jio_key
=
uri
.
segment
(
2
);
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
title
:
"
ERP5
"
,
title
:
"
ERP5
"
,
link
:
"
#
"
link
:
"
#
"
});
});
return
breadcrumb_action_list
;
return
;
}
}
// Parent is an ERP5 document
// Parent is an ERP5 document
...
@@ -78,66 +78,77 @@
...
@@ -78,66 +78,77 @@
.
onStateChange
(
function
()
{
.
onStateChange
(
function
()
{
var
gadget
=
this
,
var
gadget
=
this
,
erp5_document
;
view_list
=
[],
tab_list
=
[],
jump_action_list
=
[],
breadcrumb_action_list
=
[],
erp5_document
,
tab_title
=
"
Views
"
,
tab_icon
=
"
eye
"
,
jump_list
;
return
gadget
.
jio_getAttachment
(
gadget
.
state
.
jio_key
,
"
links
"
)
return
gadget
.
jio_getAttachment
(
gadget
.
state
.
jio_key
,
"
links
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
erp5_document
=
result
;
var
i
,
var
i
,
tab_promise_list
=
[],
promise_list
=
[];
jump_action_promise_list
=
[],
erp5_document
=
result
;
view_list
=
ensureArray
(
erp5_document
.
_links
.
view
)
view_list
=
ensureArray
(
erp5_document
.
_links
.
view
);
.
concat
(
ensureArray
(
erp5_document
.
_links
.
action_object_jio_view
)),
jump_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_jump
);
jump_list
=
ensureArray
(
erp5_document
.
_links
.
action_object_jump
);
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
tab_promise_list
.
push
(
RSVP
.
hash
({
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
display_with_history
'
,
options
:
{
jio_key
:
gadget
.
state
.
jio_key
,
view
:
view_list
[
i
].
href
,
page
:
undefined
// Views in ERP5 must be forms but because of
// OfficeJS we keep it empty for different default
}}));
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
push_history
'
,
options
:
{
extended_search
:
new
URI
(
jump_list
[
i
].
href
).
query
(
true
).
query
,
page
:
'
search
'
}}));
}
promise_list
.
push
(
modifyBreadcrumbList
(
gadget
,
erp5_document
.
_links
.
parent
||
"
#
"
,
breadcrumb_action_list
)
);
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
(
all_result
)
{
var
i
,
j
;
j
=
0
;
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
tab_list
.
push
({
title
:
view_list
[
i
].
title
,
title
:
view_list
[
i
].
title
,
i18n
:
view_list
[
i
].
title
,
i18n
:
view_list
[
i
].
title
,
link
:
gadget
.
getUrlFor
({
command
:
'
display_with_history
'
,
options
:
{
link
:
all_result
[
j
]
jio_key
:
gadget
.
state
.
jio_key
,
});
view
:
view_list
[
i
].
href
,
j
+=
1
;
page
:
undefined
// Views in ERP5 must be forms but because of
// OfficeJS we keep it empty for different default
}})
}));
}
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
jump_action_
promise_list
.
push
(
RSVP
.
ha
sh
({
jump_action_
list
.
pu
sh
({
title
:
jump_list
[
i
].
title
,
title
:
jump_list
[
i
].
title
,
i18n
:
jump_list
[
i
].
title
,
link
:
all_result
[
j
],
link
:
gadget
.
getUrlFor
({
command
:
'
push_history
'
,
options
:
{
i18n
:
jump_list
[
i
].
title
extended_search
:
new
URI
(
jump_list
[
i
].
href
).
query
(
true
).
query
,
});
page
:
'
search
'
j
+=
1
;
}})
}));
}
}
return
RSVP
.
hash
({
tab_list
:
RSVP
.
all
(
tab_promise_list
),
jump_action_list
:
RSVP
.
all
(
jump_action_promise_list
),
breadcrumb_action_list
:
modifyBreadcrumbList
(
gadget
,
erp5_document
.
_links
.
parent
||
"
#
"
,
[])
});
})
.
push
(
function
(
result_dict
)
{
return
gadget
.
translateHtml
(
table_template
({
return
gadget
.
translateHtml
(
table_template
({
definition_title
:
"
Views
"
,
definition_title
:
tab_title
,
definition_i18n
:
"
Views
"
,
definition_i18n
:
tab_title
,
definition_icon
:
"
eye
"
,
definition_icon
:
tab_icon
,
documentlist
:
result_dict
.
tab_list
documentlist
:
tab_list
})
+
table_template
({
})
+
table_template
({
definition_title
:
"
Jumps
"
,
definition_title
:
"
Jumps
"
,
documentlist
:
result_dict
.
jump_action_list
,
documentlist
:
jump_action_list
,
definition_icon
:
"
plane
"
,
definition_icon
:
"
plane
"
,
definition_i18n
:
"
Jumps
"
definition_i18n
:
"
Jumps
"
})
+
table_template
({
})
+
table_template
({
definition_title
:
"
Breadcrumb
"
,
definition_title
:
"
Breadcrumb
"
,
documentlist
:
result_dict
.
breadcrumb_action_list
,
documentlist
:
breadcrumb_action_list
,
definition_icon
:
"
ellipsis-v
"
,
definition_icon
:
"
ellipsis-v
"
,
definition_i18n
:
"
Breadcrumb
"
definition_i18n
:
"
Breadcrumb
"
}));
}));
...
@@ -145,12 +156,18 @@
...
@@ -145,12 +156,18 @@
.
push
(
function
(
my_translated_html
)
{
.
push
(
function
(
my_translated_html
)
{
gadget
.
element
.
innerHTML
=
my_translated_html
;
gadget
.
element
.
innerHTML
=
my_translated_html
;
return
RSVP
.
hash
({
return
RSVP
.
all
([
back_url
:
gadget
.
getUrlFor
({
command
:
'
cancel_dialog_with_history
'
}),
gadget
.
getUrlFor
({
command
:
'
cancel_dialog_with_history
'
}),
page_title
:
calculatePageTitle
(
gadget
,
erp5_document
)
calculatePageTitle
(
gadget
,
erp5_document
)
}
);
]
);
})
})
.
push
(
gadget
.
updateHeader
.
bind
(
gadget
));
.
push
(
function
(
url_list
)
{
var
dict
=
{
back_url
:
url_list
[
0
],
page_title
:
url_list
[
1
]
};
return
gadget
.
updateHeader
(
dict
);
});
})
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
return
;
return
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.xml
View file @
1fd20fa9
This diff is collapsed.
Click to expand it.
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