{% extends "base.html" %}
{% block body %}
    {% if is_ipython %}
        <h2>{{ short_path }}</h2>
    {% else %}
        <h2>File: <span class="code-font">{{ short_path }}</span></h2>
        <p><strong>Full path: </strong>{{ full_path }}</p>
    {% endif %}

    {% from 'info_panel.html' import info_panel %}

    {% call info_panel() %}
        <p>Click on a function name to view calls to that function.</p>
        <p>Click on the <i class="glyphicon glyphicon-play-circle"></i> icon
            to view the most recent call to that function.</p>
    {% endcall %}

    <br/>

    {% if funcs.module %}
        {% set func = funcs.module[0] %}
        <a href="{{ url_for('call_view', call_id=func.id) }}">
            <i class="glyphicon glyphicon-play-circle"></i>
        </a>
        <a class="code-font"
           href="{{ url_for('func_view', path=full_path, func_name=func.name) }}">
            Execution of module
        </a>
    {% endif %}

    {% if funcs.function %}
        <h3>Functions:</h3>
        <ul class="no-bullet">
        {% for func in funcs.function %}
            <li>
                {% if func.id %}
                    <a href="{{ url_for('call_view', call_id=func.id) }}">
                        <i class="glyphicon glyphicon-play-circle"></i>
                    </a>
                {% endif %}
                <a class="code-font"
                   href="{{ url_for('func_view', path=full_path, func_name=func.name) }}">
                    {{ func.name }}
                </a>
            </li>
        {% endfor %}
        </ul>
    {% endif %}
{% endblock -%}