{% extends 'base.html' %}
{% block title %}{{ title }}{% endblock title %}
{% load crispy_forms_tags %}
{% load static %}

{% block content %}
<div id="input-nav"><a href="{% url 'home' %}" class="primary1">Home</a> <i>&rsaquo;</i> 
    <a href="{% url 'programs' %}" class="primary1">Programs</a> <i>&rsaquo;</i> Add</div>
<br>

{% if messages %}
    {% for message in messages %}
        {% if message.tags == 'error' %}
            <div class="alert alert-danger">
                <i class="fas fa-exclamation-circle"></i>{{ message }}
            </div>
        {% else %}
            <div class="alert alert-success">
                <i class="fas fa-check-circle"></i>{{ message }}
            </div>
        {% endif %}
    {% endfor %}
{% endif %}

<div class="row">
<div class="col-md-6 mx-auto">
    <div class="card">
        <p class="form-title">Program Add Form</p>
        <div class="p-3"><br>
            <form action="" method="POST">{% csrf_token %}
                <!-- {{ form|crispy }} -->
                
                <div class="form-group">
                    <b>{{ form.title.label }}</b>{{ form.title }}
                    <span class="danger">{{ form.title.errors }}</span>
                </div>
                <div class="form-group">
                    <b>{{ form.summary.label }}</b>{{ form.summary }}
                    <span class="danger">{{ form.summary.errors }}</span>
                </div>

                <input class="btn btn-outline-primary" type="submit" value="Save">
            </form>
        </div>
    </div>
</div>
</div>
{% endblock content %}
