{% extends "base.html" %}
{% load cycle from future %}
{% load static from staticfiles %}
{% load flags %}

{% block title %}{{ BRANDING_DISTRONAME }} - Mirror Overview{% endblock %}

{% block head %}<link rel="stylesheet" type="text/css" href="{% static "flags/fam.css" %}" media="screen, projection" />{% endblock %}

{% block content %}
<div id="dev-mirrorlist" class="box">
    <h2>Mirror Overview</h2>
    <table class="results">
        <thead>
            <tr>
                <th>Server</th>
                <th>Country</th>
                <th>Tier</th>
                <th>ISOs</th>
                <th>Protocols</th>
                {% if user.is_authenticated %}
                <th>Public</th>
                <th>Active</th>
                <th>Admin Email</th>
                <th>Notes</th>
                {% endif %}
            </tr>
        </thead>
        <tbody>
            {% for mirror in mirror_list %}
            <tr class="{% cycle 'odd' 'even' %}">
                <td><a href="{{ mirror.get_absolute_url }}"
                        title="Mirror details for {{ mirror.name }}">{{ mirror.name }}</a></td>
                <td class="country">{% if mirror.country %}{% country_flag mirror.country %}{{ mirror.country.name }}{% else %}Various{% endif %}</td>
                <td>{{ mirror.get_tier_display }}</td>
                <td>{{ mirror.isos|yesno|capfirst }}</td>
                <td class="wrap">{{ mirror.protocols|join:", " }}</td>
                {% if user.is_authenticated %}
                <td>{{ mirror.public|yesno|capfirst }}</td>
                <td>{{ mirror.active|yesno|capfirst }}</td>
                <td>{{ mirror.admin_email }}</td>
                <td class="wrap">{{ mirror.notes|linebreaks }}</td>
                {% endif %}
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% load cdn %}{% jquery %}{% jquery_tablesorter %}
<script type="text/javascript" src="{% static "archweb.js" %}"></script>
<script type="text/javascript">
$(document).ready(function() {
    $(".results").tablesorter({widgets: ['zebra'], sortList: [[2,0], [0,0]]});
});
</script>
{% endblock %}
