{% extends "base.html" %}
{% load i18n %}
{% load url from future %}

{% block breadcrumbs %}
<li><a href="{{ object.get_absolute_url }}">{{ object }}</a></li>
{% endblock %}

{% block content %}

<h2>{% trans "Project Information" %}</h2>

<a class="menu-float" href="{{ object.get_widgets_url }}">
<img src="{% url 'widget-image' project=object.slug widget='shields' color='badge' extension='svg' %}" />
</a>

<table class="info">
{% include "project_info.html" %}
</table>

<h2>{% trans "Subprojects" %}</h2>

<table class="sort">
<thead>
<tr>
<th>{% trans "Subproject" %}</th>
<th colspan="2">{% trans "Translated" %}</th>
</tr>
<tbody>
{% for prj in object.subproject_set.select_related %}
{% with prj.get_translated_percent as percent and prj.get_fuzzy_percent as fuzzy and prj.get_failing_checks_percent as check_percent %}
<tr>
<th><a href="{{ prj.get_absolute_url }}">{{ prj.name }}</a></th>
<td><div class="progress" data-value="{{ percent|floatformat:0 }}" data-fuzzy="{{ fuzzy|floatformat:0 }}" data-checks="{{ check_percent|floatformat:0 }}"></div></td>
<td class="percent">{{ percent }}%</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>

{% include "legend.html" %}

<h2>{% trans "Tools" %}</h2>

<div class="tabs" id="project-tabs">
<ul>
<li><a href="#changes">{% trans "History" %}</a></li>
<li><a href="#dicts">{% trans "Glossaries" %}</a></li>
{% if perms.trans.commit_translation or perms.trans.update_translation %}
<li><a href="{% url 'git_status_project' project=object.slug %}">{% trans "Git maintenance" %}</a></li>
{% endif %}
<li><a href="#share">{% trans "Share" %}</a></li>
<li><a href="{% url 'view_activity_project' project=object.slug %}">{% trans "Activity" %}</a></li>
</ul>

<div id="dicts">
<ul>
{% for dict in dicts %}
<li><a href="{% url 'show_dictionary' project=object.slug lang=dict.code %}">{{ dict }}</a></li>
{% endfor %}
<li><a href="{% url 'show_dictionaries' project=object.slug %}">{% trans "Manage all glossaries" %}</a></li>
</ul>
</div>

<div id="changes">
{% include "last-changes.html" %}
</div>

<div id="share">
{% with object as project %}
{% include 'share.html' %}
{% endwith %}
</div>

</div>

{% endblock %}
