{% extends "base.html" %} {% block title %}Students{% endblock %} {% block body %}
{% with messages = get_flashed_messages(with_categories=true) %} {% for cat, msg in messages %}
{{ msg }}
{% endfor %} {% endwith %} {# Excel Import – ADMIN ONLY #} {% if role == 'admin' %}

📥 Excel Import — Multi-file / Multi-sheet

✅ Accepted columns: uid/id/rfid   roll/roll_no   name   class/grade   section
📌 Missing class column → detected from sheet name or file name.
🔄 Same UID → updated (no duplicate entry).

{% endif %} {# Add Student Form #}

➕ Add Student{% if role == 'principal' %} (Single Entry Only){% endif %}

{# Student Table #}

👤 All Students ({{ students|length }})

{% if role == 'admin' %} {% endif %}
{% if role == 'admin' %}
{% endif %} {% if role == 'admin' %} {% endif %} {% if role == 'admin' %}{% endif %} {% for i, s in enumerate(students, 1) %} {% if role == 'admin' %} {% endif %} {% if role == 'admin' %} {% endif %} {% else %} {% endfor %}
#UIDRollNameClassSectionAction
{{ i }} {{ s["uid"] }} {{ s["roll_no"] or "–" }} {{ s["name"] }} {{ s["class"] }} {{ s["section"] or "–" }}
No students found. Add one above or import Excel.
{% if role == 'admin' %}
{% endif %}
{% endblock %}