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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
cacb5772
Commit
cacb5772
authored
Mar 30, 2016
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui : Have Jump actions in Tab page, tab page accessible for none editable
parent
24121747
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
59 deletions
+45
-59
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.js
...eItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.js
+1
-40
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
+2
-2
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
+42
-17
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_actionpage_js.js
View file @
cacb5772
...
...
@@ -45,7 +45,6 @@
var
gadget
=
this
,
erp5_document
,
result_list
,
view_list
,
workflow_list
,
action_list
,
inner_html
;
...
...
@@ -60,28 +59,12 @@
erp5_document
=
result
;
workflow_list
=
erp5_document
.
_links
.
action_workflow
||
[];
action_list
=
erp5_document
.
_links
.
action_object_action
||
[];
view_list
=
erp5_document
.
_links
.
view
;
if
(
view_list
.
constructor
!==
Array
)
{
view_list
=
[
view_list
];
}
if
(
workflow_list
.
constructor
!==
Array
)
{
workflow_list
=
[
workflow_list
];
}
if
(
action_list
.
constructor
!==
Array
)
{
action_list
=
[
action_list
];
}
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
"
view
"
,
page
:
undefined
,
editable
:
undefined
}}));
for
(
i
=
0
;
i
<
view_list
.
length
-
1
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
view_list
[
i
].
href
,
editable
:
true
,
page
:
undefined
}}));
}
for
(
i
=
0
;
i
<
workflow_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
workflow_list
[
i
].
href
,
page
:
undefined
,
editable
:
undefined
}}));
}
...
...
@@ -95,20 +78,11 @@
})
.
push
(
function
(
all_result
)
{
var
i
,
j
,
tab_list
=
[],
workflow_action_list
=
[],
action_tab_list
=
[];
result_list
=
all_result
;
j
=
3
;
for
(
i
=
0
;
i
<
view_list
.
length
-
1
;
i
+=
1
)
{
tab_list
.
push
({
title
:
view_list
[
i
].
title
,
link
:
all_result
[
j
],
i18n
:
view_list
[
i
].
title
});
j
+=
1
;
}
j
=
2
;
for
(
i
=
0
;
i
<
workflow_list
.
length
;
i
+=
1
)
{
workflow_action_list
.
push
({
title
:
workflow_list
[
i
].
title
,
...
...
@@ -126,19 +100,6 @@
j
+=
1
;
}
inner_html
=
table_template
({
definition_title
:
"
Views
"
,
definition_i18n
:
"
Views
"
,
definition_icon
:
"
eye
"
,
documentlist
:
[{
title
:
view_list
[
0
].
title
,
link
:
all_result
[
2
]
}]
})
+
table_template
({
definition_title
:
"
Editables
"
,
definition_i18n
:
"
Editables
"
,
definition_icon
:
"
edit
"
,
documentlist
:
tab_list
})
+
table_template
({
definition_title
:
"
Workflow Transitions
"
,
documentlist
:
workflow_action_list
,
definition_i18n
:
"
Workflow-Transitions
"
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
cacb5772
...
...
@@ -57,13 +57,13 @@
gadget
.
getUrlFor
({
command
:
'
history_previous
'
}),
gadget
.
getUrlFor
({
command
:
'
selection_previous
'
}),
gadget
.
getUrlFor
({
command
:
'
selection_next
'
}),
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
jump
"
}})
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
tab
"
}})
]);
})
.
push
(
function
(
all_result
)
{
return
gadget
.
updateHeader
({
jump
_url
:
all_result
[
7
],
tab
_url
:
all_result
[
7
],
actions_url
:
all_result
[
2
],
previous_url
:
all_result
[
5
],
next_url
:
all_result
[
6
],
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
View file @
cacb5772
/*global window, rJS, RSVP, Handlebars */
/*global window, rJS, RSVP, Handlebars
, URI
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
)
{
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
)
{
"
use strict
"
;
/////////////////////////////////////////////////////////////////
...
...
@@ -44,22 +44,33 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
view_list
,
tab_list
=
[],
jump_action_list
=
[],
gadget
=
this
,
erp5_document
;
erp5_document
,
jump_list
;
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
links
"
)
.
push
(
function
(
result
)
{
var
i
,
promise_list
=
[];
erp5_document
=
result
,
view_list
=
erp5_document
.
_links
.
view
;
erp5_document
=
result
;
view_list
=
erp5_document
.
_links
.
view
||
[];
jump_list
=
erp5_document
.
_links
.
action_object_jump
||
[];
// All ERP5 document should at least have one view.
// So, no need normally to test undefined
if
(
view_list
.
constructor
!==
Array
)
{
view_list
=
[
view_list
];
}
if
(
jump_list
.
constructor
!==
Array
)
{
jump_list
=
[
jump_list
];
}
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
"
view
"
,
page
:
undefined
,
editable
:
undefined
}}));
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
view_list
[
i
].
href
,
...
...
@@ -67,37 +78,51 @@
page
:
undefined
}}));
}
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
"
view
"
,
page
:
undefined
,
editable
:
undefined
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
'
}}));
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
(
all_result
)
{
var
i
;
for
(
i
=
0
;
i
<
all_resul
t
.
length
-
1
;
i
+=
1
)
{
var
i
,
j
;
j
=
1
;
for
(
i
=
0
;
i
<
view_lis
t
.
length
-
1
;
i
+=
1
)
{
tab_list
.
push
({
title
:
view_list
[
i
].
title
,
i18n
:
view_list
[
i
].
title
,
link
:
all_result
[
i
]
link
:
all_result
[
j
]
});
j
+=
1
;
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
jump_action_list
.
push
({
title
:
jump_list
[
i
].
title
,
link
:
all_result
[
j
],
i18n
:
jump_list
[
i
].
title
});
j
+=
1
;
}
return
gadget
.
translateHtml
(
table_template
({
definition_title
:
"
Views
"
,
definition_i18n
:
"
Views
"
,
definition_icon
:
"
eye
"
,
documentlist
:
[{
title
:
view_list
[
0
].
title
,
link
:
all_result
[
all_result
.
length
-
1
]
link
:
all_result
[
0
]
}]
})
+
table_template
({
definition_title
:
"
Editables
"
,
definition_i18n
:
"
Editables
"
,
definition_icon
:
"
edit
"
,
documentlist
:
tab_list
})
+
table_template
({
definition_title
:
"
Jumps
"
,
documentlist
:
jump_action_list
,
definition_icon
:
"
plane
"
,
definition_i18n
:
"
Jumps
"
}));
})
.
push
(
function
(
my_translated_html
)
{
...
...
@@ -119,4 +144,4 @@
});
});
}(
window
,
rJS
,
RSVP
,
Handlebars
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
));
\ No newline at end of file
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