- Added responsive table styles with mobile card layouts to base.html - Converted all templates from Bootstrap/plain CSS to Tailwind CSS - Implemented responsive tables with horizontal scroll on desktop - Added mobile card layouts for better readability on small screens - Standardized form layouts with Tailwind responsive grid - Updated all 15 templates for consistent styling: * base.html (responsive table CSS) * index.html (responsive tables + mobile cards) * students.html (Bootstrap -> Tailwind) * student_detail.html (Bootstrap -> Tailwind) * add_student.html (Bootstrap -> Tailwind) * edit_student.html (Bootstrap -> Tailwind) * import_students.html (Bootstrap -> Tailwind) * loan_tablet.html (Bootstrap -> Tailwind) * history.html (plain CSS -> Tailwind) * non_loanable_devices.html (plain CSS -> Tailwind) * add_non_loanable_device.html (plain CSS -> Tailwind) * edit_non_loanable_device.html (plain CSS -> Tailwind) * add_tablet.html (plain CSS -> Tailwind) * add_user.html (plain CSS -> Tailwind) * project_management.html (plain CSS -> Tailwind)
157 lines
8.6 KiB
HTML
157 lines
8.6 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ gettext('Import Students from CSV') }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="max-w-4xl mx-auto space-y-6">
|
|
{# Page Header #}
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-gray-900">{{ gettext('Import Students from CSV') }}</h1>
|
|
<p class="text-gray-600 mt-1">{{ gettext('Bulk import student data from a CSV file') }}</p>
|
|
</div>
|
|
|
|
{# Instructions Card #}
|
|
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
<div class="bg-cobalt-600 px-6 py-4">
|
|
<h2 class="text-lg font-semibold text-white">{{ gettext('Instructions') }}</h2>
|
|
</div>
|
|
<div class="p-6">
|
|
<ul class="space-y-2 text-gray-700">
|
|
<li class="flex items-start gap-2">
|
|
<svg class="w-5 h-5 text-cobalt-600 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
</svg>
|
|
{{ gettext('Upload a CSV file with student data') }}
|
|
</li>
|
|
<li class="flex items-start gap-2">
|
|
<svg class="w-5 h-5 text-cobalt-600 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
</svg>
|
|
{{ gettext('The file should be encoded in ISO-8859-1 (Latin-1)') }}
|
|
</li>
|
|
<li class="flex items-start gap-2">
|
|
<svg class="w-5 h-5 text-cobalt-600 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
</svg>
|
|
{{ gettext('Required columns: Apellidos, Nombre (will be split), C.I.A.L., Fecha Nac.') }}
|
|
</li>
|
|
<li class="flex items-start gap-2">
|
|
<svg class="w-5 h-5 text-cobalt-600 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
</svg>
|
|
{{ gettext('Optional columns: NIF/NIE/Pas., Registro, Expediente, Sexo, Grupo') }}
|
|
</li>
|
|
<li class="flex items-start gap-2">
|
|
<svg class="w-5 h-5 text-cobalt-600 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
</svg>
|
|
{{ gettext('The "Estudio" column will be discarded') }}
|
|
</li>
|
|
<li class="flex items-start gap-2">
|
|
<svg class="w-5 h-5 text-cobalt-600 mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
|
</svg>
|
|
{{ gettext('Duplicate students (by CIAL code or NIF/NIE) will be skipped') }}
|
|
</li>
|
|
</ul>
|
|
<div class="mt-4 p-3 bg-gray-50 rounded-lg">
|
|
<p class="text-sm text-gray-600">
|
|
{{ gettext('Example CSV format:') }}<br>
|
|
<code class="text-xs bg-gray-200 px-2 py-1 rounded">Nº Or.,"Apellidos, Nombre",Fecha Nac.,C.I.A.L.,NIF/NIE/Pas.,Registro,Expediente,Sexo,Grupo,Estudio</code>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{# Upload Form #}
|
|
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
<div class="bg-green-600 px-6 py-4">
|
|
<h2 class="text-lg font-semibold text-white">{{ gettext('Upload CSV File') }}</h2>
|
|
</div>
|
|
<div class="p-6">
|
|
<form method="POST" action="{{ url_for('import_students') }}" enctype="multipart/form-data" class="space-y-4">
|
|
<div>
|
|
<label for="csv_file" class="block text-sm font-medium text-gray-700 mb-1">{{ gettext('CSV File') }} *</label>
|
|
<input type="file" id="csv_file" name="csv_file" accept=".csv" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-cobalt-500 focus:border-cobalt-500">
|
|
<p class="mt-1 text-sm text-gray-500">{{ gettext('Select a CSV file to upload') }}</p>
|
|
</div>
|
|
|
|
<div class="flex justify-end gap-3">
|
|
<a href="{{ url_for('list_students') }}"
|
|
class="inline-flex items-center gap-2 px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition-colors">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
|
</svg>
|
|
{{ gettext('Cancel') }}
|
|
</a>
|
|
<button type="submit"
|
|
class="inline-flex items-center gap-2 px-4 py-2 bg-cobalt-600 text-white rounded-lg hover:bg-cobalt-700 transition-colors">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"></path>
|
|
</svg>
|
|
{{ gettext('Import Students') }}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{# Sample Data Preview #}
|
|
<div class="bg-white rounded-lg shadow overflow-hidden">
|
|
<div class="bg-gray-600 px-6 py-4">
|
|
<h2 class="text-lg font-semibold text-white">{{ gettext('Sample Data Format') }}</h2>
|
|
</div>
|
|
<div class="p-6">
|
|
<div class="table-container">
|
|
<table class="table-responsive">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ gettext('Nº Or.') }}</th>
|
|
<th>{{ gettext('Apellidos, Nombre') }}</th>
|
|
<th>{{ gettext('Fecha Nac.') }}</th>
|
|
<th>{{ gettext('C.I.A.L.') }}</th>
|
|
<th>{{ gettext('NIF/NIE/Pas.') }}</th>
|
|
<th>{{ gettext('Registro') }}</th>
|
|
<th>{{ gettext('Expediente') }}</th>
|
|
<th>{{ gettext('Sexo') }}</th>
|
|
<th>{{ gettext('Grupo') }}</th>
|
|
<th class="text-gray-400 line-through">{{ gettext('Estudio') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>García López, María</td>
|
|
<td>15/03/2005</td>
|
|
<td>12345678A</td>
|
|
<td>12345678A</td>
|
|
<td>REG001</td>
|
|
<td>EXP001</td>
|
|
<td>F</td>
|
|
<td>2º ESO A</td>
|
|
<td class="text-gray-400 line-through">ESO</td>
|
|
</tr>
|
|
<tr>
|
|
<td>2</td>
|
|
<td>Martínez Ruiz, Carlos</td>
|
|
<td>22/07/2004</td>
|
|
<td>87654321B</td>
|
|
<td>87654321B</td>
|
|
<td>REG002</td>
|
|
<td>EXP002</td>
|
|
<td>M</td>
|
|
<td>3º ESO B</td>
|
|
<td class="text-gray-400 line-through">ESO</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p class="mt-3 text-sm text-gray-500">
|
|
<span class="text-gray-400 line-through">{{ gettext('Estudio') }}</span>
|
|
{{ gettext('column will be discarded during import') }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|