{% extends "base.html" %}
{% load static %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card mt-5">
                <div class="card-body">
                    <h3 class="card-title text-center">Acceso para Técnicos</h3>
                    <form method="post">
                        {% csrf_token %}
                        {% if messages %}
                            {% for message in messages %}
                                <div class="alert alert-danger">{{ message }}</div>
                            {% endfor %}
                        {% endif %}
                        <div class="mb-3">
                            <label for="technician" class="form-label">Seleccione su nombre</label>
                            <select class="form-select" id="technician" name="technician">
                                {% for technician in technicians %}
                                    <option value="{{ technician.id }}">{{ technician.get_full_name|default:technician.username }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="mb-3">
                            <label for="pin" class="form-label">PIN</label>
                            <input type="password" class="form-control" id="pin" name="pin" maxlength="4" inputmode="numeric" pattern="[0-9]*">
                        </div>
                        <div class="d-grid">
                            <button type="submit" class="btn btn-primary">Ingresar</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
