{% extends 'base.html' %}
{% load i18n static %}

{% block title %}{% trans "Home" %}{% endblock %}
{% block content %}
<div class="container" style="margin-top: 20px">
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">
            {% if msg %}
            <div class="alert alert-{{tag}}">{{msg}}</div>
            {% endif %}
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">Emergency Bag Checklist</h5>
                </div>
                <div class="card-body">
                    {% if checklist %}
                    <ul class="list-group">
                        {% for item in checklist %}
                        <li class="list-group-item">
                            <input type="checkbox" id="item{{ forloop.counter }}" name="item{{ forloop.counter }}" value="item{{ forloop.counter }}">
                            <label for="item{{ forloop.counter }}">  {{ item }}</label>
                        </li>
                        {% endfor %}
                    </ul>
                    {% else %}
                    <p>No checklist available</p>
                    {% endif %}
                    <form action="{% url 'disasterchecklist' %}" method="POST">
                        {% csrf_token %}
                        <div class="form-group" style="margin-top: 20px;">
                            <button type="submit" class="btn btn-success">Complete Checklist</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-md-2"></div>
    </div>
</div>
{% endblock %}
