{% extends "../body.html" %}
{% load util %}
{% load static %}
{% block content %}
<script src="{% static 'js/jobs/repository.js' %}"></script>
<div class="table-responsive aw-data">
    <table class="table table-striped aw-text-responsive" id="aw-api-data-table">
        <tr>
            <th>Name{% include "../button/icon/sort.html" %}</th>
            <th>Type{% include "../button/icon/sort.html" %}</th>
            <th class="aw-responsive-med">Path/Origin{% include "../button/icon/sort.html" %}</th>
            <th>Status{% include "../button/icon/sort.html" %}</th>
            <th>Actions</th>
        </tr>
        <tr>
            <td colspan="100%">
                {% include "../button/refresh.html" %}
                <a href="/ui/jobs/repository/git/0">
                    <button class="btn btn-success aw-btn-action" title="Add Git">
                        {% include "../button/icon/add_git.html" %}
                    </button>
                </a>
                <a href="/ui/jobs/repository/static/0">
                    <button class="btn btn-success aw-btn-action" title="Add Static">
                        {% include "../button/icon/add_dir.html" %}
                    </button>
                </a>
            </td>
        </tr>
        <tr id="aw-api-data-tmpl-row" hidden="hidden">
            <td></td>
            <td></td>
            <td class="aw-responsive-med"></td>
            <td></td>
            <td></td>
        </tr>
    </table>
    <div id="aw-api-data-tmpl-actions" hidden="hidden">
        <a href="/ui/jobs/repository/${RTYPE}/${ID}">
            <button class="btn btn-warning aw-btn-action" title="Edit">
                {% include "../button/icon/edit.html" %}
            </button>
        </a>
        <button class="btn btn-danger aw-btn-action aw-api-click" title="Delete" aw-api-endpoint="repository" aw-api-item="${ID}" aw-api-method="delete">
            {% include "../button/icon/delete.html" %}
        </button>
        <a href="/ui/jobs/log">
            <button class="btn btn-info aw-btn-action" title="Logs">
                <i class="fa-solid fa-scroll fa-2x aw-btn-action-icon"></i>
            </button>
        </a>
        <button class="btn btn-success aw-btn-action aw-api-click aw-repo-update" title="Download/Update" aw-api-endpoint="repository" aw-api-item="${ID}" aw-api-method="post">
            {% include "../button/icon/download.html" %}
        </button>
    </div>
    <div id="aw-api-data-tmpl-status" hidden="hidden">
        <b>Logs</b>:
        <a href="${LOG_STDOUT_URL}" title="${LOG_STDOUT}" download>Output</a>,
        <a href="${LOG_STDERR_URL}" title="${LOG_STDERR}" download>Error</a>
    </div>
</div>
{% endblock %}