{% load i18n %}
{% if milestone.task_set.all %}
    <table class="projetor-milestone-progress-table">
        <tbody>
            <tr>
                {% with milestone.get_finished_tasks_count_as_percentage as finished %}
                {% if finished %}
                    <td class="projector-milestone-progress-table-finished show-tipsy"
                        title="{% trans "Closed tasks" %} {{ milestone.get_finished_tasks_count }} / {{ milestone.get_tasks_count }}"
                        width="{{ milestone.get_finished_tasks_count_as_percentage }}%">
                        <a href="{{ milestone.project.get_task_list_url }}?is_resolved=2&milestone={{ milestone.id }}"
                           class="block-link">{% trans "Done" %} {{ milestone.get_finished_tasks_count_as_percentage|floatformat:"2" }}%</a>
                    </td>
                {% endif %}
                {% endwith %}
                {% with milestone.get_unfinished_tasks_count_as_percentage as unfinished %}
                {% if unfinished %}
                <td class="projector-milestone-progress-table-unfinished show-tipsy"
                        title="{% trans "Opened tasks" %} {{ milestone.get_unfinished_tasks_count }} / {{ milestone.get_tasks_count }}">
                    <a href="{{ milestone.project.get_task_list_url }}?is_resolved=3&milestone={{ milestone.id }}"
                       class="block-link">{% trans "Left" %} {{ milestone.get_unfinished_tasks_count_as_percentage|floatformat:"2" }}%</a>
                </td>
                {% endif %}
                {% endwith %}
            </tr>
        </tbody>
    </table>
{% else %}
    <ul class="messages">
        <li class="message message-info">{% trans "No tasks for this milestone were found" %}</li>
    </ul>
{% endif %}
