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
Lukas Niegsch
erp5
Commits
d6d2f47d
Commit
d6d2f47d
authored
Feb 25, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: add support for LinkField
parent
7f0ce885
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
780 additions
and
4 deletions
+780
-4
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.js
...ateItem/web_page_module/rjs_gadget_erp5_label_field_js.js
+2
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.xml
...teItem/web_page_module/rjs_gadget_erp5_label_field_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_html.html
...eItem/web_page_module/rjs_gadget_erp5_linkfield_html.html
+19
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_html.xml
...teItem/web_page_module/rjs_gadget_erp5_linkfield_html.xml
+334
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_js.js
...plateItem/web_page_module/rjs_gadget_erp5_linkfield_js.js
+89
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_js.xml
...lateItem/web_page_module/rjs_gadget_erp5_linkfield_js.xml
+330
-0
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
...skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
+2
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_interface_validator_zuite/testERP5Interface.zpt
...nderjs_ui_interface_validator_zuite/testERP5Interface.zpt
+1
-1
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
d6d2f47d
...
...
@@ -512,7 +512,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
if
meta_type
in
(
"StringField"
,
"FloatField"
,
"EmailField"
,
"TextAreaField"
,
"LinesField"
,
"ImageField"
,
"FileField"
,
"IntegerField"
,
"PasswordField"
,
"EditorField"
,
"HyperLinkField"
):
"PasswordField"
,
"EditorField"
,
"HyperLinkField"
,
"LinkField"
):
if
meta_type
==
"FloatField"
:
result
.
update
({
"precision"
:
field
.
get_value
(
"precision"
),
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.js
View file @
d6d2f47d
...
...
@@ -32,6 +32,8 @@
field_url
=
'
gadget_erp5_field_string.html
'
;
}
else
if
(
field_type
===
'
HyperLinkField
'
)
{
field_url
=
'
gadget_erp5_field_hyperlink.html
'
;
}
else
if
(
field_type
===
'
LinkField
'
)
{
field_url
=
'
gadget_erp5_field_link.html
'
;
}
else
if
(
field_type
===
'
LinesField
'
)
{
field_url
=
'
gadget_erp5_field_lines.html
'
;
}
else
if
(
field_type
===
'
PasswordField
'
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.xml
View file @
d6d2f47d
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
7.16240.14459.45960
</string>
</value>
<value>
<string>
98
9.58905.49586.62361
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
16
02525354.74
</float>
<float>
16
14349412.76
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_html.html
0 → 100644
View file @
d6d2f47d
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width"
/>
<title>
ERP5 Link field
</title>
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"interface_erp5_field.html"
>
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"interface_erp5_form_content_provider.html"
>
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_erp5_field_link.js"
type=
"text/javascript"
></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_html.xml
0 → 100644
View file @
d6d2f47d
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_js.js
0 → 100644
View file @
d6d2f47d
/*global window, document, rJS */
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
document
,
rJS
)
{
"
use strict
"
;
rJS
(
window
)
.
setState
({
tag
:
'
a
'
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
field_json
=
options
.
field_json
||
{},
state_dict
=
{
value
:
field_json
.
value
||
field_json
.
default
||
""
,
editable
:
field_json
.
editable
,
required
:
field_json
.
required
,
id
:
field_json
.
key
,
name
:
field_json
.
key
,
error_text
:
field_json
.
error_text
,
title
:
field_json
.
description
,
label
:
field_json
.
title
,
hidden
:
field_json
.
hidden
,
trim
:
true
,
// Force calling subfield render
// as user may have modified the input value
render_timestamp
:
new
Date
().
getTime
()
};
return
this
.
changeState
(
state_dict
);
})
.
onStateChange
(
function
(
modification_dict
)
{
var
element
=
this
.
element
,
gadget
=
this
,
url
,
result
,
new_div
;
if
(
modification_dict
.
hasOwnProperty
(
'
editable
'
))
{
if
(
gadget
.
state
.
editable
)
{
url
=
'
gadget_html5_input.html
'
;
}
else
{
url
=
'
gadget_html5_element.html
'
;
}
while
(
element
.
firstChild
)
{
element
.
removeChild
(
element
.
firstChild
);
}
new_div
=
document
.
createElement
(
'
div
'
);
element
.
appendChild
(
new_div
);
result
=
this
.
declareGadget
(
url
,
{
scope
:
'
sub
'
,
element
:
new_div
});
}
else
{
result
=
this
.
getDeclaredGadget
(
'
sub
'
);
}
return
result
.
push
(
function
(
input
)
{
var
state
;
if
(
gadget
.
state
.
editable
)
{
state
=
gadget
.
state
;
}
else
{
state
=
{
tag
:
'
a
'
,
href
:
gadget
.
state
.
value
,
text_content
:
gadget
.
state
.
label
};
}
return
input
.
render
(
state
);
});
})
/** Return content even for non-editable cells - be backward compatible! */
.
declareMethod
(
'
getContent
'
,
function
()
{
if
(
this
.
state
.
editable
)
{
return
this
.
getDeclaredGadget
(
'
sub
'
)
.
push
(
function
(
gadget
)
{
return
gadget
.
getContent
();
});
}
return
{};
},
{
mutex
:
'
changestate
'
})
.
declareMethod
(
'
checkValidity
'
,
function
()
{
if
(
this
.
state
.
editable
)
{
return
this
.
getDeclaredGadget
(
'
sub
'
)
.
push
(
function
(
gadget
)
{
return
gadget
.
checkValidity
();
});
}
return
true
;
},
{
mutex
:
'
changestate
'
});
}(
window
,
document
,
rJS
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_linkfield_js.xml
0 → 100644
View file @
d6d2f47d
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
View file @
d6d2f47d
...
...
@@ -43,6 +43,8 @@ url_list = [
'gadget_erp5_field_list.js'
,
'gadget_erp5_field_lines.html'
,
'gadget_erp5_field_lines.js'
,
'gadget_erp5_field_link.html'
,
'gadget_erp5_field_link.js'
,
'gadget_erp5_field_listbox.html'
,
'gadget_erp5_field_listbox.js'
,
'gadget_erp5_field_matrixbox.html'
,
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_interface_validator_zuite/testERP5Interface.zpt
View file @
d6d2f47d
...
...
@@ -13,7 +13,7 @@
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tal:block
tal:define=
"check_configuration python: {'precache_reference': '../renderjs_runner/WebSection_getPrecacheManifest',
'gadget_count': 7
0
}"
>
'gadget_count': 7
1
}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUiInterface/macros/run_app_interface_check"
/>
</tal:block>
...
...
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