luisoala commited on
Commit
e85412e
Β·
1 Parent(s): d08dd28

expand collapse

Browse files
Files changed (1) hide show
  1. app.py +12 -18
app.py CHANGED
@@ -134,9 +134,19 @@ def create_ui():
134
  status_class = "status-success" if passed else "status-error"
135
  status_icon = "βœ“" if passed else "βœ—"
136
 
 
137
  html += f'''
138
  <div class="validation-step" id="step-{i}">
139
- <div class="step-header" onclick="toggleDetails('{i}')">
 
 
 
 
 
 
 
 
 
140
  <div class="step-left">
141
  <div class="step-status {status_class}">{status_icon}</div>
142
  <div class="step-title">{test_name}</div>
@@ -151,23 +161,7 @@ def create_ui():
151
 
152
  html += '</div>'
153
 
154
- html += '''
155
- <script>
156
- function toggleDetails(id) {
157
- const details = document.getElementById('details-' + id);
158
- const arrow = document.getElementById('arrow-' + id);
159
-
160
- if (details.style.display === 'none') {
161
- details.style.display = 'block';
162
- arrow.classList.add('arrow-down');
163
- } else {
164
- details.style.display = 'none';
165
- arrow.classList.remove('arrow-down');
166
- }
167
- }
168
- </script>
169
- '''
170
-
171
  return gr.update(value=html, visible=True)
172
 
173
  file_input.change(on_file_upload, inputs=file_input, outputs=[upload_progress, validation_results])
 
134
  status_class = "status-success" if passed else "status-error"
135
  status_icon = "βœ“" if passed else "βœ—"
136
 
137
+ # Use direct inline JavaScript manipulation instead of a function call
138
  html += f'''
139
  <div class="validation-step" id="step-{i}">
140
+ <div class="step-header" onclick="
141
+ var details = document.getElementById('details-{i}');
142
+ var arrow = document.getElementById('arrow-{i}');
143
+ if(details.style.display === 'none') {{
144
+ details.style.display = 'block';
145
+ arrow.classList.add('arrow-down');
146
+ }} else {{
147
+ details.style.display = 'none';
148
+ arrow.classList.remove('arrow-down');
149
+ }}">
150
  <div class="step-left">
151
  <div class="step-status {status_class}">{status_icon}</div>
152
  <div class="step-title">{test_name}</div>
 
161
 
162
  html += '</div>'
163
 
164
+ # No separate JavaScript function needed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  return gr.update(value=html, visible=True)
166
 
167
  file_input.change(on_file_upload, inputs=file_input, outputs=[upload_progress, validation_results])