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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
erp5
Commits
7775c2dc
Commit
7775c2dc
authored
Jun 09, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formultor: add input_type parameter in TextWidget.
parent
27052298
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
product/Formulator/Widget.py
product/Formulator/Widget.py
+13
-3
No files found.
product/Formulator/Widget.py
View file @
7775c2dc
...
@@ -325,7 +325,7 @@ class TextWidget(Widget):
...
@@ -325,7 +325,7 @@ class TextWidget(Widget):
"""Text widget
"""Text widget
"""
"""
property_names
=
Widget
.
property_names
+
\
property_names
=
Widget
.
property_names
+
\
[
'display_width'
,
'display_maxwidth'
,
'extra'
]
[
'display_width'
,
'display_maxwidth'
,
'
input_type'
,
'
extra'
]
default
=
fields
.
StringField
(
'default'
,
default
=
fields
.
StringField
(
'default'
,
title
=
'Default'
,
title
=
'Default'
,
...
@@ -352,13 +352,23 @@ class TextWidget(Widget):
...
@@ -352,13 +352,23 @@ class TextWidget(Widget):
default
=
""
,
default
=
""
,
required
=
0
)
required
=
0
)
input_type
=
fields
.
StringField
(
'input_type'
,
title
=
'Input type'
,
description
=
(
"The type of the input field like 'color', 'date', 'email' etc."
"Note input types, not supported by old web browsers, will behave "
"as input type text."
),
default
=
"text"
,
required
=
0
)
def
render
(
self
,
field
,
key
,
value
,
REQUEST
,
render_prefix
=
None
):
def
render
(
self
,
field
,
key
,
value
,
REQUEST
,
render_prefix
=
None
):
"""Render text input field.
"""Render text input field.
"""
"""
display_maxwidth
=
field
.
get_value
(
'display_maxwidth'
)
or
0
display_maxwidth
=
field
.
get_value
(
'display_maxwidth'
)
or
0
input_type
=
field
.
get_value
(
'input_type'
)
or
'text'
if
display_maxwidth
>
0
:
if
display_maxwidth
>
0
:
return
render_element
(
"input"
,
return
render_element
(
"input"
,
type
=
"text"
,
type
=
input_type
,
name
=
key
,
name
=
key
,
css_class
=
field
.
get_value
(
'css_class'
),
css_class
=
field
.
get_value
(
'css_class'
),
value
=
value
,
value
=
value
,
...
@@ -367,7 +377,7 @@ class TextWidget(Widget):
...
@@ -367,7 +377,7 @@ class TextWidget(Widget):
extra
=
field
.
get_value
(
'extra'
))
extra
=
field
.
get_value
(
'extra'
))
else
:
else
:
return
render_element
(
"input"
,
return
render_element
(
"input"
,
type
=
"text"
,
type
=
input_type
,
name
=
key
,
name
=
key
,
css_class
=
field
.
get_value
(
'css_class'
),
css_class
=
field
.
get_value
(
'css_class'
),
value
=
value
,
value
=
value
,
...
...
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