{% load custom_tags_and_filters %}
<div>
    {% if active_projects|length == 0 %}
        <h2>
            You cannot
            {% if not take_over %}
                reserve
            {% else %}
                use
            {% endif %}
            any tools because you are not a member of an active project. Please contact {{ facility_name }} staff to begin a project.
        </h2>
    {% elif active_projects|length == 1 %}
        <h2>
            Tool
            {% if tool.in_use %}
                reservation will be associated with
            {% else %}
                usage will be billed to
            {% endif %}
            the project named &quot;{{ active_projects.0 }}&quot;.
        </h2>
        <input type="hidden" name="project_id" value="{{ active_projects.0.id }}">
        <script>
        $("#pre_usage_questions").show();
		$("#start_reserve").show();

        </script>
    {% else %}
        <h2>
            {% if not take_over %}
                Associate tool reservation
            {% else %}
                Charge tool usage
            {% endif %}
            to which project?
        </h2>
        <div class="list-group" style="display:table">
            {% for project in active_projects %}
                <a href="javascript:void(0)"
                   class="list-group-item project-choice"
                   style="font-size:large"
                   onclick="select_project(this, {{ project.id }})">{% project_selection_display project %}</a>
            {% endfor %}
        </div>
        <input type="hidden" name="project_id" id="project_id">
    {% endif %}
</div>
