# HG changeset patch # User Thierry Florac # Date 1610543160 -3600 # Node ID 8072c47cdecd6f2c24b895d919af558fa0308811 # Parent 4dc6b3af78373ec043fc2972b83c26f826267dba Updated Select2 widget templates diff -r 4dc6b3af7837 -r 8072c47cdecd src/pyams_form/widget/templates/hidden-select-display.pt --- a/src/pyams_form/widget/templates/hidden-select-display.pt Tue Jan 12 13:34:29 2021 +0100 +++ b/src/pyams_form/widget/templates/hidden-select-display.pt Wed Jan 13 14:06:00 2021 +0100 @@ -3,29 +3,29 @@
+ data-ams-select2-values="${view/values_map}" + data-ams-select2-multiple="${python:'true' if view.multiple else None}" />
\ No newline at end of file diff -r 4dc6b3af7837 -r 8072c47cdecd src/pyams_form/widget/templates/hidden-select-input.pt --- a/src/pyams_form/widget/templates/hidden-select-input.pt Tue Jan 12 13:34:29 2021 +0100 +++ b/src/pyams_form/widget/templates/hidden-select-input.pt Wed Jan 13 14:06:00 2021 +0100 @@ -1,38 +1,37 @@ \ No newline at end of file diff -r 4dc6b3af7837 -r 8072c47cdecd src/pyams_form/widget/templates/select-display.pt --- a/src/pyams_form/widget/templates/select-display.pt Tue Jan 12 13:34:29 2021 +0100 +++ b/src/pyams_form/widget/templates/select-display.pt Wed Jan 13 14:06:00 2021 +0100 @@ -3,34 +3,35 @@ tal:omit-tag="display_mode" i18n:domain="pyams_form">
- + value="${entry/value}" + selected="${python:'selected' if entry['value'] in view.value else None}"> + ${python:view.get_content(entry) if hasattr(view, 'get_content') else entry['content']} +
\ No newline at end of file diff -r 4dc6b3af7837 -r 8072c47cdecd src/pyams_form/widget/templates/select-input.pt --- a/src/pyams_form/widget/templates/select-input.pt Tue Jan 12 13:34:29 2021 +0100 +++ b/src/pyams_form/widget/templates/select-input.pt Wed Jan 13 14:06:00 2021 +0100 @@ -1,55 +1,53 @@ -