{% extends 'base.html' %}
{% block content %}
    <div class="container">
        <h3>Subjob {{ subjob_id }} of Job {{ job_id }} Directory</h3>
        <hr>
        <div class="d-flex justify-content-between align-items-center mb-3">
            <p class=" my-0 py-0 d-inline"><b>Current location:</b> {{ abs_path }}</p>
            <a class="btn btn-primary btn-sm" href="{{ url_for('browse_job', job_id=job_id, path=back_path) }}">Go
                back</a>
        </div>
        <div class="row">
            <div class="col">
                <table class="table table-striped table-bordered text-center table-responsive-sm">
                    <thead>
                    <tr>
                        <th class="align-middle" scope="col">Type</th>
                        <th class="align-middle" scope="col">Name</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for file in files_info %}
                        <tr>
                            <th class="align-middle px-3 font-weight-normal"
                                style="width: 1%">{{ 'Directory' if file.directory else 'File' }}</th>
                            <td class="align-middle text-left"><a
                                    href="{{ (request.path + '/' if request.path != '/' else '') + file.file }}"
                                    class="btn-link">{{ file.file }}</a></td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock content %}
{% block footer %}
{% endblock footer %}