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
Yusei Tahara
erp5
Commits
981f2e61
Commit
981f2e61
authored
Jul 30, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: implement support for hyperlink field
parent
41820141
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
729 additions
and
3 deletions
+729
-3
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+6
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_hyperlinkfield_html.html
.../web_page_module/rjs_gadget_erp5_hyperlinkfield_html.html
+20
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_hyperlinkfield_html.xml
...m/web_page_module/rjs_gadget_erp5_hyperlinkfield_html.xml
+334
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_hyperlinkfield_js.js
...Item/web_page_module/rjs_gadget_erp5_hyperlinkfield_js.js
+33
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_hyperlinkfield_js.xml
...tem/web_page_module/rjs_gadget_erp5_hyperlinkfield_js.xml
+330
-0
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/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
...skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
+2
-0
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
981f2e61
...
@@ -512,12 +512,17 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
...
@@ -512,12 +512,17 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
if
meta_type
in
(
"StringField"
,
"FloatField"
,
"EmailField"
,
"TextAreaField"
,
if
meta_type
in
(
"StringField"
,
"FloatField"
,
"EmailField"
,
"TextAreaField"
,
"LinesField"
,
"ImageField"
,
"FileField"
,
"IntegerField"
,
"LinesField"
,
"ImageField"
,
"FileField"
,
"IntegerField"
,
"PasswordField"
,
"EditorField"
):
"PasswordField"
,
"EditorField"
,
"HyperLinkField"
):
if
meta_type
==
"FloatField"
:
if
meta_type
==
"FloatField"
:
result
.
update
({
result
.
update
({
"precision"
:
field
.
get_value
(
"precision"
),
"precision"
:
field
.
get_value
(
"precision"
),
"input_style"
:
field
.
get_value
(
"input_style"
),
"input_style"
:
field
.
get_value
(
"input_style"
),
})
})
if
meta_type
==
"HyperLinkField"
:
result
.
update
({
"extra"
:
field
.
get_value
(
"extra"
),
"href"
:
field
.
get_value
(
"href"
),
})
if
meta_type
==
"ImageField"
:
if
meta_type
==
"ImageField"
:
options
=
{
options
=
{
'display'
:
field
.
get_value
(
'image_display'
),
'display'
:
field
.
get_value
(
'image_display'
),
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_hyperlinkfield_html.html
0 → 100644
View file @
981f2e61
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width"
/>
<title>
ERP5 Hyperlink 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>
<script
src=
"domsugar.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_erp5_field_hyperlink.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_hyperlinkfield_html.xml
0 → 100644
View file @
981f2e61
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_hyperlinkfield_js.js
0 → 100644
View file @
981f2e61
/*global window, rJS, domsugar */
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
domsugar
)
{
"
use strict
"
;
rJS
(
window
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
field_json
=
options
.
field_json
||
{};
return
this
.
changeState
({
text
:
field_json
.
value
||
field_json
.
default
||
""
,
extra
:
field_json
.
extra
||
""
,
href
:
field_json
.
href
||
""
});
})
.
onStateChange
(
function
()
{
// XXX How to support dangerous extra
// XXX Beware, relative links will break the rJS UI
domsugar
(
this
.
element
,
[
domsugar
(
'
a
'
,
{
href
:
this
.
state
.
href
,
text
:
this
.
state
.
text
})]);
})
.
declareMethod
(
'
getContent
'
,
function
()
{
return
{};
})
.
declareMethod
(
'
checkValidity
'
,
function
()
{
return
true
;
});
}(
window
,
rJS
,
domsugar
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_hyperlinkfield_js.xml
0 → 100644
View file @
981f2e61
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.js
View file @
981f2e61
...
@@ -30,6 +30,8 @@
...
@@ -30,6 +30,8 @@
field_url
=
'
gadget_erp5_field_multicheckbox.html
'
;
field_url
=
'
gadget_erp5_field_multicheckbox.html
'
;
}
else
if
(
field_type
===
'
StringField
'
)
{
}
else
if
(
field_type
===
'
StringField
'
)
{
field_url
=
'
gadget_erp5_field_string.html
'
;
field_url
=
'
gadget_erp5_field_string.html
'
;
}
else
if
(
field_type
===
'
HyperLinkField
'
)
{
field_url
=
'
gadget_erp5_field_hyperlink.html
'
;
}
else
if
(
field_type
===
'
LinesField
'
)
{
}
else
if
(
field_type
===
'
LinesField
'
)
{
field_url
=
'
gadget_erp5_field_lines.html
'
;
field_url
=
'
gadget_erp5_field_lines.html
'
;
}
else
if
(
field_type
===
'
PasswordField
'
)
{
}
else
if
(
field_type
===
'
PasswordField
'
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.xml
View file @
981f2e61
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
984.
13775.40486.16469
</string>
</value>
<value>
<string>
984.
41193.2075.29252
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
159
0753601.02
</float>
<float>
159
6116391.77
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/SkinTemplateItem/portal_skins/erp5_web_renderjs/WebSection_getPrecacheManifest.py
View file @
981f2e61
...
@@ -42,6 +42,8 @@ url_list = [
...
@@ -42,6 +42,8 @@ url_list = [
'gadget_erp5_field_formbox.js'
,
'gadget_erp5_field_formbox.js'
,
'gadget_erp5_field_gadget.html'
,
'gadget_erp5_field_gadget.html'
,
'gadget_erp5_field_gadget.js'
,
'gadget_erp5_field_gadget.js'
,
'gadget_erp5_field_hyperlink.html'
,
'gadget_erp5_field_hyperlink.js'
,
'gadget_erp5_field_image.html'
,
'gadget_erp5_field_image.html'
,
'gadget_erp5_field_image.js'
,
'gadget_erp5_field_image.js'
,
'gadget_erp5_field_integer.html'
,
'gadget_erp5_field_integer.html'
,
...
...
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