{% extends "repo_master.html" %}

{% block title %}Forks - {{
    repo.namespace + '/' if repo.namespace }}{{ repo.name }}{% endblock %}
{% set tag = "home" %}


{% block repo %}

<h2>Forks <span class="label label-default">{{repo.forks | count}}</span></h2>

<section class="forks_list">
  {% if repo.forks %}
  <div class="list-group">
    {% for fork in repo.forks %}
      <div class="list-group-item">
        <h5>
          <strong><a href="{{ url_for('ui_ns.view_repo',
                repo=fork.name,
                username=fork.user.user,
                namespace=repo.namespace) }}">
              <i class="fa fa-code-fork text-muted"></i>
              {{ fork.user.user }}/{{ fork.name }}
          </a></strong>
          <div class="pull-xs-right">
            <span>
              <a href="{{ url_for('ui_ns.view_user', username=fork.user.user)}}">
                {{ fork.user.default_email | avatar(20) | safe }}
                {{ fork.user.fullname or fork.user.user }}
              </a> forked this project
            </span>
            <span class="commitdate" data-toggle="tooltip" title="{{
                fork.date_created | format_datetime }}">
                <strong>{{ fork.date_created|humanize }}</strong>
            </span>
          </div>
        </h5>
      </div>

    {% endfor %}
  </div>
  {% else %}
  <p>
    This project has not been forked.
  </p>
  {% endif %}
</section>

{% endblock %}
