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
Léo-Paul Géneau
erp5
Commits
1a807abb
Commit
1a807abb
authored
May 12, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: show user on the logout page
Drop user informations from language page
parent
aa0a7c72
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
106 additions
and
76 deletions
+106
-76
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_html.html
...tem/web_page_module/rjs_gadget_erp5_pt_language_html.html
+0
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_html.xml
...Item/web_page_module/rjs_gadget_erp5_pt_language_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_js.js
...ateItem/web_page_module/rjs_gadget_erp5_pt_language_js.js
+8
-34
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_js.xml
...teItem/web_page_module/rjs_gadget_erp5_pt_language_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_html.html
...m/web_page_module/rjs_gadget_erp5_pt_logoutform_html.html
+12
-10
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_html.xml
...em/web_page_module/rjs_gadget_erp5_pt_logoutform_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_js.js
...eItem/web_page_module/rjs_gadget_erp5_pt_logoutform_js.js
+78
-23
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_js.xml
...Item/web_page_module/rjs_gadget_erp5_pt_logoutform_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_html.html
View file @
1a807abb
<!DOCTYPE html>
<html>
<!--
data-i18n=User
data-i18n=Language
data-i18n=Update
-->
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_html.xml
View file @
1a807abb
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
81.54790.20438.51626
</string>
</value>
<value>
<string>
9
91.57853.23997.31232
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>
1
581677271.66
</float>
<float>
1
620830688.79
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_js.js
View file @
1a807abb
...
...
@@ -20,45 +20,26 @@
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
,
first_result_list
;
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getUrlForList
([{
command
:
'
display
'
}]),
gadget
.
getSettingList
([
'
me
'
,
'
language_map
'
,
'
selected_language
'
,
gadget
.
getSettingList
([
'
language_map
'
,
'
selected_language
'
,
'
default_selected_language
'
]),
gadget
.
getDeclaredGadget
(
"
erp5_form
"
),
gadget
.
getTranslationList
([
'
Language
'
,
'
U
ser
'
,
'
U
pdate
'
])
gadget
.
getTranslationList
([
'
Language
'
,
'
Update
'
])
]);
})
.
push
(
function
(
result_list
)
{
first_result_list
=
result_list
;
var
me
=
result_list
[
1
][
0
];
if
(
me
!==
undefined
)
{
return
gadget
.
jio_allDocs
({
query
:
'
relative_url:"
'
+
me
+
'
"
'
,
select_list
:
[
'
title
'
]
});
}
})
.
push
(
function
(
result
)
{
var
user
,
selected_language
=
first_result_list
[
1
][
2
]
||
first_result_list
[
1
][
3
],
.
push
(
function
(
first_result_list
)
{
var
selected_language
=
first_result_list
[
1
][
1
]
||
first_result_list
[
1
][
2
],
key
,
list_item
=
[],
options
=
JSON
.
parse
(
first_result_list
[
1
][
1
]);
options
=
JSON
.
parse
(
first_result_list
[
1
][
0
]);
gadget
.
state
.
old_selected_lang
=
selected_language
;
// Calculate user name
if
(
result
===
undefined
)
{
user
=
"
Who are you?
"
;
}
else
{
user
=
result
.
data
.
rows
[
0
].
value
.
title
;
}
// Calculate possible language list
for
(
key
in
options
)
{
if
(
options
.
hasOwnProperty
(
key
))
{
...
...
@@ -81,13 +62,6 @@
first_result_list
[
2
].
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
'
User
'
:
{
"
default
"
:
user
,
"
editable
"
:
0
,
"
key
"
:
"
field_user
"
,
"
title
"
:
first_result_list
[
3
][
1
],
"
type
"
:
"
StringField
"
},
'
Language
'
:
{
"
default
"
:
selected_language
,
"
editable
"
:
1
,
...
...
@@ -107,7 +81,7 @@
form_definition
:
{
group_list
:
[[
"
left
"
,
[[
"
User
"
],
[
"
Language
"
]]
[[
"
Language
"
]]
]]
}
})
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_language_js.xml
View file @
1a807abb
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
81.54793.39964.17766
</string>
</value>
<value>
<string>
9
92.854.10678.4949
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1
581677388.59
</float>
<float>
1
620830966.27
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_html.html
View file @
1a807abb
<!DOCTYPE html>
<html>
<!--
data-i18n=User
data-i18n=Confirm
-->
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width"
/>
<title>
ERP5 PT Log
in
page
</title>
<title>
ERP5 PT Log
out
page
</title>
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"interface_page.html"
>
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"jiodev.js"
type=
"text/javascript"
></script>
<script
src=
"domsugar.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_erp5_page_logout.js"
type=
"text/javascript"
></script>
</head>
<body>
<
article
>
<
secti
on>
<form>
<input
type=
"submit"
/
>
</form
>
</
section
>
</
article
>
<
form
>
<
button
type=
"submit"
class=
"ui-icon-edit ui-btn-icon-right ui-screen-hidden"
></butt
on>
<div
data-gadget-url=
"gadget_erp5_form.html"
data-gadget-scope=
"erp5_form"
data-gadget-sandbox=
"public"
>
</div>
<div
class=
"dialog_button_container"
>
</
div
>
</
form
>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_html.xml
View file @
1a807abb
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
71.52441.15467.16503
</string>
</value>
<value>
<string>
9
92.824.37160.29132
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>
1
542905896.75
</float>
<float>
1
620830587.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_js.js
View file @
1a807abb
/*global window, rJS, UriTemplate */
/*global window, rJS, UriTemplate
, domsugar, RSVP
*/
/*jslint indent: 2, maxerr: 3, nomen: true */
(
function
(
window
,
rJS
,
UriTemplate
)
{
(
function
(
window
,
rJS
,
UriTemplate
,
domsugar
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
...
...
@@ -9,10 +9,12 @@
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
List
"
,
"
getUrlForLis
t
"
)
.
declareAcquiredMethod
(
"
getUrlFor
Dict
"
,
"
getUrlForDic
t
"
)
.
declareAcquiredMethod
(
"
jio_getAttachment
"
,
"
jio_getAttachment
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
getTranslationDict
"
,
"
getTranslationDict
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
/////////////////////////////////////////////////////////////////
// declared methods
...
...
@@ -20,25 +22,78 @@
.
declareMethod
(
"
render
"
,
function
()
{
var
gadget
=
this
;
return
gadget
.
getUrlForList
([
// Back url
{
command
:
'
display
'
},
// Change language
{
command
:
'
display
'
,
options
:
{
page
:
'
language
'
}}
])
.
push
(
function
(
url_list
)
{
return
gadget
.
updateHeader
({
page_title
:
'
Logout
'
,
page_icon
:
'
power-off
'
,
front_url
:
url_list
[
0
],
language_url
:
url_list
[
1
]
});
})
.
push
(
function
()
{
return
gadget
.
translate
(
'
Confirm
'
);
return
new
RSVP
.
Queue
(
RSVP
.
hash
({
translation
:
gadget
.
getTranslationDict
([
'
Confirm
'
,
'
User
'
]),
me
:
gadget
.
getSetting
(
'
me
'
)
.
push
(
function
(
me
)
{
if
(
me
!==
undefined
)
{
return
gadget
.
jio_allDocs
({
query
:
'
relative_url:"
'
+
me
+
'
"
'
,
select_list
:
[
'
title
'
]
});
}
})
.
push
(
function
(
result
)
{
var
user
;
// Calculate user name
if
(
result
===
undefined
)
{
user
=
"
Who are you?
"
;
}
else
{
user
=
result
.
data
.
rows
[
0
].
value
.
title
;
}
return
user
;
}),
erp5_form
:
gadget
.
getDeclaredGadget
(
"
erp5_form
"
),
url_dict
:
gadget
.
getUrlForDict
({
// Back url
back
:
{
command
:
'
display
'
},
// Change language
change_language
:
{
command
:
'
display
'
,
options
:
{
page
:
'
language
'
}}
})
.
push
(
function
(
translated_text
)
{
gadget
.
element
.
querySelector
(
'
input
'
).
value
=
translated_text
;
}))
.
push
(
function
(
result_dict
)
{
domsugar
(
gadget
.
element
.
querySelector
(
'
.dialog_button_container
'
),
[
domsugar
(
'
input
'
,
{
name
:
'
action_update
'
,
type
:
'
submit
'
,
value
:
result_dict
.
translation
.
Confirm
})
]);
return
RSVP
.
all
([
gadget
.
updateHeader
({
page_title
:
'
Logout
'
,
page_icon
:
'
power-off
'
,
front_url
:
result_dict
.
url_dict
.
back
,
language_url
:
result_dict
.
url_dict
.
change_language
}),
result_dict
.
erp5_form
.
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
'
User
'
:
{
"
default
"
:
result_dict
.
me
,
"
editable
"
:
0
,
"
key
"
:
"
field_user
"
,
"
title
"
:
result_dict
.
translation
.
User
,
"
type
"
:
"
StringField
"
}
}},
"
_links
"
:
{
"
type
"
:
{
// form_list display portal_type in header
name
:
""
}
}
},
form_definition
:
{
group_list
:
[[
"
left
"
,
[[
"
User
"
]]
]]
}
})
]);
});
})
...
...
@@ -67,4 +122,4 @@
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
return
;
});
}(
window
,
rJS
,
UriTemplate
));
\ No newline at end of file
}(
window
,
rJS
,
UriTemplate
,
domsugar
,
RSVP
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_logoutform_js.xml
View file @
1a807abb
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
71.7721.48108.61320
</string>
</value>
<value>
<string>
9
92.849.18457.2065
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1
542905890.66
</float>
<float>
1
620831029.04
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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