{% extends "coprs/detail.html" %}
{% from "_helpers.html" import copr_name, copr_owner_url, initialize_datatables %}

{% block title %}Forks of {{ copr_name(copr) }}{% endblock %}
{% set selected_tab = "forks" %}

{%block project_breadcrumb %}
<li class="active">Forks</li>
{%endblock%}

{% block detail_body %}
{% if g.user %}
<a class="btn btn-primary button-new pull-right" href="{{ copr_url('coprs_ns.copr_fork', copr) }}"><i class="fa fa-code-fork"></i> Fork this project</a>
{% endif %}
<h2 class="page-title">Forks of the project</h2>

{% if copr.forks %}
<noscript><p>WARNING!! This page is using JavaScript to filter and sort the table.</p></noscript>
<table class="datatable table table-striped table-bordered">
  <thead>
  <tr>
    <th>Owner</th>
    <th>Name</th>
  </tr>
  </thead>
  <tbody>
  {% for fork in copr.forks %}
    <tr class="fork-row" >
      <td class="col-md-3" data-order="{{ fork.owner_name }}">
        <b><a href="{{ copr_owner_url(fork) }}">{{ fork.owner_name }}</a></b>
      </td>
      <td>
        <b><a href="{{ copr_url('coprs_ns.copr_detail', fork) }}">{{ fork.name }}</a></b>
      </td>
    </tr>
  {% endfor %}
  </tbody>
</table>
{% else %}
<h3>Nobody forked this project</h3>
{% endif %}

{{ initialize_datatables() }}

{% endblock %}
