{% extends "projects/project_menu.html" %}
{% load i18n %}
{% load markup %}
{% load addons %}
{% load txcommontags %}
{% load watches_tags %}
{% load permissions %}
{% load upload_manager_tags %}
{% load avatars %}
{% load tx_action_log %}


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

{% block title %}{{ block.super }} | {{ project.name }}{% endblock %}

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


{% block content_main %}

{% get_permission "project_perm.maintain" for request.user and project as "is_maintainer" %}
  <div class="obj_bigdetails">


 
  <div class="details separate">

  <h3>{% blocktrans %}Details{% endblocktrans %}</h3>
  <table class="definition">
    {% if request.user.is_authenticated%}
      {% url notification.views.notices as notices_url %}
      {% if notices_url %}
   <tr>
      <th class="i16 watch">{% trans "Watch:" %}</th>
      <td>
        {% watch_toggle project %}
    </td>
    </tr>
      {% endif %}
    {% endif %}
    {% if project.homepage %}
    <tr>
      <th class="homepage i16">{% trans "Homepage:" %}</th>
      <td><a title="{% blocktrans with project.name as project_name %}Homepage for {{ project_name }}{% endblocktrans %}" href="{{ project.homepage }}" target="_blank" >{{ project.homepage }}</a></td>
    </tr>
    {% endif %}
    {% if project.bug_tracker %}
    <tr>
      <th class="bug i16">{% trans "Bug tracker:" %}</th>
      <td><a title="{% blocktrans with project.name as project_name %}Bug tracker for {{ project_name }}{% endblocktrans %}" href="{{ project.bug_tracker }}" target="_blank" >{{ project.bug_tracker }}</a></td>
    </tr>
    {% endif %}
    {% if project.tags %}
    <tr>
      <th class="i16 tag">{% trans "Tags:" %}</th>
      <td class="compact">
        {% for tag in project.tagsobj.all|slice:"0:6" %}<a class="tag" href="{% url project_tag_list tag=tag %}">{{ tag }}</a> {% endfor %}
      </td>
    </tr>
    {% endif %}
    {% with project.maintainers.all as maintainers %}
    {% if maintainers %}
    <tr>
      <th class="i16 maintainer">{% blocktrans count maintainers|length as counter %}Maintainer:{% plural %}Maintainers:{% endblocktrans %}</th>
      <td>
        {% for m in maintainers|slice:"0:6" %}
          <img class="border" src="{% avatar 16 m %}" style="vertical-align:middle"/>
          {% if m.first_name and m.last_name %}
            {{ m.first_name }} {{ m.last_name }}
            (<a href="{% url profile_public m.username %}">{{m.username}}</a>)
          {% else %}
            <a href="{% url profile_public m.username %}">
            {{m.username}}
            </a>
          {% endif %}
            {% if not forloop.last %},{% endif %}
        {% endfor %}
      </td>
    </tr>
    {% endif %}
    {% endwith %}

    {% with project.trans_instructions as instructions_url %}
    {% if instructions_url %}
    <tr>
      <th class="help i16">{% trans "Documentation:" %}</th>
      <td><a title="{% trans "Documentation of the translation procedure of this project" %}" href="{{ instructions_url }}" target="_blank">{% trans "Translation help pages" %}</a></td>
    </tr>
    {% endif %}
    {% endwith %}

    {% hook "additional_project_details.html" %}

{% comment %}
    <tr>
      <th class="i16 link">{% trans "External links:" %}</th>
      <td><ul>
        <li>{% trans "Screenshots" %}</li>
        </ul>
      </td>
    </tr>
{% endcomment %}
  </table>
  {% with project.long_description_html as long_desc %}
  {% if long_desc %}
  <div class="long_description">
    {{ long_desc|truncatewords_html:"100"|safe }}
  </div>
  {% endif %}
  {% endwith %}
	
</div>

{% if project.resources.count or not project.releases.count %}

  {% include "projects/resource_list.html" %}
  {% hook "project.html" overview_top %}
  {% include "projects/release_list.html" %}

{% else %}

  {% include "projects/release_list.html" %}
  {% include "projects/resource_list.html" %}
  {% hook "project.html" overview_top %}

{% endif %}

</div>

<div id="project-history">
	<h3>{% trans 'History' %}</h3>
	{% get_log 10 as action_log for_object project %}
	{% if not action_log %}
	
	<p class="i16 infomsg">{% trans 'No history recorded yet.' %}</p>
	
	{% else %}
	
	<ul class="actionlist simple">
	{% for entry in action_log %}
	<li class="i16 actionlog">
	    {{ entry.message|safe }} by {{ entry.user }}. <span class="timestamp">{{ entry.action_time|timesince }} ago.</span>
	</li>
	{% endfor %}
	</ul>
	{% hook "project.html" overview %}
	
	{% endif %}
</div>

{% endblock %}

{% block content_footer %}
<div id="content_footer_center">
</div>

{% endblock %}


