Spaces:
Runtime error
Runtime error
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Edit CSV via Speech</title> | |
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}"> | |
</head> | |
<body> | |
<h1>Edit CSV via Speech</h1> | |
<form method="POST" enctype="multipart/form-data"> | |
<!-- Recording Button --> | |
<div> | |
<button type="submit" name="record">π€ Record</button> | |
</div> | |
<!-- Display Transcription --> | |
<div> | |
<label for="transcription">Transcription:</label> | |
<textarea id="transcription" name="transcription" rows="4" cols="50" readonly>{{ transcription }}</textarea> | |
</div> | |
<!-- Upload CSV File --> | |
<div> | |
<input type="file" name="csv_file" accept=".csv"> | |
</div> | |
<!-- Process and Clear Buttons --> | |
<div> | |
<button type="submit" name="process">Process</button> | |
<button type="submit" name="clear">Clear</button> | |
</div> | |
</form> | |
<!-- Data Comparison Section --> | |
{% if original_data and updated_data %} | |
<div class="data-diff-section"> | |
<h2>Original vs Updated Data</h2> | |
<div class="data-comparison"> | |
<!-- Original Data Table --> | |
<div class="data-table"> | |
<h3>Original Data</h3> | |
<table> | |
<thead> | |
<tr> | |
{% for col in original_data.columns %} | |
<th>{{ col }}</th> | |
{% endfor %} | |
</tr> | |
</thead> | |
<tbody> | |
{% for row in original_data.itertuples() %} | |
<tr> | |
{% for col in row[1:] %} | |
<td>{{ col }}</td> | |
{% endfor %} | |
</tr> | |
{% endfor %} | |
</tbody> | |
</table> | |
</div> | |
<!-- Updated Data Table --> | |
<div class="data-table"> | |
<h3>Updated Data</h3> | |
<table> | |
<thead> | |
<tr> | |
{% for col in updated_data.columns %} | |
<th>{{ col }}</th> | |
{% endfor %} | |
</tr> | |
</thead> | |
<tbody> | |
{% for row in updated_data.itertuples() %} | |
<tr> | |
{% for col in row[1:] %} | |
<td>{{ col }}</td> | |
{% endfor %} | |
</tr> | |
{% endfor %} | |
</tbody> | |
</table> | |
</div> | |
</div> | |
</div> | |
<!-- Download Buttons --> | |
<div> | |
<form method="GET" action="{{ url_for('download_csv', filename='original') }}"> | |
<button type="submit">Download Original CSV</button> | |
</form> | |
<form method="GET" action="{{ url_for('download_csv', filename='updated') }}"> | |
<button type="submit">Download Updated CSV</button> | |
</form> | |
</div> | |
{% endif %} | |
</body> | |
</html> | |