{% extends 'main.html' %}

{% block content %}
<div class="container">
    <h3>Create Reference Link:</h3>
    <p>Enter a <b>name</b> for the link (<i>it will be displayed on the species page</i>) and a valid URL (<i>copied from a verified webpage</i>).</p>
    <div>
        <table>
            <form method="POST" enctype="multipart/form-data" action="">
                {% csrf_token %}
                {{form.as_table}}
                <td> </td><td style="text-align: left; padding-top: 1em;"><input type="Submit" value="Submit"></td>
                {% if form.errors %}
                    <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
                    <tr><td></td><td><font style="color:#860404;" ><b>Errors:</b></font><td></td></tr>
                    {% for field, errors in form.errors.items %}
                    <tr>
                        {% for error in errors %}
                            <td>{{ field|title }}:</td><td><font style="color:#860404;" >{{ error }}</font></td>
                        {% endfor %}                       
                    </tr>
                    {% endfor %} 
                    {% for field, errors in form.non_field_errors.items %}
                    <tr>
                        {% for error in errors %}
                            <td>{{ field|title }}:</td><td><font style="color:#860404;" >{{ error }}</font></td>
                        {% endfor %}                       
                    </tr>
                    {% endfor %}  
                {% endif %}                   
            </form>
        </table>
    </div>
    <p><small>&nbsp;</small></p>
</div>
{% endblock content %}