{% extends "./add-forge-common.html" %}

{% comment %}
Copyright (C) 2022-2026  The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}

{% block header %}
  {{ block.super }}
  <noscript>
    {% if 'no_js' not in request.GET %}
      <meta http-equiv="refresh"
            content="0; url={{ request.build_absolute_uri }}?no_js=on" />
    {% endif %}
  </noscript>
{% endblock header %}

{% block tab_content %}
  <div id="swh-add-forge-requests-list"
       class="tab-pane active mt-3"
       style="width: 100%">
    <table id="add-forge-request-browse"
           class="table swh-table swh-table-striped js-only">
      <thead>
        <tr>
          <th>Submission date</th>
          <th>Forge type</th>
          <th>Forge URL</th>
          <th>Status</th>
          <th></th>
        </tr>
      </thead>
    </table>
    {% if 'no_js' in request.GET %}
      <noscript>
        <table id="add-forge-request-browse-no-js"
               class="table swh-table swh-table-striped">
          <thead>
            <tr>
              <th>Submission date</th>
              <th>Forge type</th>
              <th>Forge URL</th>
              <th>Status</th>
              <th></th>
            </tr>
          </thead>
          {% for user_request in user_requests %}
            <tr>
              <td>{{ user_request.submission_date }}</td>
              <td>{{ user_request.forge_type }}</td>
              <td>{{ user_request.forge_url }}</td>
              <td>{{ user_request.status }}</td>
              <td></td>
            </tr>
          {% endfor %}
        </table>
      </noscript>
    {% endif %}
    <div id="add-forge-browse-request-error"></div>
  </div>
{% endblock tab_content %}
