{% extends "portal/teach/base_registering.html" %}
{% load static %}
{% load app_tags %}

{% block content %}
<div id="onboarding_organisation_page"></div>

{% if teacher.school %}
<div class="background background--primary">
    <div class="form col-sm-8 col-center">
        <section class="background">
            <h4>It looks like you've already created your school ({{ user.new_teacher.school.name }})</h4>
            <a href="{% url 'onboarding-classes' %}" class="button button--primary">Add a class</a>
        </section>
    </div>
</div>
{% else %}
<div class="background container">
    <div class="row">
        <div class="form col-sm-12">
            <h4>Create a school or club</h4>

            <p class="mb-3">Progress &lt; 1 of 4 &gt;</p>
            <div class="progress">
                <div class="progress-bar" role="progressbar" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" style="width: 25%;">
                    <span class="sr-only">25% Complete</span>
                </div>
            </div>
            <p>As the first person from your school or club to register for Code for Life, by default, you become the
                organisation's administrator.</p>

            <form id="form-create-organisation" method="post">

                {% csrf_token %}

                {{ create_form.non_field_errors }}

                {% for field in create_form %}
                <div id="form-row-{{ field.name }}" class="row form--row">
                    <div class="form--row__input col-sm-6 col-xs-12">
                        <div class="input--icon">
                            {{ field }}
                            {% if not field == create_form.country and not field == create_form.county %}
                            <span class="iconify" data-icon="mdi:domain"></span>
                            {% endif %}
                        </div>
                        <small>{{ field.help_text }}</small>
                        {{ field.errors }}
                    </div>
                </div>
                {% endfor %}

                <div class="section group">
                    <button type="submit" class="button button--primary" name="create_organisation" id="create_organisation_button">Create school or club</button>
                </div>

            </form>
        </div>
    </div>
</div>
{% endif %}

<script type="text/javascript"
        src="{% static 'portal/js/school.js' %}"></script>

{% endblock content %}
