luisoala commited on
Commit
2d7ff06
·
1 Parent(s): f4f2229

collapse fix

Browse files
Files changed (1) hide show
  1. app.py +10 -20
app.py CHANGED
@@ -97,6 +97,15 @@ def create_ui():
97
  .arrow-down {
98
  transform: rotate(90deg);
99
  }
 
 
 
 
 
 
 
 
 
100
  </style>
101
  """)
102
 
@@ -127,7 +136,7 @@ def create_ui():
127
 
128
  html += f'''
129
  <div class="validation-step" id="step-{i}">
130
- <div class="step-header" onclick="toggleDetails('{i}')">
131
  <div class="step-left">
132
  <div class="step-status {status_class}">{status_icon}</div>
133
  <div class="step-title">{test_name}</div>
@@ -142,25 +151,6 @@ def create_ui():
142
 
143
  html += '</div>'
144
 
145
- html += '''
146
- <script>
147
- function toggleDetails(id) {
148
- const details = document.getElementById('details-' + id);
149
- const arrow = document.getElementById('arrow-' + id);
150
-
151
- if (details.style.display === 'none') {
152
- details.style.display = 'block';
153
- arrow.classList.add('arrow-down');
154
- } else {
155
- details.style.display = 'none';
156
- arrow.classList.remove('arrow-down');
157
- }
158
- }
159
- </script>
160
- '''
161
-
162
- return gr.update(value=html, visible=True)
163
-
164
  file_input.change(on_file_upload, inputs=file_input, outputs=[upload_progress, validation_results])
165
  validate_btn.click(on_validate, inputs=file_input, outputs=validation_results)
166
 
 
97
  .arrow-down {
98
  transform: rotate(90deg);
99
  }
100
+ .status-success {
101
+ background-color: #4caf50;
102
+ }
103
+ .status-error {
104
+ background-color: #f44336;
105
+ }
106
+ .status-waiting {
107
+ background-color: #9e9e9e;
108
+ }
109
  </style>
110
  """)
111
 
 
136
 
137
  html += f'''
138
  <div class="validation-step" id="step-{i}">
139
+ <div class="step-header" onclick="document.getElementById('details-{i}').style.display = document.getElementById('details-{i}').style.display === 'none' ? 'block' : 'none'; document.getElementById('arrow-{i}').className = document.getElementById('details-{i}').style.display === 'none' ? 'arrow-indicator' : 'arrow-indicator arrow-down';">
140
  <div class="step-left">
141
  <div class="step-status {status_class}">{status_icon}</div>
142
  <div class="step-title">{test_name}</div>
 
151
 
152
  html += '</div>'
153
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  file_input.change(on_file_upload, inputs=file_input, outputs=[upload_progress, validation_results])
155
  validate_btn.click(on_validate, inputs=file_input, outputs=validation_results)
156