Mercurial > p > roundup > code
diff share/roundup/templates/devel/html/page.html @ 8458:15a92b0a9b79
fix: make user_src_input generate valid javascript
user_src_input used to generate False if edit_ok == False in this
statement:
tal:attributes="onblur python:edit_ok and 'split_name(this)';
but False isn't a boolean in javascript, so it throws an error in the
console. Changed to use:
tal:attributes="onblur python:'split_name(this)' if edit_ok else '';
which generates an empty onblur if the field is not editable.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 25 Sep 2025 23:30:07 -0400 |
| parents | 4ac0bbb3e440 |
| children | 4184173d364f |
line wrap: on
line diff
--- a/share/roundup/templates/devel/html/page.html Mon Sep 22 14:12:46 2025 -0400 +++ b/share/roundup/templates/devel/html/page.html Thu Sep 25 23:30:07 2025 -0400 @@ -424,7 +424,7 @@ <!-- src: value will be re-used for other input fields --> <input metal:define-macro="user_src_input" - type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)'; + type="text" tal:attributes="onblur python:'split_name(this)' if edit_ok else ''; id name; name name; value value; readonly not:edit_ok" value="heinz.kunz"/> <!-- normal: no re-using -->
