{% extends "master.html" %}

{% block title %}Distributions Participating · Anitya{% endblock %}

{% block body %}

<div class="page-header">
  <h1>Distributions participating</h1>
</div>

<div class="row show-grid">
  <div class="col-sm-6">
    {% if total_page > 1 %}
    <ul class="pagination pagination-sm">
        <li>
            {% if page > 1%}
              <a href="{{ url_for('anitya_ui.distros') }}?page={{page - 1}}">
                «
              </a>
            {% else %}
              <a> « </a>
            {% endif %}
        </li>
        <li>
            <a> {{ page }} / {{ total_page }} </a>
        </li>
        <li>
            {% if page < total_page %}
              <a href="{{ url_for('anitya_ui.distros') }}?page={{page + 1}}">
                »
              </a>
            {% else %}
              <a> » </a>
            {% endif %}
        </li>
    </ul>
    {% endif %}
  </div>
</div>

<div class="row">
  <p>
    Here is the list of all the distributions that anitya knows about.
  </p>
  <p>
    <a href="{{ url_for('anitya_ui.add_distro') }}">
      <button type="submit" class="btn btn-success">
        <span class="glyphicon glyphicon-edit"></span>
        Add a new distribution
      </button>
    </a>
  </p>
  <div class="list-group">
  {% for distro in distros %}
    <span class="list-group-item">
      <h4 class="list-group-item-heading">
        <a href="{{ url_for('anitya_ui.distro', distroname=distro.name) }}">
          {{distro.name}}
        </a>
      </h4>
      {% if is_admin %}
      <a href="{{ url_for('anitya_ui.edit_distro', distro_name=distro.name) }}">
        <button type="submit" class="btn btn-info">
          <span class="glyphicon glyphicon-edit"></span>
          Edit
        </button>
      </a>
      <a href="{{ url_for('anitya_ui.delete_distro', distro_name=distro.name) }}">
        <button type="submit" class="btn btn-warning btn-sm pull-right">
          <span class="glyphicon glyphicon-remove"></span>
            Delete
        </button>
      </a>
      {% endif %}
      <div class="clearfix"></div>
    </span>
  {% else %}
  <blockquote>
      Oups this is embarrassing, it seems that no distributions are participating
      currently.
  </blockquote>
  {% endfor %}
  </div>
</div>

{% endblock %}
