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 - Gesture Data</title> | |
<style> | |
body { | |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
padding: 20px; | |
background-color: #fafafa; | |
color: #333; | |
} | |
.container { | |
display: grid; | |
grid-template-columns: 1fr 1fr; | |
gap: 20px; | |
margin-top: 20px; | |
} | |
.table-container, .chart-container { | |
border: 1px solid #ddd; | |
padding: 20px; | |
border-radius: 8px; | |
background-color: #ffffff; | |
box-shadow: 0 2px 5px rgba(0,0,0,0.1); | |
} | |
table { | |
width: 100%; | |
border-collapse: collapse; | |
} | |
th, td { | |
padding: 10px; | |
border: 1px solid #ddd; | |
text-align: left; | |
} | |
th { | |
background-color: #f8f8f8; | |
font-weight: 600; | |
} | |
tr:nth-child(even) { | |
background-color: #f9f9f9; | |
} | |
tr:hover { | |
background-color: #f1f1f1; | |
} | |
a, button { | |
display: inline-block; | |
margin-top: 20px; | |
padding: 10px 15px; | |
background-color: #4CAF50; | |
color: white; | |
text-decoration: none; | |
border-radius: 5px; | |
font-weight: bold; | |
cursor: pointer; | |
} | |
a:hover, button:hover { | |
background-color: #45a049; | |
} | |
h1, h2 { | |
color: #333; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Edit CSV via Speech - Gesture Data Overview</h1> | |
<!-- CSV Upload Section --> | |
<form method="POST" enctype="multipart/form-data"> | |
<div> | |
<input type="file" name="csv_file" accept=".csv" onchange="this.form.submit()"> | |
</div> | |
<!-- Recording Section --> | |
<div> | |
<label for="transcription">Transcription:</label> | |
<textarea id="transcription" name="transcription" rows="4" cols="50" readonly>{{ transcription }}</textarea> | |
</div> | |
<div> | |
<button type="submit" name="record">π€ Record</button> | |
<button type="submit" name="clear">Clear</button> | |
</div> | |
</form> | |
<!-- Data Comparison Section --> | |
{% if original_data is not none and updated_data is not none %} | |
<div class="container"> | |
<!-- Original Data Table --> | |
<div class="table-container"> | |
<h2>Original Gesture Data</h2> | |
<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="table-container"> | |
<h2>Updated Gesture Data</h2> | |
<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> | |
<!-- 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> | |