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
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
bff389a3
Commit
bff389a3
authored
Sep 17, 2021
by
Lu Xu
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ImageField: add title
parent
e08ace32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
product/ERP5Form/ImageField.py
product/ERP5Form/ImageField.py
+6
-1
No files found.
product/ERP5Form/ImageField.py
View file @
bff389a3
...
...
@@ -34,6 +34,7 @@ from OFS.Image import Image as OFSImage
from
lxml.etree
import
Element
from
lxml
import
etree
import
re
from
zLOG
import
LOG
DRAW_URI
=
'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'
TEXT_URI
=
'urn:oasis:names:tc:opendocument:xmlns:text:1.0'
...
...
@@ -104,6 +105,7 @@ class ImageFieldWidget(Widget.TextWidget):
image
=
value
alt
=
field
.
get_value
(
'description'
)
or
\
field
.
get_value
(
'title'
)
title
=
field
.
get_value
(
'title'
)
css_class
=
field
.
get_value
(
'css_class'
)
extra
=
field
.
get_value
(
'extra'
)
options
=
{}
...
...
@@ -119,13 +121,16 @@ class ImageFieldWidget(Widget.TextWidget):
if
v
])
if
parameters
:
image
=
'%s?%s'
%
(
image
,
parameters
)
return
Widget
.
render_element
(
x
=
Widget
.
render_element
(
"img"
,
alt
=
alt
,
title
=
title
,
src
=
image
,
css_class
=
css_class
,
extra
=
extra
,
)
LOG
(
'Testing... '
,
0
,
x
)
return
x
def
render_odg_view
(
self
,
field
,
value
,
as_string
,
ooo_builder
,
REQUEST
,
render_prefix
,
attr_dict
,
local_name
):
...
...
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