{% extends "languages/base.html" %}
{% load i18n %}
{% load txcommontags %}
{% load statistics %}

{% block body_class %}{{ block.super }} language_detail{% endblock %}

{% block title %}{{ block.super }} | {{ language }}{% endblock %}

{% block breadcrumb %}{{ block.super }} &raquo; {{ language.name }}{% endblock %}

{% block content_title %}<h2 class="pagetitle">{{ language.name }} <sup class="entry_metalink">{{ language.code }}</sup></h2>{% endblock %}

{% block content_main %}

 {% for collection in collection_list %}
  {% with collection.releases.all as releases %}
  <h3>{% blocktrans %}{{ collection }} Releases{% endblocktrans %}
  {% render_metacount releases _("releases") %}
  </h3>

  {% if releases %}
  <div class="release_list">
  <p class="explanation">{% blocktrans %}The {{ collection }} collection includes the following groups of shipped components:{% endblocktrans %}</p>
  <ul class="simple bigthings">
  {% for release in releases %}
    <li><p class="i16 release"><a href="{% url language_release language.code collection.slug release.slug %}">{{ release.name }}</a>
    {% if release.description %}<span class="description">– {{ release.description }}</span>{% endif %}</p></li>
  {% endfor %}
  </ul>
  </div>
  {% else %}
    {% if request.user.is_authenticated and perms.txcollections.add_release %}
    {% url collection_release_create slug=collection.slug as release_create %}
    <p class="i16 tip">{% blocktrans %}No releases are registered for this collection yet. Why don't you <a href="{{ release_create }}">add one</a>?{% endblocktrans %}</p>
    {% endif %}
  {% endif %}
  {% endwith %}

 {% endfor %}

{% endblock %}
