<!-- templates/staff/import.html -->
{% extends 'base.html' %}
{% load static %}

{% block title %}Import Staff - Rapha-Bethel BNPS{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1 class="h3 mb-0 text-gray-800">Import Staff Members</h1>
        <a href="{% url 'staff:staff_list' %}" class="btn btn-outline-secondary">
            <i class="fas fa-arrow-left"></i> Back to Staff List
        </a>
    </div>

    <div class="row">
        <div class="col-md-8 mx-auto">
            <div class="card shadow">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0"><i class="fas fa-upload"></i> Upload Staff CSV File</h5>
                </div>
                <div class="card-body">
                    <form method="post" enctype="multipart/form-data" action="{% url 'staff:staff_import' %}">
                        {% csrf_token %}
                        
                        <div class="mb-4">
                            <label class="form-label">Select CSV File</label>
                            <input type="file" name="file" class="form-control" accept=".csv" required>
                            <small class="text-muted">
                                File must be in CSV format with headers: First Name, Last Name, Role, Department, Phone, Email
                            </small>
                        </div>
                        
                        <div class="mb-4">
                            <h6>CSV Format Example:</h6>
                            <pre class="bg-light p-3 rounded">
First Name,Last Name,Role,Department,Phone,Email
Mme,Nchotu Manka,proprietor,admin,651437143,proprietor@raphabethel.org
Mr.,Ferdinand Sunyin,head_master,english,676662567,f.sunyin@raphabethel.org
Mme,Chesi Landry,bursar,finance,651620915,c.landry@raphabethel.org</pre>
                        </div>
                        
                        <div class="d-grid gap-2">
                            <a href="{% url 'staff:download_sample_csv' %}" class="btn btn-success mb-2">
                                <i class="fas fa-download"></i> Download Sample CSV Template
                            </a>
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-upload"></i> Import Staff
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}