changeset 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 f7fadbac5856
children db435e272f26
files share/roundup/templates/classic/html/page.html share/roundup/templates/devel/html/page.html share/roundup/templates/minimal/html/page.html share/roundup/templates/responsive/html/page.html
diffstat 4 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/share/roundup/templates/classic/html/page.html	Mon Sep 22 14:12:46 2025 -0400
+++ b/share/roundup/templates/classic/html/page.html	Thu Sep 25 23:30:07 2025 -0400
@@ -369,7 +369,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 -->
--- 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 -->
--- a/share/roundup/templates/minimal/html/page.html	Mon Sep 22 14:12:46 2025 -0400
+++ b/share/roundup/templates/minimal/html/page.html	Thu Sep 25 23:30:07 2025 -0400
@@ -331,7 +331,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 -->
--- a/share/roundup/templates/responsive/html/page.html	Mon Sep 22 14:12:46 2025 -0400
+++ b/share/roundup/templates/responsive/html/page.html	Thu Sep 25 23:30:07 2025 -0400
@@ -439,7 +439,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 -->

Roundup Issue Tracker: http://roundup-tracker.org/