{% extends "projects/base.html" %}
{% load i18n %}
{% load txcommontags %}
{% load pagination_tags %}

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

{% block title %}{{ block.super }} | {% trans "Project list" %}{% endblock %}

{% block extra_head %}
  <link rel="alternate" type="application/rss+xml" title="RSS" href="{% url project_latest_feed %}" />
{% endblock %}

{% block breadcrumb %}{% homelink %} &raquo; {% trans "Projects" %}{% endblock %}

{% block content_title %}
<h2 class="pagetitle">{% if tag %}{% blocktrans %}Projects with tag '{{ tag }}'{% endblocktrans %} <sup class="entry_metalink">{{ project_list.count }}</sup></h2>
{% else %}{% trans "Projects on Transifex" %} {% render_metacount project_list _("projects") %}</h2>
{% endif %}
{% endblock %}

{% block content_header_sec %}
    {% if request.user.is_authenticated and perms.projects.add_project %}
    <div class="addproject content_header_sec">
     <a class="i16 buttonized add" href="{% url project_create %}">{% trans "Add a new project" %}</a>
    </div>
    {% endif %}
{% endblock %}

{% block content_sec %}
  <a class="simlink" href="{% url project_latest_feed %}" title="Projects feed"><img border="0" src="{{ STATIC_URL }}images/icons/feed.png" /></a>
{% endblock %}

{% block content_main %}
  {% autopaginate project_list 20 %}
  <div class="project_list obj_biglist">
  <div class="pagination top">{% paginate %}</div>
  {% for project in project_list %}
    <div class="entry">
      <h3 class="name"><a href="{{ project.get_absolute_url }}">{{ project.name }}</a></h3>
      <p class="description">{{ project.description }}</p>
      <p>
        <span class="i16 component compact">
          {% for comp in project.component_set.all|slice:"0:4" %}<a class="component" title="{% firstof comp.description|escape comp.name|escape %}" href="{{ comp.get_absolute_url }}">{{ comp.name }}</a> {% endfor %}
        </span>
      {% if project.tags %}| <span class="i16 tag compact">{% trans "Tags:" %} {% for tag in project.tagsobj.all|slice:"0:6" %}<a class="tag" href="{% url project_tag_list tag=tag %}">{{ tag }}</a> {% endfor %}</span>{% endif %}
      </p>

    </div>
  {% endfor %}
  <div class="pagination bottom">{% paginate %}</div>
  </div>
  {% if not project_list %}
  <p>{% trans "No projects registered yet. :-(" %}</p>
    {% if request.user.is_authenticated and perms.projects.add_project %}
  {% url project_create as project_create %}
  <p>{% blocktrans %}Why don't you <a href="{{ project_create }}">add one</a>?{% endblocktrans %}</p>
    {% endif %}
  {% endif %}
  
{% endblock %}

{% block content_footer %}
{% if request.user.is_authenticated and perms.projects.add_project %}
{% url project_create as project_create %}
  <div id="content_footer_center">
    <p><span class="i16 tip">{% blocktrans %}Couldn't find your project? Go ahead and <a href="{{ project_create }}">add it</a>!{% endblocktrans %}</span></p>
  </div>
{% endif %}
{% endblock %}
