{% extends "distributed/base_manage.html" %}
{% load i18n %}
{% load my_filters %}

{% block title %}{% trans "Select facility" %} {{ block.super }}{% endblock title %}

{% block headcss %}{{ block.super }}
    <style>
/*        .default-setter {
            font-size: 14px;
        }*/
        section#facility_list {
            margin-bottom: 20px;
        }
        .facility_title a {
            font-size: 1.25em;
        }
        #id_default_language {
            margin-top: 10px;
            margin-bottom: 10px;
        }
    </style>
{% endblock headcss %}


{% block content %}
    {{ path_template }}
    <div id="facility_list_container">
        <section id="facility_list">
            <h2>{% trans "Please select a facility" %}</h2>
            <p>{% trans "A facility is a physical location where learners learn." %}</p>
        </section>
        <div>
            <ul>
                {% if facilities %}
                    {% for facility in facilities %}
                        <li class="facility_title">
                            <a href="{{ selection_paths|get_item:facility.id }}">{{ facility }}</a>
                            {% if request.is_admin and facilities.count > 1 %}
                                {% if facility.is_default %}
                                <span class=default-setter>{% trans "(this is the default)" %}</span>
                                {% else %}
                                <a class=default-setter href="{{ selection_paths|get_item:facility.id  }}?set_default=True">
                                {% trans "(set as the default facility)" %}
                                </a>
                                {% endif %}
                            {% endif %}
                    </li>
                    {% endfor %}
                {% else %}
                    {% if request.is_admin %}
                        <li>{% trans "You currently have no facilities. Would you like to create a facility?" %}</li>
                    {% else %}
                        <li>{% trans "There are currently no facilities available, please ask an administrator or coach to set one up." %}</li>
                    {% endif %}
                {% endif %}
            </ul>
        </div>
    </div>
{% endblock content %}
