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
Hide 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
...
@@ -34,6 +34,7 @@ from OFS.Image import Image as OFSImage
from
lxml.etree
import
Element
from
lxml.etree
import
Element
from
lxml
import
etree
from
lxml
import
etree
import
re
import
re
from
zLOG
import
LOG
DRAW_URI
=
'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'
DRAW_URI
=
'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'
TEXT_URI
=
'urn:oasis:names:tc:opendocument:xmlns:text:1.0'
TEXT_URI
=
'urn:oasis:names:tc:opendocument:xmlns:text:1.0'
...
@@ -104,6 +105,7 @@ class ImageFieldWidget(Widget.TextWidget):
...
@@ -104,6 +105,7 @@ class ImageFieldWidget(Widget.TextWidget):
image
=
value
image
=
value
alt
=
field
.
get_value
(
'description'
)
or
\
alt
=
field
.
get_value
(
'description'
)
or
\
field
.
get_value
(
'title'
)
field
.
get_value
(
'title'
)
title
=
field
.
get_value
(
'title'
)
css_class
=
field
.
get_value
(
'css_class'
)
css_class
=
field
.
get_value
(
'css_class'
)
extra
=
field
.
get_value
(
'extra'
)
extra
=
field
.
get_value
(
'extra'
)
options
=
{}
options
=
{}
...
@@ -119,13 +121,16 @@ class ImageFieldWidget(Widget.TextWidget):
...
@@ -119,13 +121,16 @@ class ImageFieldWidget(Widget.TextWidget):
if
v
])
if
v
])
if
parameters
:
if
parameters
:
image
=
'%s?%s'
%
(
image
,
parameters
)
image
=
'%s?%s'
%
(
image
,
parameters
)
return
Widget
.
render_element
(
x
=
Widget
.
render_element
(
"img"
,
"img"
,
alt
=
alt
,
alt
=
alt
,
title
=
title
,
src
=
image
,
src
=
image
,
css_class
=
css_class
,
css_class
=
css_class
,
extra
=
extra
,
extra
=
extra
,
)
)
LOG
(
'Testing... '
,
0
,
x
)
return
x
def
render_odg_view
(
self
,
field
,
value
,
as_string
,
ooo_builder
,
REQUEST
,
def
render_odg_view
(
self
,
field
,
value
,
as_string
,
ooo_builder
,
REQUEST
,
render_prefix
,
attr_dict
,
local_name
):
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